[Chicago-talk] What does dollar sign followed by a period represent?

J L joel.limardo at forwardphase.com
Wed Dec 27 10:22:13 PST 2023


1. Have code reviews with pass/fail prior to committing code to a release
(yes, scripts should be considered software and as such subject to release
cycles)
2. If you cannot, at first glance, understand a regex during this then,
2.1 Save it using a meaningful variable with qr and then use it
2.2 Use the /x modifier and document it (
https://perldoc.perl.org/perlre#%2Fx-and-%2Fxx )
3. Store metrics on how long your organization spends per quarter/year on
problems like this one and adopt structural practices to reduce/eliminate
them. I have found the #1 waster is failing to use a well tested CPAN
module that does a better job in lieu of barely tested (and, no surprise,
largely undocumented) code that 'promised' to save time.

People are trying to avoid/refactor Perl scripts because they beleive that
six months down the road they will inevitably fall into this type of
problem. The fact is however there have been several ways to avoid it in
the core language available for decades.

On Sat, Dec 23, 2023, 4:57 PM Richard Reina <richard at rushlogistics.com>
wrote:

>
> A few years ago I hastily wrote some code that I did not comment very
> well. In it I found:
>
>  $switch = $. if m!^[0-3]?[0-9]/[0-3]?[0-9]/(?:[0-9]{2})?[0-9]{2}$!; #
> match date
>
> Can anyone tell me what $. means?
>
> Thanks for any help.
>
> Richard
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> https://mail.pm.org/mailman/listinfo/chicago-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20231227/d9867b82/attachment.html>


More information about the Chicago-talk mailing list