Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Adding 2 + 2

by mkmcconn (Chaplain)
on Feb 11, 2001 at 03:51 UTC ( #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


Comment on Re: Adding 2 + 2
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2014-10-25 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls