# The url I'm on: https://development.cherrylanekeepsakes.com/cgi-bin/employees.cgi?action=edit_timeclock_dashboard&id=80&start_date=2012-09-01&end_date=2012-09-16&print_view=1
use URI::URL;
use Data::Dumper;
my $url = URI::URL->new( '' . $cgi->new->url(-path_info => 1, -query => 1) );
warn Dumper($url->params('print_view'));
It gives me nothing. What am I doing wrong? This seems like a pretty simple task.
Is there a reason you’re using URI::URL instead of URI? It’s an obsolete module that only exists for backwards compatibility. It’s not even documented, so I can’t even confirm that
paramsis suppose to do what you think it does.What follows is a solution using the module that replaced URI::URL. It’s even part of the same distribution.
Or better yet,
Note: To assign one of the value of
query_paramto a scalar, you need to use parens as follows: