Paul,
Yeah, some elucidation please!!   YOu mean to tell me this " while defined
($line=<IN>) "  stands for:
 
$line = <IN>;
while ($line) {
        print OUT "$line";
        $line = <IN>;
                  }
if so, is that due to the  DEFINED command??   Just curious about this new
way of doing these very common while loops.


Paul Jasa


-----Original Message-----
From: Paul [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 7:20 AM
To: Stphane" JEAN BAPTISTE; PERL
Subject: Re: to copy a file (with perl)
Importance: High



--- Stephane JEAN BAPTISTE <[EMAIL PROTECTED]>
wrote:
> Hw could I copy a file in Perl

the brute force approach: =o)

  open  IN,  $file    or die $!;
  open  OUT, ">$new"  or die $!;
  print OUT $line while defined($line=<IN>);
  close OUT;
  close IN;

There are better ways, but this is a good one to make certain you
understand. Does it make sense without a detailed explanation?
Do you need anything elucidated?

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
email by anyone else is unauthorized.

If you are not the intended recipient, any disclosure, copying, 
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Reply via email to