in reply to Re^2: text parsing
in thread text parsing
use strict; use warnings; use ... etc.; my $filename = 'filename'; my $msgfront = 'MESSAGE FROM SAT: '; my $path = $ENV{ PATHNAME } . "/$filename"; open my $ifh "<$path" or die $msgfront . "$!: $filename\n"; # 'group' loop for ( $_ = <$ifh>; $_ = <$ifh> and /:IsAlpha:/; ) { chop; my ( $group, @address ) = ( $_, () ); # 'address' loop for ( $_ = <$ifh> ; $_ = <$ifh> and !/:IsAlpha:/ ) { chop and push @address, $_; } # process $group with its @address -es here } close $ifh;
-M
Free your mind
|
|---|