if (/PIN vcc/../END vcc/) {
if(/LAYER\s+m(\S+)/) {
push(@num, $1);
print "@num" ;
Only some schematic suggestions. Basically, follow the advice given above by haukex:
-
Get rid of the print "@num" ; statement in the if-blocks within your while-loop and replace it with a
pp \@num;
statement if you want to see the array grow while the file is being processed.
-
After the while-loop terminates, another pp \@num; statement can show the final state of the array. Then, get the maximum value with some statement like
my $max_LAYER_m_number = max @num;
and you're off to the races.
If you're still having problems, please show us some
brief and complete working code and associated input data and tell us how the output produced falls short of what you need.
Give a man a fish: <%-{-{-{-<