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

Re: Adding 2 + 2

by mkmcconn (Chaplain)
on Feb 11, 2001 at 03:51 UTC ( [id://57681]=note: print w/replies, xml ) Need Help??


in reply to Adding 2 + 2

2+2 illustrates some interesting behavior.
  1. ++$_ && $_++ && print eval() + eval();
  2. $_++; print eval() + eval() unless ( $_ + 1 == $_++ );
  3. for (2..2){$_ = $_ + $_ and print;}
  4. $a = 2; print "$a + $a = ", $$b + $$b; BEGIN{ $b = \$a }
  5. my $num = 2; $num =~ s/(2)/$1 + $1/gxe; print $num;

mkmcconn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-03-28 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found