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

Re^2: perl script for adding information to c file.

by veerubiji (Sexton)
on Oct 10, 2011 at 11:51 UTC ( #930595=note: print w/replies, xml ) Need Help??

in reply to Re: perl script for adding information to c file.
in thread perl script for adding information to c file.

Hi choroba, Its working but i have one problem with this script, it adding information how many times sting found in c file. But i need to add only once.for example if temperature string found three times in c file, so it adding same information three times. if string found add information at once is enoghf. no need to add same information so many times(how many times string presents).because in my file i have repeated strings so its aadding same information several times. how can i rectify this.

  • Comment on Re^2: perl script for adding information to c file.

Replies are listed 'Best First'.
Re^3: perl script for adding information to c file.
by Anonymous Monk on Oct 10, 2011 at 12:04 UTC

    how can i rectify this.

    Modify program to use hash "%seen" to keep track of substitutions already made

    See perlfaq6

      Hi, if u dont mind can you tel how can i use that function in my code. because i read that you sended link but i cant found any such function, how to use that function.

        Are you here to learn or to hire a programmer?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930595]
[Discipulus]: discutere in eatalian is neutral: but discutere with wife sounds implicitly negative..
[erix]: what's the offending signature?
[Discipulus]: 'give man a fish erix it sonds like a push towards omosexuality.. ;=)
[Discipulus]: see Re: from txt file to array erix
[erix]: yeah, I ask for the text (I don't see signatures)
[Discipulus]: dear brother karl has "Furthermore I consider that Donald Trump must be impeached as soon as possible" in his sig
[erix]: ah, thanks Discipulus
[1nickt]: erix perhaps you could kindly point out your technique to roho and everyone will be happy.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-06-22 12:29 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.