in reply to Re: Using map
in thread Using map

Thanks for the quick response! However, assigning @array = map {} @data produces the following in my data:
07/01 09:09:57 0 1 2 3 4 5 07/01 09:14:56 0 1 2 3 4 5 07/01 09:19:58 0 1 2 3 4 5 07/01 09:24:58 0 1 2 3 4 5 07/01 09:29:58 0 1 2 3 4 5 07/01 09:34:58 0 1 2 3 4 5
Hmm.

Replies are listed 'Best First'.
Re: Re: Re: Using map
by BrowserUk (Patriarch) on Oct 22, 2002 at 06:29 UTC

    Sorry! Take another look, I've updated the previous answer.

    With map, the value that gets passed out it the last value in the code block. In your case it was the $i++ expression, hence the counts you got. Add the new last line I indicate above and it should fix that. I didn't notice that the first time.

    I still think this is an iffy use of map though.


    Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!