in reply to Tie::File question
/"$section"/ matches lines that contains a double quote followed by something that the regexp in $section matches followed by another double quote.
If you want to match lines that contain the text in $section, you want
/\Q$section\E/
If you want to match lines that are equal to the text in $section, you want
/^\Q$section\E\z/
or
$_ eq $section
I have no idea what's in $section, so it limits my ability to guess what you are trying to do and the advice I can give.
By the way, I noticed you changed
$_ .= $text;
to
$_ .= $_ .="$newline";
Why did you add quotes?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tie::File question
by machvvv (Initiate) on Aug 08, 2008 at 13:48 UTC | |
by ikegami (Patriarch) on Aug 09, 2008 at 01:44 UTC |