[plug] Perl Question

Matt Kemner zombie at penguincare.com.au
Tue May 13 14:07:39 WST 2003


On Tue, 13 May 2003, quoth David Buddrige:

> 543,XB5435,0000043,ONSHORE SYSTEM (OS),CLD,Drawing,5/11/95,CX453

> while(<>)
> {
>  my $line_to_parse = $_;
>  # some code to parse the line

   @record=split (/,/);
   # or alternatively
   ($var1, $var2, $var3, $var4, $var5, $var6, $var7, $var8) = split (/,/);

>  # then some code to output each field individually...
   foreach $field (@record) {
    print "$field ";
> }

 - Matt



More information about the plug mailing list