in reply to Using map

map processes a list and returns a list, so your need to assign the list back to your @data array (or a new array).

@data = map { #? data is skiped when plotted if($maxreject[$i]) { $_ = "?$_" if($_ > $maxclip); } if($minreject[$i]) { $_ = "?$_" if($_ < $minclip); } $i++; $_; ######### YOU ALSO NEED TO PASS THE VALUE THROUGH!! } @data;

That said, a for loop might be a better choice, but it should work.

Update: As I said that your loop could be done as a for, I thought I ought show what I mean. I don't fully understand your algorithm, but either of the following would be functionally equivalent to your inner loop and (I think) they are somwhat easier to understand. Your choice is yours of course.

# as a for loop for (@data} { $_ = '?'.$_ if $maxreject[$i] && $_ > $maxclip or $minreject[$i++] && $_ < $minclip }; # or as a map, but different. @data = map{ $maxreject[$i] && $_ > $maxclip or $minreject[$i++] && $_ < $minclip ? '?'.$_ : $_ } @data;

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