Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

If you believe in Lists in Scalar Context, Clap your Hands

by oshalla (Deacon)
on Oct 23, 2008 at 17:44 UTC ( #719099=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        @foo = ('cc', '-E', $bar);
    
  2. or download this
        $foo = ('cc', '-E', $bar);
    
  3. or download this
        $foo = @foo;                # $foo gets 3
    
  4. or download this
      @r = () ;
      @r = undef ;               # sets $r[0] = undef 
    ...
      @w = @r{'k'..'p'} ;
      @p = 'k'..'p' ;
      @w = @r{@p} ;
    
  5. or download this
      $r = () ;                  # Case 1 -- $r -> undef
      $r = 1234 ;                # Case 2 -- $r -> 1234
    ...
      $u = $r[@q] ;              # Case 7 -- $r -> 'n'
      $w = @r{'k'..'p'} ;        # Case 8 -- $w -> 16
      $w = @r{@p} ;              # Case 9 -- $w -> 16
    
  6. or download this
      $r = @r ;       # Case 1 -- $r -> 26
      $v = %r ;       # Case 2 -- $r -> 19/32
      $r = (@r) ;     # Case 3 -- $r -> 26
      $v = (%r) ;     # Case 4 -- $r -> 19/32
    
  7. or download this
      $r = (@r, @r) ;
      $v = (%r, %r) ;
    
  8. or download this
      return ($a, $b, $c, $d) ;
    
  9. or download this
      my @return = () ;
      ...
    ...
      push @return, $c, $d ;
      ...
      return @return ;
    
  10. or download this
      $r = () = 1..27 ;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://719099]
Approved by CardinalNumber
Front-paged by Erez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-07-10 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls