czech has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance for your help. Corwinuse strict; use Cwd 'abs_path'; use File::Spec::Link; use vars qw ($LIST_SEPARATOR); my $path = "/home/czechar/foo/bar/myfile.xml"; print STDOUT "Original path: $path\n"; my $new_path = File::Spec::Link->resolve_all($path); print STDOUT "Resolved path(1): $new_path\n"; my $abs_path = abs_path($path); print STDOUT "Resolved path(2): $abs_path\n"; # # now try to read from a file... # open (FILE_LIST, "< ./filenames"); my $path = <FILE_LIST>; chomp $path; print STDOUT "path from file: $path\n"; $abs_path = abs_path($path); print STDOUT "abs path: $abs_path\n"; $new_path = File::Spec::Link->resolve_all($path); print STDOUT "new path: $new_path\n"; close (FILE_LIST); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to resolve links...
by ELISHEVA (Prior) on Nov 05, 2010 at 08:34 UTC | |
by czech (Sexton) on Nov 05, 2010 at 19:23 UTC | |
|
Re: Unable to resolve links...
by ikegami (Patriarch) on Nov 05, 2010 at 01:38 UTC | |
|
Re: Unable to resolve links...
by aquarium (Curate) on Nov 05, 2010 at 02:04 UTC | |
by czech (Sexton) on Nov 05, 2010 at 19:04 UTC | |
by aquarium (Curate) on Nov 07, 2010 at 22:45 UTC | |
|
Re: Unable to resolve links...
by apl (Monsignor) on Nov 05, 2010 at 11:53 UTC | |
by czech (Sexton) on Nov 05, 2010 at 17:52 UTC | |
by czech (Sexton) on Feb 14, 2012 at 00:35 UTC | |
by tye (Sage) on Feb 14, 2012 at 01:42 UTC |