in reply to Re: Resolving Prototype mismatch
in thread Resolving Prototype mismatch
Thanks for your reply. I'm not sure how to pick one when I need aspects of both modules. I think perhaps I overly simplified my example, so I have put together a more complete one which hopefully shows my dilemma. I want to use CGI::Fast to create a fast cgi daemon and I want to use URI::URL because it is used as part of the code to create a signed URL. Here's a better example of what I'm trying to do:
#!/usr/bin/perl -w use strict; use CGI::Fast qw(:standard); use Digest::HMAC_SHA1; use MIME::Base64; use URI::URL; my ($key) = "0xc0dec0de"; my ($baseUrl) = "http://www.perlmonks.org/?node_id="; my ($url, $parsed_url, $url_to_sign, $node); my ($digest, $signature, $signed_url); while (new CGI::Fast) { $node = (defined param('node')) ? param('node') : '986481'; $url = $baseUrl . $node; $parsed_url = URI::URL->new($url); $url_to_sign = $parsed_url->path_query; $digest = Digest::HMAC_SHA1->new($key); $digest->add($url_to_sign); $signature = $digest->b64digest; $signed_url = $parsed_url->scheme .'://' . $parsed_url->host . $url_to_sign . '&signature=' . $signature; print " IN: $url\n"; print "OUT: $signed_url\n"; }
Perhaps my best option is to parse the URL string myself, but ideally I don't want to do that since that's the sort of stuff which can be tricky to catch every corner case of unusual situations.
Is it possible to request the two modules but exclude url from being exported in both cases?
Cheers
Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Resolving Prototype mismatch
by tobyink (Canon) on Aug 09, 2012 at 11:50 UTC | |
by marky1124 (Novice) on Aug 09, 2012 at 11:59 UTC | |
by Anonymous Monk on Aug 09, 2012 at 12:05 UTC | |
by marky1124 (Novice) on Aug 09, 2012 at 13:43 UTC | |
|
Re^3: Resolving Prototype mismatch
by Anonymous Monk on Aug 09, 2012 at 11:56 UTC | |
by marky1124 (Novice) on Aug 09, 2012 at 13:45 UTC |