develooper Front page | perl.beginners | Postings from April 2002

Re: 2 questions

Thread Previous | Thread Next
From:
Eric Plowe
Date:
April 2, 2002 16:16
Subject:
Re: 2 questions
Message ID:
F7034F60-4697-11D6-81A5-003065A95F3E@hypoflux.net
sheesh - that's a lot easier then the way I do it :P
thanks.

~Eric
On Tuesday, April 2, 2002, at 07:09 PM, John W. Krahn wrote:

> Glenn Cannon wrote:
>>
>> Hi all,
>
> Hello,
>
>> Couple of questions from a newbie...
>>
>> 1)  How can I print the current directory name?
>
> use Cwd;
> my $dir = cwd;
> print "The current directory is $dir\n";
>
>
>> 2)  How can I check to see if a file I know the name of exists?
>
> if ( -e $filename ) {
>     print "$filename exists\n";
>     }
>
>
>
> John
> --
> use Perl;
> program
> fulfillment
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About