[Melbourne-pm] Regexps - how does the lexical scope of capture buffers work? (Was: Regexp: What's the right way to do this?)
nathan.bailey at monash.edu
Wed Oct 17 05:24:03 PDT 2012
Oops, accidentally only replied to Shlomi.
With the input file:
8:10 - 9:15
but b.pl produces:
Why is start_time undefined now? at b.pl line 8, <> line 2.
I presume it fails because the regexp fails, returning undef which is then assigned to $start_time, rather than failing and skipping the assignment.
I'm just wondering if there's a better way to grab text out of multiple lines that are related to each other. A simple solution would be to go for multi-line strings but I'm actually curious to know (a) if that's the way the evaluation of the regexp and assignment works and (b) if there are better ways of doing multi-line parsing, without simply treating it as one big complex line.
PS: Files attached in a tarball.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 366 bytes
Desc: not available
More information about the Melbourne-pm