summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index c52f2cc04a..69b5c0edcc 100644
--- a/perl.c
+++ b/perl.c
@@ -694,12 +694,23 @@ print \" \\@INC:\\n @INC\\n\";");
cddir = savepv(s);
break;
case '-':
+ if (*++s) { /* catch use of gnu style long options */
+ if (strEQ(s, "version")) {
+ s = "v";
+ goto reswitch;
+ }
+ if (strEQ(s, "help")) {
+ s = "h";
+ goto reswitch;
+ }
+ croak("Unrecognized switch: --%s (-h will show valid options)",s);
+ }
argc--,argv++;
goto switch_end;
case 0:
break;
default:
- croak("Unrecognized switch: -%s",s);
+ croak("Unrecognized switch: -%s (-h will show valid options)",s);
}
}
switch_end:
@@ -1310,7 +1321,7 @@ char *name;
printf("\n -U allow unsafe operations");
printf("\n -v print version number and patchlevel of perl");
printf("\n -V[:variable] print perl configuration information");
- printf("\n -w TURN WARNINGS ON FOR COMPILATION OF YOUR SCRIPT.");
+ printf("\n -w TURN WARNINGS ON FOR COMPILATION OF YOUR SCRIPT. Recommended.");
printf("\n -x[directory] strip off text before #!perl line and perhaps cd to directory\n");
}
@@ -2323,6 +2334,7 @@ static void
init_lexer()
{
tmpfp = rsfp;
+ rsfp = Nullfp;
lex_start(linestr);
rsfp = tmpfp;
subname = newSVpv("main",4);