in reply to Perl Issue - File downloaded in windows has a Control M character in it??
I can't help wondering why you are using WWW::Mechanize where probably LWP::Simple with getstore would likely do. After all you seem to be only fetching a file from an URL... No login, no navigating towards a download page.
I am guessing WWW::Mechanize assumes HTML, thus, text contents, and treats it that way. getstore, on the other hand, saves (all) files as binary by default.
update From the WWW::Mechanize docs:
$mech->save_content( $filename )And no way to override it. Nice.Dumps the contents of $mech->content into $filename. $filename will be overwritten. Dies if there are any errors.
If the content type does not begin with "text/", then the content is saved in binary mode.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl Issue - File downloaded in windows has a Control M character in it??
by venky144 (Initiate) on Oct 24, 2012 at 20:49 UTC | |
by hbm (Hermit) on Oct 24, 2012 at 21:24 UTC | |
by fishmonger (Chaplain) on Oct 24, 2012 at 21:00 UTC | |
by venky144 (Initiate) on Oct 24, 2012 at 21:32 UTC | |
by venky144 (Initiate) on Oct 25, 2012 at 20:28 UTC |
In Section
Seekers of Perl Wisdom