Generated Code from a2p
Generated Code from a2p
- Problem with split() occurring before the substitution
- A gotcha that can lead to numerous headaches
#!/usr/local/bin/perl
$[ = 1; # set array base to 1
while (<>) {
chop; # strip record separator
@Fld = split(' ', $_, 9999);
if (/^(cme|cbt|lif|smx|lifee)/) {
$s = "[\\[\\]]", s/$s/ /g;
printf "%-18s%8d\n", $Fld[1], $Fld[2];
}
}
Running above PERL script yielded
cbt0515s.par[495316]: 0
cme0515s.par[2044020]: 0
lif0515s.par[221548]: 0
lifee0515s.par[581755]: 0
smx0515s.par[276660]: 0