![]() |
need help with a function in a perl file
I use a perl program to carry out functions and need a function added to the program.
this function is to add up numbers on each pass when a selected search is reached. is there any one that can help. i can paste the program . |
Re: need help with a function in a perl file
Do you have problems with Perl or with algorithm?
|
Re: need help with a function in a perl file
I have a perl program that i need a function added to . it was written by my son-in-law and now needs an additional function. i have not been able to get the function added.
i have been using gw-basic to carry out the task manually but this is laborious and my hands dont type as well these days. the perl program does a search of htm files and prints and saves results. i need it to do a tally during the passing through the data and storing the outcome into the txt file outcome. i can provide / past both gwbasic function and the perl file if it would help. (i'm sure it would help) sorry i missed your reply to my query. hope you are still there. |
Re: need help with a function in a perl file
Yes, I'll need both of then, possibly with explanation of algorithms if comments are missing.
|
Re: need help with a function in a perl file
10 input "filename";me$
20 dim x$(3900),a$(4900) 30 input "search name or XXX to end";s$ 40 r(i)=0 50 if s$="XXX" then END 60 open "i",#1,me$ 70 if eof(1) then 230 80 input#1,a$(i) 90 q=q+1 100 if left$(a$(i),len(s$)) <> s$ then 220 110 print a$(i),q 120 x$= right$(a$(i),1) 130 j=val(x$) 140 y$=right$(a$(i),2) 145 e=e+1 150 z=val(y$) 160 if z>0 then z=9-z 170 j=9-j 180 if j = 9 then j = 0 190 r(i) = r(i) +j+z 200 print r(i),e 210 n = n+1 220 goto 70 230 close#1 235 e = 0 240 goto 30 |
Re: need help with a function in a perl file
that was the gw basic algorithm it inputs data from horse.dat under a$(i) and at the end of the name is a number for each name appearance it adds the numbers by subtracting from 9 e.g. where the name ends with 5 it subtracts 9-5 which is 4 this is stored in another variable and the final total is printed at the end after the horse name. there is also a test for a value at the 2nd last character in the name if there is an a on the end. e.g. )7a is tested for a value at the second last character.
sample data "pepinello(good)(1200)(belmont)27-09-98)7" other sample "naughty boy(2150)(good)(oakbank)13-03-10)7a" i will post part of the perl file in another post. |
Re: need help with a function in a perl file
chorny can i email the perl program to you it is a bit long for the post but is only about 80 lines.
regards |
Re: need help with a function in a perl file
chorny can you send me advice if you need perl program emailed. or should i post it.
it seems a little large to post. or can post it in parts. |
Re: need help with a function in a perl file
this is part of the perl file.
Code:
#!/usr/bin/perl |
Re: need help with a function in a perl file
sent file in a attachments but dont know where it went.
|
| All times are GMT +5.5. The time now is 06:47. |