in reply to Perl's POD's description of the use of capturing special variables.

It's not especially clear and it's an easy mistake to make. I've been using Perl for years and consider myself quite experienced with it, but this exact issue got me a couple of months ago. I had to read the text rendering of a bunch of records, which might or might not contain all fields from the database.

while (<TEXT>) { ($f1) = /yada.+(SpecialText)anchor/ }
worked fine when it worked, but sometimes the printout listed odd values. It was a real thump-yourself-on-the-forehead moment when I realized what was happening.

I think a quick example in perlre would help a lot of newbies, and even the occasional old-timer.

Dave

  • Comment on Re: Perl's POD's description of the use of capturing special variables.
  • Download Code