http://www.perlmonks.org?node_id=248520
User since: Apr 07, 2003 at 04:27 UTC (21 years ago)
Last here: Apr 27, 2012 at 20:21 UTC (12 years ago)
Experience: 655
Level:Pilgrim (8)
Writeups: 125
Location:n/a
User's localtime: Apr 19, 2024 at 11:22 UTC
Scratchpad: View
For this user:Search nodes

Why does the below code fail when the url is "http://www.go.com"? Infact, every URL I try to put in there errors out.

if ($url !~ /^http\:/i || $url !~ /^ftp:/i || $url !~ /^file:/i || $u +rl !~ /^mailto:/i || $url !~ /^telnet:/i) { print header; print "<html><head><title>Malformed URL</title>"; print qq(<meta http-equiv="refresh" content="4;url=$redirect_url">< +/head><body>); print "<b>Malformed URL</b><p>You will be redirected to our main pa +ge in 4 seconds. Your url was: $url"; print "</body></html>"; exit; }