Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

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 about the Monastery: (11)
As of 2016-10-28 18:03 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (386 votes). Check out past polls.