Today I was told to debug why a night batch failed to complete in the last weeks ...
As it turned out filenames where checked with a list of hardcoded regexes and one of them had a typo. Instead of filter => ".*pl|.*txt" it had ".*pl|*.txt" which was hard to spot among many other regexes and caused a runtime error.
Now using qr would have caused filter => qr/.*pl|*.txt/ to fail immediately at compile time.
And since my colleagues use Komodo which runs perl -c at background (aka flymake-mode in emacs) this would have meant noticing the typo instantly while editing.
HTH!
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
PS: not wanna talk about the other flaws, like why extensions are checked with handcrafted regexes or why exitcodes from batches weren't checked...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Good practice: A case for qr//
by morgon (Priest) on Apr 26, 2016 at 02:30 UTC | |
by LanX (Saint) on Apr 26, 2016 at 11:30 UTC | |
by morgon (Priest) on Apr 27, 2016 at 01:57 UTC |