C-TinyCompiler
view release on metacpan or search on metacpan
lib/C/TinyCompiler.pm view on Meta::CPAN
complex script that adds code in many places, you may have no idea where to find
offending addition in your Perl code. Fortunately, C (and Perl) allows
you to give hints to the compiler using a C<#line> directive, which is made even
easier with this function. Without C<line_number>, you would say something like:
$context->code('Body') .= "\n#line " . (__LINE__+1) . ' "' . __FILE__ . q{"
... code goes here ...
};
and then your error reporting would say where the error occurred with respect to
the line in your script. That formula is long-winded and error prone, so you can
use this useful bit of shorthand instead:
$context->code('Body') .= C::TinyCompiler::line_number(__LINE__) . q{
... code goes here ...
};
Still not awesome, but at least a little better.
=cut
( run in 0.406 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )