Array not getting updated

I

IJALAB

Hi All,

I am new to Perl.


My problem is:


I have a log file that has lot of data and every line is identified by
its first character and then processed accordingly.


so, for example, I have a line starting with 2, from which i am
printing some data and then proceeding.....in a certain i have some
data in one line (say 3), which also lists the 3
elements...(12,14,15)...
ANother line(s) continuosly prints several elements one by one of which

my need is to check if these elements (12,14,15) are available in any
of these lines and print relevant info.


I created an


$data (stored the number of elements) and accordingly created an
array(@data) and stored those elements in that array.


when the next line is encountered i tried to pick every element from
@data and compare with those line data, i am not getting the array
elements?


is there a simpler way to handle this situation?? where am i going
wrong?


need ur help.


thanks
bala
 
D

DJ Stunks

IJALAB said:

Steps toward a fulfilling Usenet experience:

1) Don't multipost;
2) Provide code, not descriptions;
3) Provide sample input, not descriptions;
4) Provide desired output, not descriptions;
5) Don't post anything that doesn't run silently with warnings and
strictures enabled.

-jp
 
T

Tad McClellan

IJALAB said:


Hello One.
I am new to Perl.


I am old to Perl.

My problem is:


I have a log file that has lot of data and every line is identified by
its first character and then processed accordingly.


so, for example, I have a line starting with 2,


Show us an example of a data line that starts with 2 then.

from which i am
printing some data and then proceeding.....in a certain i have some
data in one line (say 3), which also lists the 3
elements...(12,14,15)...


Then show us an example of data that also lists the 3 elements.

ANother line(s) continuosly prints several elements one by one of which

my need is to check if these elements (12,14,15) are available in any
of these lines and print relevant info.


Then show us some of those lines too.

I created an


$data (stored the number of elements) and accordingly created an
array(@data) and stored those elements in that array.


Show us your code where you are doing all of that.

when the next line is encountered i tried to pick every element from
@data and compare with those line data, i am not getting the array
elements?


I don't know if you are getting them or not, I don't have enough
information to be able to answer that question.

is there a simpler way


simpler than *what* ?

You haven't shown us what you have.

to handle this situation?? where am i going
wrong?


You are going wrong by not posting the code and data.

need ur help.
^^
^^

Need real words.

Have you seen the Posting Guidelines that are posted here frequently?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,051
Members
47,656
Latest member
rickwatson

Latest Threads

Top