Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Restoring the magic to the _ filehandle in Perl 5.8.9

by Animator (Hermit)
on Jan 27, 2010 at 22:04 UTC ( #820036=note: print w/ replies, xml ) Need Help??


in reply to Restoring the magic to the _ filehandle in Perl 5.8.9

The statement: 'The code below, in Perl 5.8.8 and 5.10.9 prints 1\n three times' is incorrect and confusing... I'm guessing you are confusing the different versions of perl...

Running 'the code below':

  • Perl version: 5.006
    Use of uninitialized value in print at t.pl line 24.
    
    Undefined subroutine &main::_ called at t.pl line 28.
    
  • Perl version: 5.008
    Use of -l on filehandle _ at t.pl line 24.
    Use of uninitialized value in print at t.pl line 24.
    
    Undefined subroutine &main::_ called at t.pl line 28.
    
  • Perl version: 5.008008
    Use of -l on filehandle _ at t.pl line 24.
    Use of uninitialized value in print at t.pl line 24.
    
    Undefined subroutine &main::_ called at t.pl line 28.
    
  • Perl version: 5.008009
    Use of -l on filehandle _ at t.pl line 24.
    Use of uninitialized value in print at t.pl line 24.
    
    Undefined subroutine &main::_ called at t.pl line 28.
    
  • Perl version: 5.010000
    1
    1
    1
    
  • Perl version: 5.011003
    1
    1
    1
    


Comment on Re: Restoring the magic to the _ filehandle in Perl 5.8.9
Replies are listed 'Best First'.
Re^2: Restoring the magic to the _ filehandle in Perl 5.8.9
by ikegami (Pope) on Jan 27, 2010 at 23:11 UTC
    And the reason is that 5.10 doesn't consider "_" in "-X _" a function call.
    >perl588\bin\perl -MO=Concise -e"sub _; -l _" 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 6 <1> ftlink vK/1 ->7 5 <1> entersub[t2] sKS/TARG,1 ->6 - <1> ex-list sK ->5 3 <0> pushmark s ->4 - <1> ex-rv2cv sK/128 ->- 4 <#> gv[*_] s ->5 -e syntax OK >perl589\bin\perl -MO=Concise -e"sub _; -l _" 7 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 6 <1> ftlink vK/1 ->7 5 <1> entersub[t2] sKS/TARG,1 ->6 - <1> ex-list sK ->5 3 <0> pushmark s ->4 - <1> ex-rv2cv sK/128 ->- 4 <#> gv[*_] s ->5 -e syntax OK >perl5100\bin\perl -MO=Concise -e"sub _; -l _" 4 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v:{ ->3 3 <#> ftlink[*_] vR ->4 -e syntax OK

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://820036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-08 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls