in reply to Cannot find the error
The check for a new section start is in the
condition (the regex is equivalent to /^t/, BTW). It's located inside the YES-branch of the$row =~ /^[t]/
but the end of the previous section sets $newsection to 1, so this condition can't be reached.if ($newsection <= 0)
I'd move the /^t/ condition into the ELSE part of the outermost if, and initialize $newsection with 1 at the very start.
Also, I miss strict and warnings.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Cannot find the error
by gudmo (Novice) on Apr 03, 2020 at 14:01 UTC | |
by choroba (Cardinal) on Apr 03, 2020 at 14:04 UTC | |
by gudmo (Novice) on Apr 03, 2020 at 14:19 UTC | |
by choroba (Cardinal) on Apr 03, 2020 at 14:38 UTC |
In Section
Seekers of Perl Wisdom