Skip to content
This repository
Browse code

Was fooled by the e in -MBlock::NamedVar

  • Loading branch information...
commit 2dba6e56c85f097cb72edb8155bea524f1aa17ab 1 parent 39e84a6
Michael G. Schwern authored May 12, 2010
7  bin/perl5i.c.PL
@@ -19,6 +19,8 @@ printf $fh <<'END', $0, $perl_path, $tempdir;
19 19
  * Any changes here will be wiped out.  Edit it there instead.
20 20
  */
21 21
 
  22
+#define DEBUG 0
  23
+
22 24
 #include <unistd.h>
23 25
 #include <stdlib.h>
24 26
 #include <stdio.h>
@@ -50,7 +52,10 @@ int main (int argc, char* argv[]) {
50 52
         char *dash_e = strchr(argv[i], 'e');
51 53
 
52 54
         /* Its a one liner */
53  
-        if( dash_e && (strchr(argv[i], '-') == argv[i]) )
  55
+        if( dash_e && strcmp(dash_e, "e") == 0
  56
+            && (strchr(argv[i], '-') == argv[i])
  57
+            && (strchr(argv[i], 'M') != argv[i]+1)
  58
+        )
54 59
         {
55 60
             saw_dash_e = 1;
56 61
 
2  t/command_line_wrapper.t
@@ -28,6 +28,8 @@ like `$perl5i "-Ilib" -e "\$^X->say"`, qr/perl5i/, '$^X is perl5i';
28 28
 
29 29
 is `$perl5i -wle "print 'Hello'"`, "Hello\n", "compound -e";
30 30
 
  31
+is `$perl5i -Minteger -e "say 'Hello'"`, "Hello\n", "not fooled by -Module";
  32
+
31 33
 # Make sure it thinks its a one liner.
32 34
 is `$perl5i -e 'print \$0'`, "-e",      '$0 preserved';
33 35
 is `$perl5i -e 'print __LINE__'`, 1,    '__LINE__ preserved';

0 notes on commit 2dba6e5

Please sign in to comment.
Something went wrong with that request. Please try again.