A strange phenomena with Module Cwd

S

Scott

[scott@FreeBSD ~/perl]$ cat cwd.pl
#!/usr/bin/perl
#
use Cwd;
$dir = getcwd();
print "$dir\n";
[scott@FreeBSD ~/perl]$ perl cwd.pl
/usr/home/scott/perl # How does this "/usr" prefix come?
[scott@FreeBSD ~/perl]$ pwd
/home/scott/perl
[scott@FreeBSD ~/perl]$
 
B

Ben Morrow

Quoth Scott said:
[scott@FreeBSD ~/perl]$ cat cwd.pl
#!/usr/bin/perl
#
use Cwd;
$dir = getcwd();
print "$dir\n";
[scott@FreeBSD ~/perl]$ perl cwd.pl
/usr/home/scott/perl # How does this "/usr" prefix come?
[scott@FreeBSD ~/perl]$ pwd
/home/scott/perl

I would guess that /home is a symlink to /usr/home. If you run /bin/pwd
instead of the shell builtin it should give the same result as perl.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top