Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
if ($url !~ /$regex/) { die "Can't find url of file in page.\n"; } $response = $ua->get($1, ':content_file' => $2);
I have two complications now.
First, I (in some cases) need to get the file name from the "Content-Disposition:" header. But I want to check it for sanity (a basic ^[-0-9A-Za-z_]) without putting the whole file into memory before I write it. Is there a way to do that?
Second, is there some way to print ALL of the headers (just to stdout is fine) from the syntax above?
I have looked at:
/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Response.pm
But it seems to want to know the header names in advance (and I don't know them before the request - in fact, that is why I want to print them out :)).
Thank you in advance for your help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: libwww-perl basics
by roboticus (Chancellor) on Aug 12, 2010 at 11:20 UTC | |
by Anonymous Monk on Aug 12, 2010 at 13:02 UTC | |
by roboticus (Chancellor) on Aug 12, 2010 at 13:13 UTC | |
by Anonymous Monk on Aug 12, 2010 at 15:31 UTC | |
by roboticus (Chancellor) on Aug 12, 2010 at 18:23 UTC | |
| |
by rowdog (Curate) on Aug 12, 2010 at 17:41 UTC | |
|
Re: libwww-perl basics
by rowdog (Curate) on Aug 12, 2010 at 17:27 UTC | |
by Anonymous Monk on Aug 13, 2010 at 10:47 UTC | |
by rowdog (Curate) on Aug 13, 2010 at 11:22 UTC | |
by Anonymous Monk on Aug 13, 2010 at 10:54 UTC |