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
In reply to Re: url and arrays
by davido
in thread url and arrays
by perlaintdead
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |