Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-12-05 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (71 votes). Check out past polls.