Example 10-5. examples/hashes/split_http.pl #!/usr/bin/perl
use strict;
use warnings;
my $str = 'fname=Foo&lname=Bar&email=foo@bar.com';
my @pairs = split "&", $str;
my %data;
foreach my $p (@pairs) {
my ($k, $v) = split "=", $p;
$data{$k} = $v;
}
use Data::Dumper;
print Dumper \%data;
If you are interested in on-site trainings by the author, please
contact me directly.
|