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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Most of the code is not being used at all… So the problem is probably that you are clobbering your hash somehow with the date stuff but you do not show it here. Or perhaps, judging by the modules you use, you aren’t creating the directories necessary before the move. Or maybe… this thing, File::PerlMove, is the culprit. Clobbering the move from File::Copy and having different usage. Try removing use File::PerlMove; and see if you get better error feedback.

I would also encourage you in another direction. This is simpler and has built in feedback for failures, which of course happens on my box.

use strictures; use Path::Tiny; my %files = ("e:/pervasive/staging/summit/C01" => "e:/pervasive/test/A +PEX012015/C01", "e:/pervasive/staging/summit/C02" => "e:/pervasive/test/A +PEX022015/C02", "e:/pervasive/staging/summit/C03" => "e:/pervasive/test/A +PEX032015/C03", ); for my $key ( keys %files ) { my $original = path($key); my $destination = $files{$key}; $original->move($destination); } __END__ moo@cow[88]~>perl pm/1150117.pl Error rename on 'e:/pervasive/staging/summit/C01' -> 'e:/pervasive/tes +t/APEX012015/C01': No such file or directory at pm/1150117.pl line 13 +.

In reply to Re: question regarding File::Copy, and hashes that contain file paths by Your Mother
in thread question regarding File::Copy, and hashes that contain file paths by Leetsauce

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-25 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found