Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: What would you do?

by stephen (Priest)
on Mar 16, 2001 at 03:18 UTC ( [id://64833]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://64833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found