one accidentally feeds embed.fnc or t/op/re_tests to the perl
interpreter.
p4raw-id: //depot/perl@32839
+: 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
:
+# 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
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;