Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Problem in mirror method

by perlmad (Sexton)
on May 26, 2016 at 07:17 UTC ( [id://1164166]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Problem in mirror method
in thread Problem in mirror method

I have checked before mirror that the filename is not empty

filename is FNMA_2016C01_RMT.pdf link updated...

Replies are listed 'Best First'.
Re^5: Problem in mirror method
by Corion (Patriarch) on May 26, 2016 at 07:21 UTC

    You did not tell us whether your program works if you hardcode $filename to a fixed value. This would help us determine whether the problem is with the value of $filename or somewhere else in the program.

    Please do not post small snippets of your program that don't work stand-alone. Reduce your program to an example of about 20 lines that still is self-contained and is runnable by us and which still exhibits the problem.

    My bet still is that you are extracting an invalid or empty filename, but you're not showing us how $filename gets populated.

    If you want to help us help you better, please follow the steps outlined above in Basic debugging checklist and in my replies above. All of the steps are necessary.

Re^5: Problem in mirror method
by ablanke (Prior) on May 26, 2016 at 07:32 UTC

    ...and it prints 'link updated...' like it should, right?

    You call the mirror method from the Module LWP::UserAgent.pm/WWW::Mechanize:

    Take a look what happens to the $file parameter:
    sub mirror { my($self, $url, $file) = @_; my $tmpfile = "$file-$$"; rename( $tmpfile, $file ) or die "Cannot rename '$tmpfile' to '$fi +le': $!\n";
    There have to be an empty string somewhere.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-29 00:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found