in reply to Help with argument to a subroutine
What you need is something more like the following (assuming your data is coming in through STDIN - I haven't tested that part):
use strict; use warnings; my $header; while (1) { chomp($_ = <STDIN>); last if !$_; $header .= "$_\n"; } parse_header($header); sub parse_header { my $header = $_[0]; print $header; ## Do necessary $header processing }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with argument to a subroutine
by unixhome (Novice) on May 15, 2006 at 19:22 UTC | |
|
Re^2: Help with argument to a subroutine
by GrandFather (Saint) on May 15, 2006 at 19:11 UTC |