in reply to Is any simple way to get the current directory name?

Another module I'm fond of is the File::chdir module, which allows easy access to the name of the current directory as well as easy manipulation of the current directory (it allows treating the path to the current directory as an array, together with pushing, popping and localizing values in it).

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: Is any simple way to get the current directory name?
by softworkz (Monk) on Jul 18, 2002 at 17:42 UTC
    There's two ways you could approach this..
    The win32 way.
    #!/usr/bin/perl -w use strict; use Win32; my $dir = Win32::GetCwd; print "$dir";
    or the other way..
    #!/usr/bin/perl -w use strict; use Cwd; my $dir = cwd; print "$dir";