in reply to need help understanding perl syntax
<aside> This is the first time I am encountering the "match-and-assign-in-a-single-statement" syntax.
I usually code like this:my($host, $port) = ( $ENV{"http_proxy"} =~ /^(\S+)\:(\d+)$/ );
Which syntax is better/preferable? Is it more a style issue and either syntax is fine?if( $ENV{"http_proxy"} =~ /^(\S+)\:(\d+)$/ ) { ($host, $port) = ($1, $2); }
Thanks,
Anand
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need help understanding perl syntax
by phaylon (Curate) on Jun 17, 2006 at 14:50 UTC | |
by holli (Abbot) on Jun 20, 2006 at 08:52 UTC |