Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

if ($2) behaves differently than if (defined $2)

by walto (Pilgrim)
on Apr 15, 2008 at 17:35 UTC ( [id://680590]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    #
    #
    ...
        $price = $1 . "." . "00";
    }
    print "$price\n";
    
  2. or download this
    if (defined $2 ) {
        $price = $1 . "." . $2;
    }
    else {
        $price = $1 . "." . "00";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://680590]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found