Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by gone2015 (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?
Discipulus is looking for rule books and found nothing about politic, just related to be annoying. and he is never annoying..

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2017-04-29 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.