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


As illustrated <FILEHANDLE> reads either single line or full file depending on whether one stores it in a scalar or an array
print FILEHANDLE list; # writes list onto FILEHANDLE and simple
print list; # is equivalent to
print STDOUT list;
There are a whole set of test operators which act on File NAMES not FileHANDLES
-e $filename returns true if $filename EXISTS
-r $filename returns true if $filename is READABLE
-w $filename returns true if $filename is WRITABLE
-x $filename returns true if $filename is EXECUTABLE



© 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