Re: Perl threads in Object Oriented code



Eric <ecarlson@xxxxxxxxxx> wrote:
xhoster@xxxxxxxxx wrote:
Someone made a similar suggestion, but it seems as if you are
redefining the sub in the file in which it is being called instead of
using it from it's current module(?).

sub{...} creates a new anonymous sub. It can't redefine any existing
subs because to do that, you would need to use the name (or a ref to)
an existing sub, which being anonymous this ones doesn't have.

Xho

Ok - I can see the rationale behind this. In fact, I tried it, and it
worked. However, I got the oddest response message I've ever seen:

Attempt to free unreferenced scalar: SV 0xafc2db8, Perl interpreter:
0xaa069a0 at <file> <line>

What version of Perl are you using? I've seen things like that in
some of the early 5.8.x perls that went away in the some of the later
ones.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: Perl threads in Object Oriented code
    ... redefining the sub in the file in which it is being called instead of ... sub{...} creates a new anonymous sub. ... Attempt to free unreferenced scalar: SV 0xafc2db8, Perl interpreter: ... I should tell you that I got this message running different code than ...
    (comp.lang.perl.misc)
  • Re: Subroutine load Redefined in Spec.pm?
    ... How can I find out the exact line of code that is "redefining" this Sub? ... I realise it's easy to turn off the warning, ... Alex Francis wrote: ...
    (comp.lang.perl.modules)
  • Re: Perl threads in Object Oriented code
    ... redefining the sub in the file in which it is being called instead of ... sub{...} creates a new anonymous sub. ... Attempt to free unreferenced scalar: SV 0xafc2db8, Perl interpreter: ... I should tell you that I got this message running different code than ...
    (comp.lang.perl.misc)
  • Re: Perl threads in Object Oriented code
    ... redefining the sub in the file in which it is being called instead of ... sub{...} creates a new anonymous sub. ... What version of Perl are you using? ... (with 1 registered patch, see perl -V for more detail) ...
    (comp.lang.perl.misc)
  • Re: Perl threads in Object Oriented code
    ... Note the following line of code in the former script: ... This line is calling the 'get' sub. ... redefining the sub in the file in which it is being called instead of ... subcreates a new anonymous sub. ...
    (comp.lang.perl.misc)