in reply to What would you do?

Update: I failed to understand the original, and thus even my emended version was stupid. So, I've gotten rid of my original, and kept only the annoying pedantry...

Of course, what I'd like most of all to see would be:

fill_even_members($fill_value, \@list); ## ## fill_even_members() ## ## Arguments: ## $fill_value: scalar The value we should fill in ## $list: array ref The list we're to fill ## ## Returns: void ## ## Fills even values of @$list with $fill_value. ## sub fill_even_members { ## Whichever you want }
Then you could use whatever code you wanted.

stephen

Replies are listed 'Best First'.
Re: Re: What would you do?
by stephen (Priest) on Mar 16, 2001 at 03:31 UTC
    Ah, stephen will in the future use the amazing technology of reading the question before answering it. My apologies.

    stephen

Re: Re: What would you do?
by merlyn (Sage) on Mar 16, 2001 at 03:20 UTC
Re: Re: What would you do?
by MeowChow (Vicar) on Mar 16, 2001 at 03:21 UTC
    This solution does not do quite the same thing. I would like to keep other elements in @list intact, instead of undefing them.
Re: Re: What would you do?
by buckaduck (Chaplain) on Mar 16, 2001 at 03:23 UTC
    That's fine as long as you don't mind the other elements being undef'ed. But if you're overwriting existing values, you could end up in big trouble...

    buckaduck