in reply to A Tribute To The Monks Of Wisdom
You could use the fact that <> opens the files for you:
#!/usr/bin/perl use warnings; use strict; # This is a program which reads in a list of file names from the comma +nd # line and prints which files are readable, writable and/or executable +, # and whether each file exists. while ( <> ) { print "$ARGV is readable!\n" if -r ARGV; print "$ARGV is writable!\n" if -w ARGV; print "$ARGV is executable!\n" if -x ARGV; print "$ARGV exists!\n" if -e ARGV; close ARGV; } # end while
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Tribute To The Monks Of Wisdom
by koolgirl (Hermit) on Nov 17, 2008 at 00:02 UTC | |
by gwadej (Chaplain) on Nov 17, 2008 at 01:12 UTC | |
by blazar (Canon) on Nov 21, 2008 at 12:17 UTC |