Help for this page

Select Code to Download


  1. or download this
    my $drive = substr(getcwd(), 0, 2);
    chdir('C:\\');
    chdir($drive);
    
  2. or download this
    use strict;
    use warnings;
    ...
    __END__
    Produces:
    No such directory 'C:/testdir'
    
  3. or download this
    use strict;
    use warnings;
    ...
        printf "You are in '%s' on the 'D' drive\n",     getdcwd('D');
        print  "\n";
    }
    
  4. or download this
    You are in 'C:\Documents and Settings\liverpole\perl' on the current d
    +rive
    You are in 'D:\testdir' on the 'D' drive
    ...
    [.]     [..]    a.txt   b.txt   c.txt
                   3 File(s)             24 bytes
                   2 Dir(s)   3,777,839,104 bytes free