Open p5pRT opened 6 years ago
A few weird line number issues I've discovered.
!#perl use strict; do{abc}.' '.do{xyz}
Output: Bareword "abc" not allowed while "strict subs" in use at weird-bug.pl line 4. Bareword "xyz" not allowed while "strict subs" in use at weird-bug.pl line 4. Execution of weird-bug.pl aborted due to compilation errors.
But with taint mode\, the correct line numbers are reported.
!#perl -T use strict; do{abc}.' '.do{xyz}
Output: Bareword "abc" not allowed while "strict subs" in use at weird-bug.pl line 3. Bareword "xyz" not allowed while "strict subs" in use at weird-bug.pl line 4. Execution of weird-bug.pl aborted due to compilation errors.
Also correct warnings if we swap out the strict.
!#perl use warnings; do{abc}.' '.do{xyz}
Output: Unquoted string "abc" may clash with future reserved word at weird-bug.pl line 3. Unquoted string "xyz" may clash with future reserved word at weird-bug.pl line 4.
A slight change on the last line now moves both errors to line 3.
!#perl use strict; do{abc}.' '.do(xyz)
Output: Bareword "abc" not allowed while "strict subs" in use at weird-bug.pl line 3. Bareword "xyz" not allowed while "strict subs" in use at weird-bug.pl line 3. Execution of weird-bug.pl aborted due to compilation errors.
Taint makes no difference now.
!#perl -T use strict; do{abc}.' '.do(xyz)
Output: Bareword "abc" not allowed while "strict subs" in use at weird-bug.pl line 3. Bareword "xyz" not allowed while "strict subs" in use at weird-bug.pl line 3. Execution of weird-bug.pl aborted due to compilation errors.
But swapping out strict does.
!#perl use warnings; do{abc}.' '.do(xyz)
Output: Unquoted string "abc" may clash with future reserved word at weird-bug.pl line 3. Unquoted string "xyz" may clash with future reserved word at weird-bug.pl line 4. Use of uninitialized value in concatenation (.) or string at weird-bug.pl line 3.
Surely taint and strict should not affect the reported line numbers.
Migrated from rt.perl.org#133364 (status was 'new')
Searchable as RT133364$