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

I don't see any difference between
foo(bar(ARGS)); foo(my(ARGS));
But I do see the difference between
bar(foo(ARGS)); my(foo(ARGS));
Why do you think my should behave differently than bar?
I've expressed no opinion on whether it should. I'm just observing it does.

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

    I've expressed no opinion on whether it should. I'm just observing it does.

    Please elaborate. So far, you've only given examples of how you can't use my. There's no disputing there are limits. You didn't give any example of how it doesn't behave like a sub.

      So far, you've only given examples of how you can't use my.
      Let's see, I gave several examples where you either can't use my where you can use subs, or where my behaves different than subs do.

      How much more differences do you need before you could imagine someone doesn't consider my to behave like a sub? Heh, I don't care one iota what you consider to be subs or not. I don't consider my to behave like a sub. And I've pointed out enough differences why I don't consider my to act like a subroutine call.

        Let's see, I gave several examples where you either can't use my where you can use subs

        All subs have limits on their arguments.

        or where my behaves different than subs do.

        That's what you said, and I asked for that example. Repeating yourself doesn't help. The only thing example I see is that my() takes a list of variables for arguments, which just goes to show that it is like sub. Nothing else has arguments.