Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
All works well (even the tests) except for the last line. I get:$response = $ua->get($url); if (not ($response->is_success)) { die "Can't retrieve $url\n"; } if ($response->filename !~ /$regex/) { die "Can't get name of file from header.\n"; } else { open ( FILE, '>', $response->filename ) or die "Can't open file for writing.\n"; print FILE $response->content; close FILE or die "Can't close file.\n"; print "Saved data to $response->filename\n\n"; }
How do I access that variable (and why is it different inside of the print statement)?Saved data to HTTP::Response=HASH(0x29e79e0)->filename
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Addressing object variables
by BrowserUk (Patriarch) on Sep 03, 2010 at 13:28 UTC | |
|
Re: Addressing object variables
by FunkyMonk (Bishop) on Sep 03, 2010 at 13:20 UTC | |
|
Re: Addressing object variables
by Anonymous Monk on Sep 03, 2010 at 13:23 UTC | |
|
Re: Addressing object variables
by pemungkah (Priest) on Sep 03, 2010 at 22:28 UTC |