in reply to newbie quoting question
That would be equal to:$var = quotemeta('apple (banana) cherry'); $line = 'apple (banana) cherry kiwi lemon melon'; $line =~ s/$var//;
Thus perl wouldn't catch the banana, because the parentheses were escaped.$var = 'apple \\(banana\\) cherry'; $line = 'apple (banana) cherry kiwi lemon melon'; $line =~ s/$var//;
-- arneb@emergency:~ > perl -MO=Deparse -e "(0); #Confusing perl..." 2> /dev/null '???'; arneb@emergency:~ >
|
|---|