|
Posted by xhoster on April 10, 2008, 12:02 pm
Please log in for more thread options
PugetSoundSylvia@gmail.com wrote:
>
> while (<LOGFILE>) {
>
> @fields = unpack( $BaseBSPFileTemplate, $_ );
>
> $RecordType = $fields[0];
> $SequenceNumber = $fields[1];
> $RecordTypeSuffix = $fields[2];
>
> ... and so forth ...
>
> Is there a better way to do this - one where the unpack function
> itself would automatically split it into the actual variables
> ($RecordType, $SequenceNumber, $RecordTypeSuffix, etc) - instead of me
> having to have the section that has a bunch of rows like this:
You can assign directly to a list of variables:
my ( $RecordType,
$SequenceNumber,
$RecordTypeSuffix,
# ....
) = unpack( $BaseBSPFileTemplate, $_ );
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
|