in reply to Re: Inline subs?
in thread Inline subs?

Why doesn't this already exist?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re2: Inline subs?
by broquaint (Abbot) on May 02, 2003 at 15:11 UTC
    Why doesn't this already exist?
    Because it's not as simple as it looks e.g
    sub foo : inline { my %args = @_; ... return $something; }
    This would require not just parsing out the sub but also the any munging of @_ and any exitting of the sub (e.g return, last etc). While I guess this could be done with a bit of op tree trickery or XS, a simple filter would only be suitable for dropping literal blocks of code (which would also have to comply with strictures). Having said that I probably will make a module, but with many, many disclaimers ;)
    HTH

    _________
    broquaint