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
In reply to Re: A Tribute To The Monks Of Wisdom
by jwkrahn
in thread A Tribute To The Monks Of Wisdom
by koolgirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |