| 1 | #!/usr/bin/env perl |
|---|
| 2 | |
|---|
| 3 | use 5.010; |
|---|
| 4 | use strict; |
|---|
| 5 | use warnings; |
|---|
| 6 | |
|---|
| 7 | # Turn on $OUTPUT_AUTOFLUSH |
|---|
| 8 | $| = 1; |
|---|
| 9 | |
|---|
| 10 | # use diagnostics; |
|---|
| 11 | # use Data::Printer { caller_info => 1, colored => 1, }; |
|---|
| 12 | |
|---|
| 13 | say 'START'; |
|---|
| 14 | |
|---|
| 15 | foreach (0..7) |
|---|
| 16 | { |
|---|
| 17 | my $line = $_; |
|---|
| 18 | last unless defined $line; # exit loop if $line is not defined |
|---|
| 19 | print "$_ : $line \n"; |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | my %HoH = ( |
|---|
| 23 | flintstones => { |
|---|
| 24 | husband => "fred", |
|---|
| 25 | pal => "barney", |
|---|
| 26 | }, |
|---|
| 27 | jetsons => { |
|---|
| 28 | husband => "george", |
|---|
| 29 | wife => "jane", |
|---|
| 30 | "his boy" => "elroy", # Key quotes needed. |
|---|
| 31 | }, |
|---|
| 32 | simpsons => { |
|---|
| 33 | husband => "homer", |
|---|
| 34 | wife => "marge", |
|---|
| 35 | kid => "bart", |
|---|
| 36 | }, |
|---|
| 37 | ); |
|---|
| 38 | |
|---|
| 39 | say 'END'; |
|---|
| 40 | |
|---|
| 41 | 1; |
|---|
| 42 | |
|---|
| 43 | __END__ |
|---|