Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

intro to references

by busunsl (Vicar)
on Jan 08, 2002 at 16:38 UTC ( #137108=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    +-----------+      +-----------+
    |     O-----+----->|   12345   |
    +-----------+      +-----------+
    
  2. or download this
    +----------\       +----------\
    |     a     >      |     b     >
    ...
    +-----------+      +-----------+
    |     O-----+----->|   12345   |
    +-----------+      +-----------+
    
  3. or download this
    +----------\
    |     b     >      +----------\
    ...
    +-----------+      +-----------+
    |     O-----+----->|    Qux    |
    +-----------+      +-----------+
    
  4. or download this
    +----------\
    |     a     >                      +-->+###########+
    ...
                                           |    Baz    |
                                           +-----------+
    
  5. or download this
    +----------\
    |     a     >                 +-->+###########+
    ...
                                      |    Baz    |
                                      +-----------+
    
  6. or download this
            $aref = [123, 456, 789];
    
  7. or download this
            $href = {NAME => 'Bernd', EMAIL => 'bdulfer@sybase.com'};
    
  8. or download this
            $fref = sub { print "AnonSub\n" };
    
  9. or download this
    use Data::Dumper;
    
    ...
    my @b = (1, 2, 3, 4);
    
    make_hash_from_arrays(\@a, \@b);
    
  10. or download this
        $address{Bernd} = 'Bernd Dulfer|Kapellenstr. 1|bdulfer@sybase.com'
    +;
        $email = (split(/\|/, $address{bernd}))[2];
    
  11. or download this
        $name{Bernd}  = 'Bernd Dulfer';
        $str{Bernd}   = 'Kapellenstr. 1';
        $email{Bernd} = 'bdulfer@sybase.com';
    
        print_address($name{Bernd}, $str{Bernd});
    
  12. or download this
    +----------\
    | address   >           
    ...
    
    $email = $address{Bernd}->{EMail};
    print_address($address{Bernd});
    
  13. or download this
    +----------\
    | address   >
    ...
                                       'The Color of Magic'
                                      ]
                      };
    
  14. or download this
        $s   = 'qwertz';
        $sref = \$s;
        print ${$sref}, "\n";
        print $$sref, "\n";
    
  15. or download this
    qwertz
    qwertz
    
  16. or download this
        $, = ':';
        @a    = (123, 456, 789);
        $aref = \@a;
        print @{$aref}, "\n";
        print @$aref, "\n";
    
  17. or download this
    123:456:789
    123:456:789
    
  18. or download this
        ${$aref}[1]
    or
        $$aref[1]
    
  19. or download this
        $address{Bernd} = {
                           Name    => 'Bernd Dulfer',
    ...
                                      ]
                          };
        print 'Name: ', $address{Bernd}->{Name}, "\n";
    
  20. or download this
    Name: Bernd Dulfer
    
  21. or download this
        $address{Bernd}->{Books}->[3] = 'Goedel, Escher, Bach - An Eternal
    + Golden Braid';
    
  22. or download this
        push @{$address{Bernd}->{Books}}, 'Icerigger';
    
  23. or download this
    %authors = (
                Tolkien   => [
    ...
                              'Feet of Clay'
                             ]
               )
    
  24. or download this
    $address{Bernd}->{Authors} = \%authors;
    
  25. or download this
    push @{$authors{Tolkien}}, 'The Hobbit';
    
  26. or download this
        #!/usr/bin/perl
    
    ...
        $address{Bernd}->{Authors}->{Tolkien} = ['Silmarillion', 'Unfinish
    +ed Tales'];
    
        print Dumper(\%address);
    
  27. or download this
    $VAR1 = {
              'Bernd' => {
    ...
                           'Name' => 'Bernd Dulfer'
                         }
            };
    
  28. or download this
    #Short   Name           Str              EMail                Books
    Bernd   |Bernd Dulfer  |Kapellenstr. 1  |bdulfer@sybase.com  |(Lord of
    + the Rings|Hitchhikers Guide ...|The Color of Magic)
    Bilbo   |Bilbo Baggins |Bagend          |                    |(The Red
    + Book)
    
  29. or download this
     1:    my %addresses;
     2:
    ...
    13:      push @{$addresses{$short}->{Books}}, split /\|/, $books;
    14:    }
    15:    close ADDRESSES;
    
  30. or download this
    foreach (@{$address{Bernd}->{Books}}) {
      print $_, "\n";
    }
    
  31. or download this
    foreach (keys %{$address{Bernd}->{Authors}}) {
      print $_, "\n";
    ...
        print "\t", $_, "\n";
      }
    }
    
  32. or download this
        Package Mod;
    
    ...
        sub print_rubbish (
          print "Rubbish!\n";
        }
    
  33. or download this
        %dispatch = (
                     insert => \&insert,
    ...
                    )
    
        $dispatch{$token}->($query);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://137108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-09-01 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (9 votes), past polls