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

Re: new way to code html?

by muba (Priest)
on Nov 21, 2012 at 01:51 UTC ( #1004827=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Ok - pick a value based on the value of $bar
    $foo = $bar eq "baz" ? "foobaz" : "foobar";
    print "I am the ", ($sex eq "male" ? "king" : "queen"), "of rock & rol
    +l";
    some_subroutine( ref($foo) eq "ARRAY" ? $foo : [$foo] );
    
  2. or download this
    # Not ok - ?: flow control
    $bar eq "baz" ? $foo = "foo" : $bar = "baz";
    
  3. or download this
    # Ok - if/else flow control
    if ($bar eq "baz") {                         
    ...
    } else {
        $bar = "baz";
    }
    
  4. or download this
    # Ok - if/else flow control, if a bit verbose.
    if ($bar eq "baz") {                         
    ...
    } else {
        $foo = "baz";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-07-02 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls