PGO has asked for the wisdom of the Perl Monks concerning the following question:
What syntax do I need where?use strict; no strict 'refs'; # stop complaints about hard references use warnings; no warnings 'once'; # no warnings if only indirect data accesses sub display_data(); sub dump_data(); format STDOUT_TOP = Payment To Address ---------------------------------------- -------------------- +------ . format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< +<<<<<< { $xinfo{PAYTO}, $addr1{LINE} } . $|++; # autoflush our ( %data, %addr1, %addr2, %xinfo ); my $hash; @ARGV= 'vendshrt'; while (<>) { chomp; my ($field, $value) = split ' ', $_, 2; unless ($field) { next unless $hash; write STDOUT; undef $hash; } else { $field =~ s/\.//g; if ($field =~ /VENDOR_LIBRARY/) { $hash = 'data'; next; } if ($field =~ /(ADDR1|ADDR2|XINFO)/) { my $section = lc $1; $hash = $field =~ 'BEGIN' ? $section : 'data'; } else { $hash->{$field} = $value; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Execution Errors
by pfaut (Priest) on Feb 06, 2003 at 20:23 UTC |