Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 contemplating the Monastery: (6)
As of 2015-03-05 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (135 votes), past polls