Getting Current Working Directory
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>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?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Paco =
Zarabozo</FONT></DIV></BODY></HTML>
------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0010999984==--
Re: Getting Current Working Directory
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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Getting Current Working Directory
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 -----
From: John Mason Jr
To: Paco Zarabozo A. ; activeperl [at] listserv.ActiveState.com
Sent: Friday, January 12, 2007 10:40 PM
Subject: Re: Getting Current Working Directory
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` =3D~ /regex/ on windows. Is =
there a
> more logic function or command in perl to know the CWD?
>
> 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Thanks a lot! :-)</FONT></DIV>
<BLOCKQUOTE
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>
<A title=3Djohn.mason.jr [at] cox.net =
href=3D"mailto:john.mason.jr [at] cox.net">John Mason
Jr</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dfzarabozo [at] hotmail.com
href=3D"mailto:fzarabozo [at] hotmail.com">Paco Zarabozo A.</A> ; <A
title=3Dactiveperl [at] listserv.ActiveState.com
=
href=3D"mailto:activeperl [at] listserv.ActiveState.com">activepe rl [at] listserv.A=
ctiveState.com</A>
</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, January 12, 2007 =
10:40
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Getting Current =
Working
Directory</DIV>
<DIV><BR></DIV>Paco Zarabozo A. wrote:<BR>> Hello =
all,<BR>>
<BR>> I'm trying to find a way to let a script know where it is =
running
on<BR>> (current working directory). For the moment, i'm getting my =
CWD
by<BR>> executing a `pwd` on linux or a `dir` =3D~ /regex/ on =
windows. Is
there a<BR>> more logic function or command in perl to know the
CWD?<BR>> <BR>> Paco Zarabozo<BR><BR> use
Cwd;<BR> my $dir =3D
getcwd;<BR><BR><BR>John<BR><BR></BLOCKQUOTE></BODY></HTML>
------=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0937178523==--
Re: Getting Current Working Directory
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 [at] listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs