Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > use Cwd qw(abs_path) question

Thread Tools

use Cwd qw(abs_path) question

Sverre Furberg
Posts: n/a
I was testing the use 'Cwd qw(abs_path)' function
in a script on my Windows 98 computer and found
(in my opinion) something strange.

use strict;
use warnings;
use Cwd qw(abs_path);

my $file = shift;
my $abs_path = abs_path($file);
print $abs_path, "\n";


If i run the script with 'a normal file' as argument like this:
C:\Temp>perl pwdtest.plx text.txt
I get:
with backslashes.

Now if i run the script with a directory as argument:
C:\Temp>perl pwdtest.plx testdir
I get:
with frontslashes like in *nix.
Why is that?
It's not a problem but I'm curious.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
subprocess cwd keyword. Ivan Vinogradov Python 3 10-27-2006 02:42 PM
Where is can set an aspnet unix-like cwd analog for whole application? Burganovsky ASP .Net 1 12-15-2005 10:19 AM
Where is can set an aspnet unix-like cwd analog for whole application? Burganovsy ASP .Net 0 12-11-2005 07:00 PM
More elegant way to cwd? Kamilche Python 11 12-29-2004 02:52 AM
popen pipes fail when cwd is a UNC path Tim Black Python 2 09-09-2004 05:53 PM