in reply to Parse hostname from HTML header string
Just for this example, I'm assuming that string is in $_.
You see, if the ":7799" part is missing, $2 (= the value assigned to $port) will be undef. And then, I assign 80 to it.my($host, $port) = /^Host:\s*([^:\s]+)(?:\:(\d+))?/i; $port = 80 if not defined $port;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse hostname from HTML header string
by JoeJaz (Monk) on Oct 02, 2004 at 23:55 UTC | |
by tachyon (Chancellor) on Oct 03, 2004 at 23:27 UTC |