On Thu, Oct 7, 2010 at 10:22 AM, Charles Colbourn <
charles.colbo...@googlemail.com> wrote:

> It works very simply, by wrapping the source of 'myscript.pl' in
> "{last; <code> }'.


  Well, as it seems it does no ->import(), but just compiles the code ...

  Test::LegacyScript::Compile?



> There's some complex and potentially slightly
> fragile stuff to handle @EXPORT if you want to, but the basic case
> works pretty well.
>

  Whoops.  What would your legacy script(?) use @EXPORT for?

  (I'd be more concerned about __END__, __DATA__, __FILE__, and __LINE__.
Okay, the latter two could be handled with a #line directive, but to handle
the first two right, it seems you'd have to parse Perl ... or drop the {}s?)



> I hope that's clearer. Feel free to say 'what a stupid idea' or 'that
> won't work because' incidentally - but so far I've found it pretty
> useful.
>

  (I won't call the idea stupid, but in any context where cleaning up the
code is an option, it would be the better one.)


Eirik

Reply via email to