diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-09-24 11:46:41 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-09-24 11:48:51 +0100 |
commit | 3d7a9343ce805daaa050171aecb0ab4f37fed18d (patch) | |
tree | 2c1d85cf2322479ecbeae64339ef052603ba25a7 /t/test.pl | |
parent | bf70f4101a9bd4064c4bc7f03a677f4227ad79a4 (diff) | |
download | perl-3d7a9343ce805daaa050171aecb0ab4f37fed18d.tar.gz |
Add a warning to test.pl if quotes are used in one-liners.
Fix all the tests that were using quotes, and (by implication) working
because barewords are treated as strings, and one-liners aren't run under
strict.
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -427,6 +427,7 @@ USE_OK # Arguments : # switches => [ command-line switches ] # nolib => 1 # don't use -I../lib (included by default) +# non_portable => Don't warn if a one liner contains quotes # prog => one-liner (avoid quotes) # progs => [ multi-liner (avoid quotes) ] # progfile => perl script @@ -480,6 +481,9 @@ sub _create_runperl { # Create the string to qx in runperl(). die "test.pl:runperl(): 'progs' must be an ARRAYREF " . _where() unless ref $args{progs} eq "ARRAY"; foreach my $prog (@{$args{progs}}) { + if ($prog =~ tr/'"// && !$args{non_portable}) { + warn "quotes in prog >>$prog<< are not portable"; + } if ($is_mswin || $is_netware || $is_vms) { $runperl = $runperl . qq ( -e "$prog" ); } |