-----Original Message-----
>From: perl pra <[EMAIL PROTECTED]>
>Sent: Aug 6, 2007 12:29 PM
>To: "John W. Krahn" <[EMAIL PROTECTED]>
>Cc: Perl beginners <beginners@perl.org>
>Subject: Re: Problem with my code
>
>hi jhon,
>
>If I use use opendir/readdir I am getting the default directories . and ..
>into the directoy handle.
>
>Is there any way tha i could eliminate this.
>
>
>For example  if i want to copy all contentents of the directory(including
>sub directories)
>I open a directory Handle using opendir and read it usign readdir, Now my
>dirhandle contains default directories . and .. which i cannot copy.
>
>Is there any way that i can elimate the default directories . and .. while
>reading the direcotry from a directory handle.
>


Hello,

I just think there're some ways to skip them.like:

while(<DIR>) {
    next if /^\.+$/; #or
    next if $_ eq '.' or $_ eq '..';
}

or using File::Copy it would do this thing automatically for you?

--
Jeff Pang <[EMAIL PROTECTED]>
http://home.arcor.de/jeffpang/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to