Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
laziness, impatience, and hubris
 
PerlMonks  

!@#$ $#_

by MeowChow (Vicar)
on Mar 24, 2001 at 22:49 UTC ( #66880=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      sub li {
        shift;
        @_ ? (scalar @_, &li) : ();
      }
      print li qw(a b c d e f g);   # prints 654321
    
  2. or download this
      sub li {
        shift;
        @_ ? ($#_ + 1, &li) : ();
      }
      print li qw(a b c d e f g);   # prints 654321
    
  3. or download this
      sub li {
        shift;
        @_ ? ($#_, &li) : ();
      }
      print li qw(a b c d e f g);   # prints -1-1-1-1-1-1
    
  4. or download this
      use vars '$x';
      sub li {
    ...
        @_ ? ($x, &li) : ();
      }
      print li qw(a b c d e f g);   # prints gggggg
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2014-04-18 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls