diff options
author | Chip Salzenberg <chip@perl.com> | 1997-03-21 17:42:30 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-03-22 15:34:25 +1200 |
commit | 8fd239a72906940af19143fd36b81affb91e8a42 (patch) | |
tree | dd8860dd669d868376287b578151f66f1cc2c55c /toke.c | |
parent | beb185056790fb74a315834bcd0fdb296a71c854 (diff) | |
download | perl-8fd239a72906940af19143fd36b81affb91e8a42.tar.gz |
If C<perl -a>, do equivalent of C<use vars '@F'>
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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(' ');"); |