Help for this page

Select Code to Download


  1. or download this
    
    #!usr/bin/perl
    
    use strict;
    
  2. or download this
    # 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.
    
  3. or download this
     while ($i < scalar(@ARGV)) {
        open(MYFILE, $ARGV[$i]) or die("Error: cannot open file '$ARGV[$i]
    +'\n");
    
  4. or download this
         print "$ARGV[$i] is readable!\n" if -r MYFILE;
        print "$ARGV[$i] is writable!\n" if -w MYFILE;
        print "$ARGV[$i] is executable!\n" if -x MYFILE;
        print "$ARGV[$i] exists!\n" if -e MYFILE;
        $i++;
    
  5. or download this
     } # end while
    
  6. or download this
    #!/usr/bin/perl
    
    ...
    }
    
    __END__