in reply to url and arrays
URL's can be tricky. Maybe your case is fairly trivial, but why not use a tool known to work? URI::Split
use Modern::Perl; use URI::Split qw/uri_split/; my %parts; @parts{ my @keys = qw/ scheme auth path query frag / } = uri_split( 'http://www.bing.com/default.aspx' ); say "$_ => $parts{$_}" for grep { defined $parts{$_} } @keys;
The output is
scheme => http auth => www.bing.com path => /default.aspx
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: url and arrays
by armstd (Friar) on Jul 02, 2011 at 19:25 UTC |