Getting Current Working Directory

Getting Current Working Directory

am 13.01.2007 04:31:21 von fzarabozo

This is a multi-part message in MIME format.

--===============0010999984==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_003A_01C73691.0094AD50"

This is a multi-part message in MIME format.

------=_NextPart_000_003A_01C73691.0094AD50
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello all,

I'm trying to find a way to let a script know where it is running on =
(current working directory). For the moment, i'm getting my CWD by =
executing a `pwd` on linux or a `dir` =3D~ /regex/ on windows. Is there =
a more logic function or command in perl to know the CWD?

Paco Zarabozo
------=_NextPart_000_003A_01C73691.0094AD50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




Hello all,

 

I'm trying to find a way to let a =
script know where=20
it is running on (current working directory). For the moment, i'm =
getting my CWD=20
by executing a `pwd` on linux or a `dir` =3D~ /regex/ on windows. Is =
there a more=20
logic function or command in perl to know the CWD?

 

Paco =
Zarabozo


------=_NextPart_000_003A_01C73691.0094AD50--


--===============0010999984==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0010999984==--

Re: Getting Current Working Directory

am 13.01.2007 05:40:09 von John Mason Jr

Paco Zarabozo A. wrote:
> Hello all,
>
> I'm trying to find a way to let a script know where it is running on
> (current working directory). For the moment, i'm getting my CWD by
> executing a `pwd` on linux or a `dir` =~ /regex/ on windows. Is there a
> more logic function or command in perl to know the CWD?
>
> Paco Zarabozo

use Cwd;
my $dir = getcwd;


John

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Getting Current Working Directory

am 13.01.2007 10:38:13 von fzarabozo

This is a multi-part message in MIME format.

--===============0937178523==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_004D_01C736C4.40AE4080"

This is a multi-part message in MIME format.

------=_NextPart_000_004D_01C736C4.40AE4080
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thanks a lot! :-)
----- Original Message -----=20
From: John Mason Jr=20
To: Paco Zarabozo A. ; activeperl@listserv.ActiveState.com=20
Sent: Friday, January 12, 2007 10:40 PM
Subject: Re: Getting Current Working Directory


Paco Zarabozo A. wrote:
> Hello all,
> =20
> I'm trying to find a way to let a script know where it is running on
> (current working directory). For the moment, i'm getting my CWD by
> executing a `pwd` on linux or a `dir` =3D~ /regex/ on windows. Is =
there a
> more logic function or command in perl to know the CWD?
> =20
> Paco Zarabozo

use Cwd;
my $dir =3D getcwd;


John


------=_NextPart_000_004D_01C736C4.40AE4080
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




Thanks a lot! :-)

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----

style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
href=3D"mailto:john.mason.jr@cox.net">John Mason=20
Jr

To: title=3Dfzarabozo@hotmail.com=20
href=3D"mailto:fzarabozo@hotmail.com">Paco Zarabozo A.
; title=3Dactiveperl@listserv.ActiveState.com=20
=
href=3D"mailto:activeperl@listserv.ActiveState.com">activepe rl@listserv.A=
ctiveState.com=20

Sent: Friday, January 12, 2007 =
10:40=20
PM

Subject: Re: Getting Current =
Working=20
Directory


Paco Zarabozo A. wrote:
> Hello =
all,
> =20

> I'm trying to find a way to let a script know where it is =
running=20
on
> (current working directory). For the moment, i'm getting my =
CWD=20
by
> executing a `pwd` on linux or a `dir` =3D~ /regex/ on =
windows. Is=20
there a
> more logic function or command in perl to know the=20
CWD?

> Paco Zarabozo

 use=20
Cwd;
    my $dir =
getcwd;


John



------=_NextPart_000_004D_01C736C4.40AE4080--


--===============0937178523==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0937178523==--

Re: Getting Current Working Directory

am 15.01.2007 02:38:50 von Foo JH

Try reading up on FindBin. It works better on PerlApp-ed executables.

Paco Zarabozo A. wrote:
> Hello all,
>
> I'm trying to find a way to let a script know where it is running on
> (current working directory). For the moment, i'm getting my CWD by
> executing a `pwd` on linux or a `dir` =~ /regex/ on windows. Is there
> a more logic function or command in perl to know the CWD?
>
> Paco Zarabozo
> ------------------------------------------------------------ ------------
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs