in reply to Inline subs?
Brutish I know, but hopefully any subs declared sub funcname : inline will be inlined into the code. If not, that code (and the regexes from the Sub::Lexical source) should give you a head start :)package Inline::Subs; use strict; use Regexp::Common; use Filter::Simple; my $re = qr< sub ( [_a-zA-Z](?:[\w_]+) ) \s* : \s* inline \s* ( $RE{balanced}{-parens => '{}' ) >x; FILTER_ONLY code => sub { while(my($subname, $code) = /$re/) { s/$re// and s/\b$subname\b/$code/g; } } ; q[ and the rest is silence ];
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Inline subs?
by Limbic~Region (Chancellor) on May 02, 2003 at 01:19 UTC | |
|
Re2: Inline subs?
by dragonchild (Archbishop) on May 02, 2003 at 13:36 UTC | |
by broquaint (Abbot) on May 02, 2003 at 15:11 UTC |