From: Nicholas Clark Date: Sat, 5 Jan 2008 13:13:36 +0000 (+0000) Subject: Protect me (and my fellow muppets) from screens of "syntax errors" if X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a51db0500cb91f11a554807ca60350bc43f0e5b;p=p5sagit%2Fp5-mst-13.2.git Protect me (and my fellow muppets) from screens of "syntax errors" if one accidentally feeds embed.fnc or t/op/re_tests to the perl interpreter. p4raw-id: //depot/perl@32839 --- diff --git a/embed.fnc b/embed.fnc index d36e2fd..b11cd6e 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1,3 +1,5 @@ +: BEGIN {die "You meant to run embed.pl"} # Stop early if fed to perl. +: : Lines are of the form: : flags|return_type|function_name|arg1|arg2|...|argN : diff --git a/t/op/re_tests b/t/op/re_tests index 87a3e50..c2397e6 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -1,3 +1,6 @@ +# This stops me getting screenfulls of syntax errors every time I accidentally +# run this file via a shell glob +__END__ abc abc y $& abc abc abc y $-[0] 0 abc abc y $+[0] 3 diff --git a/t/op/regexp.t b/t/op/regexp.t index 7ad7d89..8a13dd2 100755 --- a/t/op/regexp.t +++ b/t/op/regexp.t @@ -77,9 +77,9 @@ my $test; TEST: foreach (@tests) { $test++; - if (!/\S/ || /^\s*#/) { + if (!/\S/ || /^\s*#/ || /^__END__$/) { print "ok $test # (Blank line or comment)\n"; - if (/\S/) { print $_ }; + if (/#/) { print $_ }; next; } chomp;