in reply to How to find last occurance in an array
if you provide enough detail that we can understand what you're doing!(See I know what I mean. Why don't you? and How do I post a question effectively? re "detail" and see Markup in the Monastery on formating your post (chiefly re <c>...</c> tags around code and data.)
Please answer these questions by posting the code that generates the unsatisfactory output:
I -- for one -- am having a hard time crystal-balling code that would behave as you say. One standard bit of advice here is that those with questions post code that actually compiles under strict and warnings.
Note (just for starters) that @STATION_TYPE[$i] offends the warnings pragma (which we hope you are using along with use strict;) instigating the message: Scalar value @STATION_TYPE[$i] better written as $STATION_TYPE[$i]
Oh, yes: the standard way to find the last element in an array is to use the subscript -1 ("print $CALL_NAME[-1];") ... which, of course is not the element you actually want. But if you were to iterate backward from $CALL_NAME[-1] looking for the FIRST "25" you could save a lot of processing time.
|
|---|