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 having an uproarious good time at the Monastery: (17)
As of 2015-07-31 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (281 votes), past polls