Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: moving files

by 2teez (Priest)
on Oct 16, 2012 at 08:17 UTC ( #999254=note: print w/ replies, xml ) Need Help??

in reply to moving files

You could use File::Copy with File::Find instead of

system ("mv $fil_nm ./reports")
like so:
use warnings; use strict; use File::Copy qw(move); use File::Spec; use Cwd qw(abs_path); use File::Find; my $path = $ARGV[0]; my $final_dir = File::Spec->rel2abs("./report"); $path = abs_path($path); find( sub { chomp; return if $_ eq '.' or $_ eq '..'; move( $_, $final_dir ); }, $path );

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Comment on Re: moving files
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-10-10 15:39 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls