in reply to Regex problem

#seems like the string "branch from" is not matching since $1 below prints nothing

$1 refers to text matched by the first set of capturing parens (if any). Since your regex:

if ($line =~ /branch from/)

doesn't contain any capturing parens, $1 will never be set.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.