A strange phenomena with Module Cwd

Discussion in 'Perl Misc' started by Scott, Dec 14, 2007.

  1. Scott

    Scott Guest

    [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]$
    Scott, Dec 14, 2007
    #1
    1. Advertising

  2. Scott

    Ben Morrow Guest

    Quoth 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


    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
    Ben Morrow, Dec 14, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuIE5hc2g=?=

    odd phenomena with Repeater and PagedDataSet class

    =?Utf-8?B?RGFuIE5hc2g=?=, Oct 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    347
    =?Utf-8?B?RGFuIE5hc2g=?=
    Oct 23, 2004
  2. Baz Walter
    Replies:
    6
    Views:
    276
    Grant Edwards
    May 3, 2010
  3. Baz Walter
    Replies:
    5
    Views:
    228
    Baz Walter
    May 4, 2010
  4. Baz Walter
    Replies:
    26
    Views:
    561
    Nobody
    May 6, 2010
  5. Cameron Simpson

    Re: strange interaction between open and cwd

    Cameron Simpson, May 4, 2010, in forum: Python
    Replies:
    6
    Views:
    216
    Albert van der Horst
    May 12, 2010
Loading...

Share This Page