Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: inheritance: constructors (unless)

by tye (Sage)
on Dec 03, 2012 at 15:41 UTC ( [id://1006898]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    unless( $a ne $b ) {
    
  2. or download this
    if( $a eq $b ) {
    
    # or
    
    if( $a ne $b ) {
    
  3. or download this
        croak( "You must pass foo() a non-empty array ref" )
            unless  $arg  &&  'ARRAY' eq ref($arg)  &&  0 < @$arg;
    
  4. or download this
        croak( "You must pass foo() a non-empty array ref" )
            if  ! $arg  ||  'ARRAY' ne ref($arg)  ||  0 == @$arg;
    
  5. or download this
        croak( "You must pass foo() a non-empty array ref or hash ref" )
            unless  'ARRAY' eq ref($arg)  &&  0 < @$arg
                ||  'HASH'  eq ref($arg)  &&  0 < keys %$arg;
    
  6. or download this
        croak( "You must pass foo() a non-empty array ref or hash ref" )
            if(     (  'ARRAY' ne ref($arg)  ||  0 == @$arg  )
                &&  (  'HASH'  ne ref($arg)  ||  0 == keys %$arg  )
            );
    
  7. or download this
        croak( "You didn't pass foo() a reference" )
            if  ! $arg  ||  ! ref $arg;
    ...
                " ref (must be ARRAY or HASH)",
            );
        }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found