Basic HTML version of Foils prepared Sept 20 97

Foil 67 Globbing

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


We use * notation in shell to match sets of files -- this is NOT same as regular expression since * is equivalent to (.*) except normally files beginning with . are not accessed with a simple glob
  • Presumably glob is "short" for globalize, not globular
@a = <file name with globbing>; returns a list (one per element of @a) of files matching globbed specification
  • For example @a = < *cps616*> returns all files in current directory with string cps616 somewhere in their name.
Variable interpolation is allowed in globbing, e.g.
$home = "~gcf"; # gcf's home directory is ~gcf
@a = <$home/*>; # returns all non initial . files in gcf's home directory



© 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