Help for this page

Select Code to Download


  1. or download this
    my $file_name = @ARGV ? shift(@ARGV) : 'answerfile';
    open(my $fh, '<', $file_name)
       or die("Unable to open answer file \"$file_name\": $!\n");
    
  2. or download this
    use File::Spec::Functions qw( rel2abs );
    
    my $full_name = rel2abs($file_name);
    
  3. or download this
    use File::Basename qw( dirname );
    
    my $dir_name = dirname($full_name);
    
  4. or download this
    E:\some\path>type ..\bin\routine.pl
    use strict;
    ...
    Dir Name:  E:\some\otherpath
    Contents:
    Answer file in \some\otherpath