Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > A strange phenomena with Module Cwd

Reply
Thread Tools

A strange phenomena with Module Cwd

 
 
Scott
Guest
Posts: n/a
 
      12-14-2007
[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]$
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      12-14-2007

Quoth Scott <(E-Mail Removed)>:
> [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

 
Reply With Quote
 
 
 
Reply

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
Importing a module from a non-cwd candide Python 1 10-24-2011 08:38 PM
Re: strange interaction between open and cwd Cameron Simpson Python 6 05-12-2010 11:25 AM
Re: strange interaction between open and cwd Baz Walter Python 26 05-06-2010 04:16 AM
Re: strange interaction between open and cwd Baz Walter Python 5 05-04-2010 12:53 PM
strange interaction between open and cwd Baz Walter Python 6 05-03-2010 04:34 PM



Advertisments