Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: need help understanding perl syntax

by socketdave (Curate)
on Jun 16, 2006 at 15:08 UTC ( #555810=note: print w/ replies, xml ) Need Help??


in reply to need help understanding perl syntax

$ENV{"http_proxy"} retrieves the environment variable http_proxy, splits it into a non-whitespace section and a numeric section separated by a ':'. These sections are assigned to $host and $port.

Just a guess, but have you tried upper-casing "HTTP_PROXY" in the code?

UPDATE: See phaylon's response below. I didn't spot that trailing slash in your data. If your data will always have the slash, you can do:my($host,$port) = ($ENV{"http_proxy"} =~ /^(\S+)\:(\d+)\/$/); to account for it.


Comment on Re: need help understanding perl syntax
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-09-20 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls