skip to main | skip to sidebar

Perl - Tidings

Monday, July 6, 2009

Spaceship Operator.

Easy with the Spaceship Operator.
$a = 2 <=> 5;  # $a is set to -1
$a
= 5 <=> 2; # $a is set to 1
$a
= 2 <=> 2; # $a is set to 0
Posted by Sakthi at 11:09 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

My Archive

  • ►  2012 (2)
    • ►  May (2)
  • ►  2011 (13)
    • ►  September (13)
  • ►  2010 (8)
    • ►  September (1)
    • ►  August (5)
    • ►  March (1)
    • ►  February (1)
  • ▼  2009 (24)
    • ▼  July (4)
      • Printing Environment Variables Using Perl One Liner
      • Tilde-Tilde Operator
      • Spaceship Operator.
      • Non-Obvious features in perl.
    • ►  March (11)
    • ►  February (9)
  • ►  2008 (2)
    • ►  November (1)
    • ►  May (1)
  • ►  2007 (1)
    • ►  June (1)