in reply to Re: Delete strings
in thread Delete strings

Your code is not working for me!

Vinoth,G

Replies are listed 'Best First'.
Re^3: Delete strings
by almut (Canon) on Apr 10, 2009 at 08:57 UTC

    Are you on Unix or on Windows? On Unix, the shell would interpolate $f in double quoted strings, so it's usually easier to use single quotes for Perl one-liners...  OTOH, on Windows you'd have to use double quotes, as single quotes don't work (as quotes) with the standard shell...

      I am on Unix, Now I understand it. Thanks

      Vinoth,G
Re^3: Delete strings
by lakshmananindia (Chaplain) on Apr 10, 2009 at 09:05 UTC

    Try executing as below

    perl -i.bak -ne"print if "\$f" ||= /1\.0/" file

    In unix the shell interprets the $f. So you were unable to execute.

    --Lakshmanan G.

    The great pleasure in my life is doing what people say you cannot do.


Re^3: Delete strings
by ww (Archbishop) on Apr 10, 2009 at 12:25 UTC
    ree: your reply is not an error message for me.

    Update: identified node to which this is a response.