Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Need help with a nested IF statement

by leocharre (Priest)
on Nov 02, 2009 at 16:11 UTC ( [id://804486]=note: print w/replies, xml ) Need Help??


in reply to Need help with a nested IF statement

yo yo yo.. what's up with the indentation.. I'm just being bold about what others have stated indirectly.. It's not
if (..){ ... }
It's
if (..){ ... }
This is important. So you won't drive yourself insane looking through your own code. Consider Perl Best Practices by Damian Conway. It's a tedious book, and you don't have to eat all of it. But there's some real useful stuff in there about consistency and why.

Replies are listed 'Best First'.
Re^2: Need help with a nested IF statement
by Anonymous Monk on Nov 02, 2009 at 16:49 UTC
    Indenting the lines containing the { and } is very strange, but at least it is consistent.
Re^2: Need help with a nested IF statement
by Anonymous Monk on Nov 03, 2009 at 01:01 UTC
    perltidy -pbp 804470
    $ifconfig = "ifconfig -a"; @nic = qx |$ifconfig| or die( "Can't get info from ifconfig: " . $! ); foreach (@nic) { if (/^fjgi([\d.])/) { $device = $1; if (/inet ([\d.]+)/) { print "test $1\n"; $ip = $1; } print "Device $device has the IP Address of $ip\n"; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2024-04-18 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found