Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $dir = shift;
    chdir $dir or die "Couldn't chdir $dir: $!\n";
    print "OK, in ". getcwd . "\n";
    
  2. or download this
    # ./change.pl Downloads/
    OK, in /home/Random/Downloads
    ...
    # ./chmod 000 bar
    # ./perl change.pl bar
    Couldn't chdir bar: Permission denied