Basic HTML version of Foils prepared Sept 20 97

Foil 5 General Remarks on PERL III

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


PERL may be run interactively from the command line. For example,
  • % perl -v
will report the version of PERL in use.
The PERL command
  • % perl -e 'print "@INC\n";'
prints the search path for included files.
The command
  • % perl -MLWP -e 'print "libwww-perl-$LWP::VERSION\n";'
prints the installed version of LWP.
The complex PERL command
  • % perl -pi.bak -e 's/str1/str2/gi' `find . -name \*.html -print`
performs a case insensitive, global search-and-replace on all files ending with "html" in the current directory and all its subdirectories.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997