in reply to Re: question regarding using Switch.pm in production use
in thread question regarding using Switch.pm in production use

Of course, a properly written source filter will insert #line statements, to keep the error messages in sync with the original file. Once you stack a second source filter on top of that, things become hairy, as then, that second source filter needs to understand #line hints as well, and parse them accordingly. Which is unlikely to be correct. I'm not sure if Filter::Simple implements that, but I found #line very handy when dealing with code generated from templates.

As Perl allows anonymous code structures, I tend to try to avoid code generation from templates and try to use as much anonymous code structures as possible, because then I get the Perl syntax check at initial compile time and not at template compile time, which may be in mid-flight already.

  • Comment on Re^2: question regarding using Switch.pm in production use

Replies are listed 'Best First'.
Re^3: question regarding using Switch.pm in production use
by DrHyde (Prior) on May 04, 2005 at 09:14 UTC
    Ooh, I learnt something new! Where is #line documented so I can learn how it works?

      It is at the bottom of perlsyn entitled Plain Old Comments (Not!)

      /J\