Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: help me on seek and tell function

by tachyon (Chancellor)
on Nov 24, 2004 at 07:15 UTC ( #410072=note: print w/replies, xml ) Need Help??


in reply to help me on seek and tell function

Discover perlfaq. Specifically from perlfaq5 read How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?

Inplace editing may be what you want.

perl -pi.bak -e 's/this string/that string/g' some.file

cheers

tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://410072]
help
Chatterbox?
[shmem]: hmm...
[shmem]: Lady_Aleena: perl -MMP3::Tag -MFile::Find -le 'find(sub{if($File ::Find::name=~/\. mp3$/){$sum+=MP3:: Tag->new($_)-> interpolate("\%S ")} }, "Music"); print "total seconds: $sum"'

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-04-23 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.