in reply to How to test if a directory exists?

Use -e to check if a file/dir exists. Then -d to check if it is a directory. You do not really need the -e, but it's nice to know.
#!/usr/bin/perl -w use strict; my $dir = '/etc'; if (-e $dir and -d $dir) { print "SPOON :)\n"; } else { print "spork :(\n"; }
You should really pick up "Programming Perl" it is explained in there. It is also under 'perldoc -d'

grep
grep> cd pub 
grep> more beer