in reply to need help in extracting lines

If Perl thinks there is something wrong with the syntax, Perl tells you so. What did Perl tell you and what did you do about it? Maybe you want to just run your code using the diagnostics pragma?

I used perl -Mdiagnostics -le  "if /\[Alias\]/../^\s*\s$/ { push (@alias, $_); }" and found the message pretty to the point.

Replies are listed 'Best First'.
Re^2: need help in extracting lines
by AnomalousMonk (Archbishop) on Jan 13, 2009 at 16:30 UTC
    Another possible conceptual problem with stanleysj's approach is that the regex  /^\s*\s$/ is looking for a line consisting only of one or more whitespace characters, i.e., is equivalent to  /^\s+$/.

    This may or may not be what the OPer really wants to terminate the text block with.