Ruth Holloway has been a system administrator and software developer for a long, long time, getting her professional start on a VAX 11/780, way back when. She spent a lot of her career (so far) serving the technology needs of libraries, and has been a contributor since 2008 to the Koha open source library automation suite. Ruth is currently a Perl developer and project lead at Clearbuilt. You can find out more about Ruth's passions and career at her site. She's a mother, grandmother, wife, artist, public speaker, and mommy to the cutest little dog you'll ever meet.
Ruth Holloway
| Follow @GeekRuthie
Houston, TX
Authored Comments
In the final code block, the regex is the same for both usages, and so would not be able to discriminate between mid-sentence and start-of-sentence references (or, for that matter, case discrepancies). If you wanted to do that, you could easily create regex patterns for that behavior, and then use Regexp::Common patterns to refer to the two different behaviors. Regexp::Common just serves as a somewhat-more-readable shortcut to regexes you intend to use more than once.
It is. A my declares the listed variables to be local (lexically) to the enclosing block, file, or eval, so whatever context you define it in, then it is local to that code block only. If you're using "strict" on your scripts, as you should, then you *must* use my, our, or local to declare your variables, otherwise, they are automatically instantiated with an implied "my" on first use--which can have unpredictable results.
I hope you've found this little intro useful!