If C<perl -a>, do equivalent of C<use vars '@F'>
Chip Salzenberg [Fri, 21 Mar 1997 05:42:30 +0000 (17:42 +1200)]
toke.c

diff --git a/toke.c b/toke.c
index f9e3b07..d1c60dd 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1494,16 +1494,19 @@ yylex()
                sv_catpv(linestr, "LINE: while (<>) {");
                if (minus_l)
                    sv_catpv(linestr,"chomp;");
-               if (minus_a){
-                   if (minus_F){
-                     char tmpbuf1[50];
-                     if ( splitstr[0] == '/' || 
-                          splitstr[0] == '\'' || 
-                          splitstr[0] == '"' )
+               if (minus_a) {
+                   GV* gv = gv_fetchpv("::F", TRUE, SVt_PVAV);
+                   if (gv)
+                       GvIMPORTED_AV_on(gv);
+                   if (minus_F) {
+                       char tmpbuf1[50];
+                       if ( splitstr[0] == '/' || 
+                            splitstr[0] == '\'' || 
+                            splitstr[0] == '"' )
                            sprintf( tmpbuf1, "@F=split(%s);", splitstr );
-                       else
+                       else
                            sprintf( tmpbuf1, "@F=split('%s');", splitstr );
-                       sv_catpv(linestr,tmpbuf1);
+                       sv_catpv(linestr,tmpbuf1);
                    }
                    else
                        sv_catpv(linestr,"@F=split(' ');");