in reply to Not matching a single quote (apostrophe!)

Ok ppl, thanks for the inspiration

Have now fixed it, for some reason;

$tmp=s/\n$n\t$v/\n$n\t$v\t$ctr/

will work on non-escaped quote '

as opposed to;

$tmp=s/^$n\t$v/$n\t$v\t$ctr/

or even;

$tmp=s/$n\t$v/$n\t$v\t$ctr/

Which both failed.

I am sure I tried this before my jeckling with \' n \Q's n \E's, but maybe not.

Thanks ppl!

Replies are listed 'Best First'.
Re^2: Not matching a single quote (apostrophe!)
by ikegami (Patriarch) on Nov 17, 2009 at 16:00 UTC

    "^" matches the start of the *string*. Sounds like you want to match the start of the *line*. Use the /m modifier to make "^" match the start of the line. Your question had nothing to do with single quotes.

    perlre

      quite right! obvious when you look at it..