Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 chanting in the Monastery: (18)
As of 2015-07-30 13:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls