Test_Progs/failure_to_identify_loops

filter: Statementstmt 21.4% 29 / 135 Branchbran 7.6% 6 / 78 Conditioncond 16.6% 3 / 18 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 17.1% 42 / 245 CC 1 SCAR 0.0
CC
1
Cov
16%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Test_Progs/reply ↑ Summary Test_Progs/nested2c »
1 #! /usr/bin/perl -w
2  
3 # Failure to Identify select Loops
4 #
5 # When a properly formed select loop appears in certain contexts,
6 # such as before a line containing certain patterns of dollar signs
7 # or quotes,
8 # it will not be properly identified and translated into standard Perl.
9 #
10 # The following is such an example:
11 #
12 # use Shell::POSIX::Select;
13 # select (@names) { print ; }
14 # # $X$
15 #
16 # The failure of the filtering routine to rewrite the loop causes the
17 # compiler to issue the following fatal error when it sees the
18 # { following the (LIST):
19 #
20 # syntax error at filename line X, near ") {"
21 #
22 # This of course prevents the program from running.
23 #
24 # The problem is either a bug in Filter::Simple, or one of the modules on
25 # which it depends.
26 # Until this is resolved, you may be able to
27 # handle such cases by explicitly turning filtering off before the offending
28 # code is encountered, using the no directive:
29 #
30 # use Shell::POSIX::Select; # filtering ON
31 # select (@names) { print ; }
32 #
33 # no Shell::POSIX::Select; # filtering OFF
34 # # $X$
35  
36 # Is this resolved?
37  
38 1 my $VERSION = 1.02;
39  
40 1 ▶use blib;
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 # case 1:
43  
44 1 ▶ use Shell::POSIX::Select;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 select (@names) { print ; }
46 # $X$
47  
48 # case 2:
49 1 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
and warn "LINE NUMBER FOR START OF USER CODE_BLOCK IS: ", __LINE__, "\n" 0 1 1
Condition50%1/2
$Shell::POSIX::Select::DEBUG > 1 and
!ll
10
MC/DC0%0/1
$Shell::POSIX::Select::DEBUG > 1 and
$Shell::POSIX::Select::DEBUG > 1
Truth table50%1/2
A
A= $Shell::POSIX::Select::DEBUG > 1
Aresult
00
11
50 use Shell::POSIX::Select; # filtering ON
51 select (@names) { print ; }
52  
53 no Shell::POSIX::Select; # filtering OFF
54 1 # $X$
« Test_Progs/reply ↑ Summary Test_Progs/nested2c »