in reply to Eval str return different from Eval block return

Greetings,

Winnt, AS 5.6.1 631.
Using -w i get:

Name "main::capture(5)" used only once: possible typo at strange.pl li +ne 15. Use of uninitialized value in eval "string" at strange.pl line 15. No eval :1 In str eval :1 In block eval :1 Block Eval ret :1 Str Eval ret :0
WTF? regardless of the warning, the given example runs under strict 'refs'. If I use eval "readonly(5)->[0]" it stops complaining (but still the results are wrong.
And the "Block eval ret" thing sets $@ to
Modification of a read-only value attempted at strange.pl line 4.
Uh?
Cheers,
alf
You can't have everything: where would you put it?

Replies are listed 'Best First'.
Re: Re: Eval str return different from Eval block return
by demerphq (Chancellor) on May 17, 2002 at 15:25 UTC
    !?!!

    Can you tell me what happens when you use the code in Re: Re: Eval str return different from Eval block return?

    We are running the same version of Perl so im suprised we are having different results. (ok im W2k not NT propper, but still...)

    Thanks,

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.

      Greetings,

      The warning disappears then.
      I still get

      Modification of a read-only value attempted at strange2.pl line 4.
      for $@ at "Block Eval ret" though.
      Cheers,
      alf
      You can't have everything: where would you put it?
        Bing!

        Of course you do. :-) $@ is being set by the eval in readonly().

        Thats how we determine if the var is readonly in the first place. :-)

        Yves / DeMerphq
        ---
        Writing a good benchmark isnt as easy as it might look.