thanks for the reply.  I was not able to figure out how the code
works.  I have commented the code below.  can you help
explain it a bit?  thanks.



On Jan 10, 9:41 am, [EMAIL PROTECTED] (Chas. Owens) wrote:
> > __DATA__
> >              DEV01-HBA0_DMX1-13CA  <-- begin of record
> >               WWN: 10000000C934A35B
> >               WWN: 5006048ACAFE1E4C <-- end of record
> >               EST01_HBA1_STK_TAPES1 <-- begin of record
> >               WWN: 100000E002239270
> >               WWN: 500104F000619193
> >               WWN: 500104F00061918D
> >               WWN: 500104F000619190
> >               WWN: 500104F00061919D <-- end of record.
>
> snip
>
> my $record = <>; #prime the pump

this suck in the whole input file into $record. a scaler.
Is that what you really mean?  or how do you read in
just the first line within  the file?

> while (my $line = <>) {
>     if ($line =~ /^\s*WWN/) {
>         $record .= $line;

this append the $line to $record, which contain the whole file
earlier ?
what we want to achive here?

>         next;
>     }

so we exit the loop unless if match WWN.

and we start porceesing the record for lines that don't matched
above?

>     process_record($record);
>     $record = $line; #start a new record}

I didn't see how this start a record record, $line contain
the


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to