in reply to How do I reset an array?

you don't actually need to reset the array... if you are using split it will do it all by itself:

@array = split(/-/); # will create the new array @array # later on... @array = split(/-/); # will empty the array and create a new array @ar +ray with the new values

don't write code that doesn't do anything...

Update: did you say "substituting spaces..." and "using an array and split" ??? are you sure you're using the right(s///) command ???


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Replies are listed 'Best First'.
Too Brief?
by Mission (Hermit) on Apr 10, 2001 at 23:35 UTC
    Chady, I like your signature file... I feel like the five minute fool for asking such a basic question. To answer your question, yes I am using the s/// command. The file I'm trying to write has some bizarre formatting for another application. It has it's own special line counting and EOL characters, so I was splitting to rebuild the character count per line and line count per story for multiple stories. I apologize for being too brief in my initial question, and thanks for the array help... I'm very new to all of this (as you can tell.)

    - Mission

    "Heck I don't know how to do it either, but do you think that's going to stop me?!!"