Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Loops and variable usage

by JavaFan (Canon)
on Mar 23, 2012 at 19:18 UTC ( #961295=note: print w/replies, xml ) Need Help??


in reply to Loops and variable usage

It seems like your code is equivalent to:
sub ddd { my $a = $_[0] == 1 ? 'p' : $_[0] == 2 ? 'pp' : $_[0]; my $b = $_[1] == 3 ? 'w' : $_[1]; my $c = $_[2]; print v " < $a > < $b > < $c >"; }
Having said that, I don't which problem you are trying to solve. I don't see any loops.

Replies are listed 'Best First'.
Re^2: Loops and variable usage
by BillKSmith (Priest) on Mar 24, 2012 at 23:09 UTC
    I find nested ternaries are much clearer using the code layout suggested by the book "Perl Best Practices"
    sub ddd { # code # value my $a = $_[0] == 1 ? 'p' : $_[0] == 2 ? 'pp' : $_[0] ; my $b = $_[1] == 3 ? 'w' : $_[1] ; my $c = $_[2]; print v " < $a > < $b > < $c >"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961295]
help
Chatterbox?
[stevieb]: ...to cover it all. Awesome thing is that you can dispatch ANY distribution to it (and include all revdeps if desired), and it works all the same as if I'm just testing the RPI code itself
[stevieb]: I'm rather pleased with myself and everything I've leared along this arduous and sometimes frustrating path
[stevieb]: Just need to implement an email plugin or something so I can get alerted remotely if the status of a build has changed from the last run
[stevieb]: Because of the extreme complexity of the testing code itself, I implemented extensive logging so I can troubleshoot much easier by setting a high debug level.
[stevieb]: if you're interested in the test/build backend, have a look at Test::BrewBuild.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-04-28 21:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (529 votes). Check out past polls.