Basic HTML version of Foils prepared March 30 97

Foil 61 Using FileHandles and Testing Files
(Chapter 10 of Llama Book)

From PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 -- February 1995. by Geoffrey C. Fox


1 As illustrated <FILEHANDLE> reads either single line or full file depending on whether one stores it in a scalar or an array
2 print FILEHANDLE list; # writes list onto FILEHANDLE and simple
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 FileHANDLES
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 Sat Sep 6 1997