Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: perl open mode

by snopal (Pilgrim)
on Oct 24, 2007 at 03:16 UTC ( #646810=note: print w/replies, xml ) Need Help??


in reply to Re: perl open mode
in thread perl open mode

That works if the replacement is character for character. You may be surprised by the results if the replacements are shorter than the original value.

open (A, '+<', "somefile.html") or die $!; s/a/b/g for my @records = <A>; seek(A, 0, 0); ### truncate (A, 0) or die "can not truncate file to zero length\n"; ### print A @records;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2020-10-29 14:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (271 votes). Check out past polls.

    Notices?