Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 romping around the Monastery: (6)
As of 2014-08-23 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls