in reply to Syntax checking without BEGIN blocks
I like to syntax check my own code, esp during a development cycle. (This isn't as useful for other people's modules but that's why test suites exist.) As others have mentioned, perl itself is unable to do this in all cases. IMO it is a module writer's responsibility, if at all possible, to allow the module user to check their own code without side effects. For example, it appears that most simple side effects (e.g. unlink) can be "commented" out with the $^C variable like this...
unlink("myfile") unless $^C;
I haven't seen much mention of $^C in the past, so perhaps someone more knowledgable can comment on whether this is always effective.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Syntax checking without BEGIN blocks
by Anonymous Monk on May 01, 2006 at 16:38 UTC | |
by bluto (Curate) on May 01, 2006 at 19:07 UTC | |
|
In Section
Seekers of Perl Wisdom