Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Translating JS into Perl

by kyle (Abbot)
on Feb 18, 2009 at 22:37 UTC ( [id://744901]=note: print w/replies, xml ) Need Help??


in reply to Translating JS into Perl

In Perl, the "!!(value)" idiom normalizes "(value)" as a boolean. Many different values are considered true, and a few different values are considered false, but the result of "!!(value)" can be only one of two values.

So yes, this will make an undef value into a defined false value, but it will also make some random true value into a single predictable true value.

I don't know for sure that it means the same thing in JavaScript, but I'd be pretty surprised if it doesn't.

Replies are listed 'Best First'.
Re^2: Translating JS into Perl
by ron.savage (Acolyte) on Feb 18, 2009 at 22:58 UTC
    $many x $thanx;

Log In?
Username:
Password:

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

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

    No recent polls found