PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:
I am still new to using Data::Dumper, so I am not sure how to go about getting the value I need. My output looks something like this:my $mech = WWW::Mechanize::Firefox->new(launch => 'C:\Program Files (x +86)\Mozilla Firefox\firefox.exe', autoclose => 0, autodie => 1 ); $mech->get('https://example.com'); my $jar = $mech->cookies(); print Dumper($jar);
I want the value of the JSESSIONID (8430..) I guess my question is- is there a parameter I can pass to Data::Dumper to retrieve this automatically? If not, I may be able to retrieve it with a regex because I have noticed this cookie always starts with 8430 for me. Any insight is greatly appreciated.'COOKIES' => { 'example.com' => { '/' => { 'NSC_fqg-qspe_443' => [ 1, 'ffffffff3b08dc1e45525d5f4f58455e445a4a4212d3' +, undef, undef, bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) +, 1373308908 ], 'JSESSIONID' => [ 1, '8430caba0ba26ecea900783b4f4b15378246', undef, undef, $VAR1->{'COOKIES'}{'search.cpan.org'}{'/'}{'css'}[4] +, 1373308908 ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Data::Dumper and Cookies
by Perlbotics (Archbishop) on Jul 08, 2013 at 18:32 UTC | |
by locked_user sundialsvc4 (Abbot) on Jul 08, 2013 at 19:48 UTC | |
by PerlSufi (Friar) on Jul 08, 2013 at 19:45 UTC |