Storable freeze produces a binary string that may contain a whole bunch of characters that would be incompatible with passing as part of a url. You might try url encoding the results of freeze, but I wouldn't like to rely upon that.
It would be better to hexify the frozen data before adding it as a part of your url.
Given oneScript like this:
#! perl -slw use strict; use Storable qw[ freeze ]; my %params = ( period => 30, vid => 'xyz1234', person => 'homer', ); my $encoded = unpack 'H*', freeze \%params; system qq[otherScript.pl ?arg=$encoded];
Calling another script like this:
#! perl -slw use strict; use Data::Dump qw[ pp ]; use Storable qw[ thaw ]; my( $name, $payload ) = split '=', $ARGV[ 0 ]; my $params = thaw pack 'H*', $payload; pp $params;
The result is:
c:\test>oneScript { period => 30, person => "homer", vid => "xyz1234" }
In reply to Re: Pass arguments in URL
by BrowserUk
in thread Pass arguments in URL
by kalyanrajsista
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |