·í§A¤U¸ü Perl ª½Ä¶¾¹¨Ã¦w¸Ë©ó§Aªº¹q¸£«á¡APerl À³¸Ó´N¤w¸g¦ì©ó§Aªº¹q¸£ªº°õ¦æ¸ô®|¤§¤¤¤F¡A¦]¦¹n´ú¸Õ Perl ¬O§_¦w¸Ë§¹¦¨¡A¥u»Ý¦b©R¥Oµøµ¡¤U¿é¤J¡Gperl -v ¦¹®É¹q¸£¿Ã¹õ§Y·|¦^À³Ãþ¦ü¤U¦C¤§°T®§¡GThis is perl, v5.6.0 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2000, Larry Wall Binary build 613 provided by ActiveState Tool Corp. http://www.ActiveState.com Built 12:36:25 Mar 24 2000 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5.0 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. Y§A¨£¨ì¦¹°T®§¡A¤j·§´N¥i¥H½T»{ Perl ¤w¦w¸Ë§¹¦¨¡C¡]¥Ñ¦¹°T®§¤]¥i¥H¬Ý¥X¡A§Úªº Perl ¬O¥Ñ ActiveState ¤½¥qקï«áªº Win32 ª©¥»¡C¡^Yn¨ú±oºë²ªº½u¤W¤ä´©¡A¥i¥H¿é¤J¡G
perl -h ¦^À³°T®§¦p¤U¡GUsage: C:\Perl\bin\Perl.exe [switches] [--] [programfile] [arguments] -0[octal] specify record separator (\0, if no argument) -a autosplit mode with -n or -p (splits $_ into @F) -C enable native wide character system interfaces -c check syntax only (runs BEGIN and END blocks) -d[:debugger] run program under debugger -D[number/list] set debugging flags (argument is a bit mask or alphabets) -e 'command' one line of program (several -e's allowed, omit programfile) -F/pattern/ split() pattern for -a switch (//'s are optional) -i[extension] edit <> files in place (makes backup if extension supplied) -Idirectory specify @INC/#include directory (several -I's allowed) -l[octal] enable line ending processing, specifies line terminator -[mM][-]module execute `use/no module...' before executing program -n assume 'while (<>) { ... }' loop around program -p assume loop like -n but print line also, like sed -P run program through C preprocessor before compilation -s enable rudimentary parsing for switches after programfile -S look for programfile using PATH environment variable -T enable tainting checks -u dump core after parsing program -U allow unsafe operations -v print version, subversion (includes VERY IMPORTANT perl info) -V[:variable] print configuration summary (or a single Config.pm variable) -w enable many useful warnings (RECOMMENDED) -W enable all warnings -X disable all warnings -x[directory] strip off text before #!perl line and perhaps cd to directory ³o¨Çºë²ªº½u¤W¤ä´©¡A¹ïªì¾ÇªÌ¨Ó»¡¡A¥i¯àÁÙ¬O²`¶ø¤F¤@¨Ç¡CYn¨ú±o§ó¸Ô²Óªº½u¤W¤ä´©¡A¥i¥H¹Á¸Õ perldoc ©R¥O¡A¨Ò¦p¡Gperldoc perl Yn¬d¸ß perldoc ¥»¨ªº¥\¯à¡A¥i¿é¤J¡Gperldoc perldoc Yn¬d¸ß perl ªº¦UºØ¨ç¼Æ¡A¥i¥H¿é¤J¡Gperldoc perlfunc Yn¬d¸ß¬Y¤@Ó¯S©wªº¨ç¼Æ¡A¨Ò¦p print¡A¥i¿é¤J¦p¤U¡Gperldoc -f print ¥Ñ©ó¤Wz©R¥O¦^À³ªº°T®§¬Û·í¦h¡A¦b¦¹¤£¤@¤@¦C¥X¡AŪªÌ¥i¦Û¦æ¸Õ¸Õ³o¨Ç©R¥O¡CPerl ¤]¦³ HTML ®æ¦¡ªº½u¤W¤ä´©¡A°²³]§Aªº Perl ªº¦w¸Ë¥Ø¿ý¬O c:\perl¡A¨º»ò§A¥i¥H¦b DOS ©R¥Oµøµ¡¤U¿é¤J¤U¦C±Ôz¡A¥H Web ÂsÄý¾¹¶}±Ò HTML ®æ¦¡ªº½u¤W¤ä´©¡G
start c:\perl\html\index.html ©Ò¶}±Òªº½u¤W¤ä´©¦p¤U¡G![]()
§ÚÌ¥ý¬Ý¤@ӳ̲³æªº Perl µ{¦¡¡A¨ä¥\¯à¥u¬O¦L¥X¤@¦C¤å¦r¡uHello World!¡v¡Aµ{¦¡½X¡]hello.pl¡^¦p¤U¡G
°²³]¥]§t¤Wzµ{¦¡½XªºÀɮ׬° hello.pl¡AYn°õ¦æ¦¹ÀɮסA¥i¦b DOS ©R¥Oµøµ¡¤U¿é¤J¤U¦C¤å¦r¡G
perl hello.pl ¦¹®É§Y·|¦b»È¹õ¤W¦L¥X¡uHello World!¡v¡C§Ú̲{¦b³v¦C¸ÑÄÀµ{¦¡½X¡A¦p¤U¡G¦b Win32 ¥¥x¤W¡A¬O§_¯à°÷ª½±µ¿é¤J Perl µ{¦¡ÀÉ¡A§Y¥i¶}©l°õ¦æ¡Hµª®×¬OªÖ©wªº¡C¦bNT4.0¥H¤Wªºª©¥»¡A§A¥un¦b DOS ©R¥Oµøµ¡¿é¤J¤U¦C±Ôz§Y¥i¡G
- ¥un¬O¥H¡u#¡v¶}ÀYªº±Ôz¡A´N¥Nªí¬Oµù¸Ñ¡A¹ïµ{¦¡ªº°õ¦æ§¹¥þµL¼vÅT¡C¦]¦¹²Ä¤@¦Cµ{¦¡½X¦b Win32 ¥¥x§¹¥þ¤£°_§@¥Î¡C¦ý¦b UNIX ¥¥x¡A¥H¡u#!¡v¶}ÀYªº±Ôz¡A§Y§i¶D§@·~¨t²ÎÀ³¦p¦ó°õ¦æ¦¹µ{¦¡ÀÉ¡A¥H¦¹¨Ò¦Ó¨¥¡A§@·~¨t²Î·|©I¥s¡u/usr/local/bin/perl¡v¨ÓŪ¤J¦¹µ{¦¡Àɨðõ¦æ¤§¡C´«¥y¸Ü»¡¡A¦b UNIX ¥¥x¤W¡A°£¤F¥i¥H¨Ï¥Î¤Wzªº¤èªk¨Ó°õ¦æ hello.pl ¤§¥~¡A¥ç¥i¥Ñ¤U¦C¤è¦¡±N hello.pl §ï¦¨¥i°õ¦æÀÉ¡G
chmod +x hello.pl ©Îchmod 755 hello.pl µM«á¦b UNIX ©R¥Oµøµ¡¤Uª½±µ¿é¤J¡uhello.pl¡v¡A¦¹®É§@·~¨t²Î´N·|¸g¥Ñ¥]§t¡u#!¡vªº²Ä¤@¦C¡A§ä¥X Perl ªº¸ô®|¡A¨Ã¥Ñ¦¹ Perl ¨Ó°õ¦æ¨C¦Cµ{¦¡½X¡C- ²Ä¤G¦Cµ{¦¡½X¬O¤@ӼзǪºµù¸Ñ¡A¥Î¨Ó»¡©ú¦¹µ{¦¡ªº¥\¯à¡C
- ²Ä¤T¦C«h¬O§Q¥Î print «ü¥O¨Ó¦L¥X¡uHello World!¡v¡C
assoc .pl=perl ftype perl=c:\perl\bin\perl.exe %1 %* ¡]¨ä¤¤¦Ü²Ä¤G¦C±Ôz¤¤¡A§A¥²¶·§¹¾ãªº¼g¥X Perl ªº¸ô®|¡C¡^°õ¦æ§¹³o¨Ç±Ôz«á¡A´N¥i¥H¦b DOS ©R¥Oµøµ¡¤U¿é¤J¡uhello.pl¡v¨Ó°õ¦æ¦¹µ{¦¡½X¡C¦¹¥~¡A§A¤]¥i¥Hª½±µ¿é¤J¡uhello¡v¨Ó°õ¦æ hello.pl¡A¦ý¥²¶·¥ý¦b DOS ©R¥Oµøµ¡¤U¿é¤J¤U¦C±Ôz¡Gset PATHEXT=%PATHEXT%;.pl ¦b¤Wzªº»¡©ú¤¤¡A§Ú̳£°²³] Perl µ{¦¡½X¦b Win32 ¥¥xªº°ÆÀɦW¬O pl¡A¦ý³o¥u¬O¤@¯ë¶Ç²Î¦Ó¤w¡A§A¤]¥i¥H¿ï¥Î¨ä¥Lªº°ÆÀɦW¡A¥H²Å¦XÓ¤H³ß¦n¡C¡]¦ýY¿ï¥Î¤£¦Pªº°ÆÀɦW¡A¦b¤Wzªº©R¥O¤¤¡A§A´N¥²¶·±N pl §ï¦¨·sªº°ÆÀɦW¡C¡^¦b¥»³¹¨ä«áªº»¡©ú©M½d¨Ò¡A³£¬O¥H ActiveState ¤½¥q©Òק諸 Win32 Perl ª©¥»¬°¥D¡CY§A¨Ï¥Îªº Perl ª©¥»©M¥»®Ñ¤£¦P¡Aµ²ªG¥i¯à²¤¦³¤£¦P¡A¦ýÀ³¸Ó¤j¦P¤p²§¡C
Perl![]()