in reply to Inlining method/function calls?
There are two cases in perl which sort of correspond to inlining.
One is the folding of constant functions in the compiler's optimization phase. That doesn't give you much direct control, but you can take pains to make perl notice the opportunity. Empty prototypes and constant.pm help there.
The other, mentioned by adrianh, is to invoke the C preprocessor with the -P flag. An example,
#!/usr/bin/perl -P #define Foo(a) {\ local $, = " ";\ print "defined: ", a, $/;\ } my ($c, $d, @e, %f) = ('c','d',qw/all in e/); @f{qw/all in f/} = @e; Foo($c) Foo($d) Foo(@e) Foo(%f)
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re2: Inlining method/function calls?
by dragonchild (Archbishop) on Jul 28, 2003 at 15:54 UTC | |
by Zaxo (Archbishop) on Jul 28, 2003 at 18:13 UTC |