| 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 |
my $VERSION = 1.02; |
| 39 |
|
| 40 |
use blib; |
| 41 |
|
| 42 |
# case 1: |
| 43 |
|
| 44 |
use Shell::POSIX::Select; |
| 45 |
select (@names) { print ; } |
| 46 |
# $X$ |
| 47 |
|
| 48 |
# case 2: |
| 49 |
|
| 50 |
use Shell::POSIX::Select; # filtering ON |
| 51 |
select (@names) { print ; } |
| 52 |
|
| 53 |
no Shell::POSIX::Select; # filtering OFF |
| 54 |
# $X$ |