in reply to Passing file location in a subroutine
You have to pay attention when you pass file names to subs to the current directory where the program works. if you run your program in the /some/path and you do not change current directory while running, then a bare_filename.ext will be relative to /some/path ending to be /some/path/bare_filename.extmy $linux_path = '/usr/bin/perl'; my $win_path = 'c:\scripts\my.log'; my $old_macos = 'Hard Drive:My Folder:My Document'; #dunno
$path = File::Spec->catfile( @directories, $filename );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing file location in a subroutine
by Rapazzini (Initiate) on Oct 09, 2015 at 08:42 UTC | |
by Discipulus (Canon) on Oct 09, 2015 at 08:48 UTC | |
by Rapazzini (Initiate) on Oct 09, 2015 at 11:28 UTC | |
by Corion (Patriarch) on Oct 09, 2015 at 11:37 UTC | |
by Rapazzini (Initiate) on Oct 16, 2015 at 07:09 UTC |