Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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.
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-07-03 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls