Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   use Cwd qw(abs_path) question (http://www.velocityreviews.com/forums/t891660-use-cwd-qw-abs_path-question.html)

Sverre Furberg 04-04-2005 11:28 PM

use Cwd qw(abs_path) question
 
Hi.
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";

__END__

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

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




All times are GMT. The time now is 04:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.