Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: question regarding using Switch.pm in production use

by DrHyde (Prior)
on May 03, 2005 at 09:12 UTC ( [id://453511]=note: print w/replies, xml ) Need Help??


in reply to question regarding using Switch.pm in production use

What irritates me most about them is that your bugs move. If you have an error in your code inside or after a Switch for instance, the line numbers spat out in the error and diagnostic messages will be wrong, because they are the line numbers in the code after the source filter has diddled with it.

Replies are listed 'Best First'.
Re^2: question regarding using Switch.pm in production use
by Corion (Patriarch) on May 03, 2005 at 09:18 UTC

    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.

      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\

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://453511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found