Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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

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? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2023-05-28 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?