Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Removing a chunk of HTML?

by kiruthika.bkite (Scribe)
on Mar 22, 2010 at 05:58 UTC ( [id://830028]=note: print w/replies, xml ) Need Help??


in reply to Removing a chunk of HTML?

In your code you have just modified the string.So changes will not be affected in a file.
If you want to modify file contents,use the module File::Inplace module.

Example
use strict; use warnings; use File::Inplace; my $editor = new File::Inplace(file=>"filename",suffix=>".bak"); while ($_=$editor->next_line) { if(s/(.*)/"welcome"/) { $editor->replace_line($_); } } $editor->commit;

If we mention suffix then it will create the backup file with the given extension.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found