[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    RE: Problem in current directory reference
From:       "Shailesh" <skaushik () cisco ! com>
Date:       2002-12-24 5:50:53
[Download RAW message or body]

Hi Thomas,

Thank you so much on your suggestion. I used cwd and it worked! I appreciate
your help.
I am using some cleartool commands for which I need to work on the DOS
shell, hence this requirement.

Regards,
Shailesh

-----Original Message-----
From: perl-win32-users-admin@listserv.ActiveState.com
[mailto:perl-win32-users-admin@listserv.ActiveState.com]On Behalf Of Thomas
R Wyant_III
Sent: Saturday, December 21, 2002 10:05 PM
To: skaushik@cisco.com
Cc: 'Carl Jolley'; perl-win32-users@listserv.ActiveState.com; Raminder
Gujral (E-mail)
Subject: RE: Problem in current directory reference


<skaushik@cisco.com> wrote:

> I have a myscript.pl in C:\MyScripts\sample directory.
> This 3 line Perl script looks like this:
> myscript.pl:
> $tmp = `chdir`; # chdir gives the current directory if no argument is
provided
> print "current directory = $tmp\n";
> `dir > list.txt`;

What's the point? You can accomplish the same thing with a 2 line .BAT
file:

chdir
dir >list.txt

Unless this is the warmup for a more significant effort, in which case you
might want to go with a 'native Perl' implementation along the lines of

use Cwd;
my $tmp = cwd;
print "Current directory = $tmp\n";
opendir DIR, $tmp or die "Failed to open $tmp - $!\n";
open LIST, ">list.txt" or die "Failed to open list.txt - $!\n";
while ($_ = readdir DIR) {print LIST "$_\n"}
__END__

Tom Wyant




This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law.  If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited.  Please notify the sender
by return e-mail and delete this e-mail from your system.  Unless
explicitly and conspicuously designated as "E-Contract Intended",
this e-mail does not constitute a contract offer, a contract amendment,
or an acceptance of a contract offer.  This e-mail does not constitute
a consent to the use of sender's contact information for direct marketing
purposes or for transfers of data to third parties.

 Francais Deutsch Italiano  Espanol  Portugues  Japanese  Chinese  Korean

            http://www.DuPont.com/corp/email_disclaimer.html


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic