Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: copy files to another directory

by fruiture (Curate)
on Feb 19, 2003 at 13:46 UTC ( #236623=note: print w/ replies, xml ) Need Help??


in reply to Re: copy files to another directory
in thread copy files to another directory

I'd rewrite:

my @files = grep { !-d } @allfiles ; my @dirs = grep { -d } @allfiles ;

As

my (@files,@dirs); for( @allfiles ){ if( -d catfile( $line , $_ ) ){ push @dirs,$_ } else { push @files,$_ } }

Not for cosmetics, but for efficiency and even more to make it work ;)

--
http://fruiture.de


Comment on Re: Re: copy files to another directory
Select or Download Code
Replies are listed 'Best First'.
Re^3: copy files to another directory
by Aristotle (Chancellor) on Feb 19, 2003 at 14:34 UTC
    to make it work
    Doh, touché. I didn't even spot that one. That said, I offer
    push @{ -d catfile($line,$_) ? \@dirs : \@files }, $_ for @all_files;

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://236623]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2015-07-30 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls