Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Delete strings

by vinoth.ree (Monsignor)
on Apr 10, 2009 at 08:51 UTC ( #756774=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://756774]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2023-12-10 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?