in reply to problems with global $1

the line "ArraySize 4285" is identified by the regular expression. would'nt . $1. initialize $1 with the value "4285"... which is the string next to "ArraySize"?

Replies are listed 'Best First'.
Re^2: problems with global $1
by andyford (Curate) on Oct 22, 2007 at 19:16 UTC

    If the string is at the beginning of the line: you have the '^' at the beginning your regex. You also have to make sure that what you think is a single space is really a single space. Try changing the space in the regex to, say, '\s+' to match any kind and amount of white space. There are probably other things that could go wrong that I haven't thought of...

    non-Perl: Andy Ford

Re^2: problems with global $1
by Not_a_Number (Prior) on Oct 22, 2007 at 19:21 UTC

    I might try answering your question once you have formatted your OP as suggested by eff_i_g below.

    Until then, I'm afraid, I just don't understand it.