in reply to Re^11: why doesn't "my ($a,$b)" return a list?
in thread why doesn't "my ($a,$b)" return a list?

I thought by mentioning "builtin-functions" and "CORE" it's obvious that there is a possibility to overwrite &CORE::grep but none for &CORE::my, since they belong to completely different concepts.

It doesn't matter if the implementation is done by special opcodes, the concept and purpose is important.

Cheers Rolf

  • Comment on Re^12: why doesn't "my ($a,$b)" return a list?

Replies are listed 'Best First'.
Re^13: why doesn't "my ($a,$b)" return a list?
by ikegami (Patriarch) on Aug 19, 2010 at 23:37 UTC

    it's obvious that there is a possibility to overwrite &CORE::grep but none for &CORE::my, since they belong to completely different concepts.

    No, grep cannot be overridden. Just like my, it cannot be represented by prototypes. That's the only thing that controls whether something can be overridden or not.

    Again, I don't know what your point is. It's been a while since I've had any idea what you are trying to communicate. (Since JavaFan's reply, at least.)

      > No, grep cannot be overridden.

      arghh ... thats paradox, perlsub is full of examples for reimplementation of the Perl "grep" operator, but in reality it can't be overridden just because of this useless extra statement instead of block syntax can't be expressed with prototypes.

      OTOH (partially) overriding do and require is allowed.

      Cheers Rolf