Basic HTML version of Foils prepared Sept 20 97

Foil 64 Using FileHandles and Testing Files

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


1 As illustrated <FILEHANDLE> reads either single line or full file depending on whether one stores it in a scalar or a array variable
2 print FILEHANDLE list; # writes list onto FILEHANDLE
3 print list; # is equivalent to
4 print STDOUT list;
5 There are a whole set of test operators which act on file NAMES not file HANDLES
6 -e $filename returns true if $filename EXISTS
7 -r $filename returns true if $filename is READABLE
8 -w $filename returns true if $filename is WRITABLE
9 -x $filename returns true if $filename is EXECUTABLE

in Table To:


© 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