in reply to What is missing from the beginning of this string?
I posted this in the wrong place first, so it may show twice
try something like this:
sub fix_URL { use URI; my $in = shift; my $url = URI->new($in); $url->scheme('http'); print "input is: $in\n"; print "fixed url is: $url\n"; }
perl> fix_URL 'tp://www.cnn.com' input is: tp://www.cnn.com fixed url is: http://www.cnn.com perl>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What is missing from the beginning of this string?
by aquarium (Curate) on Oct 08, 2010 at 03:51 UTC |