Greets, all. This is my first post here... I'm a seasoned C/C++ programmer,
and recently started learning perl... it's going along well, and as an
exercise, I've completely Perl'ed my webpage. I'm still a little dizzy
because of the different directions it's pulling me towards, but it's fun
anyway. Chaos always is :-)

Anyway... the question:
I need to know if there is a library function in perl to remove an element
in an arbitrary position in an array.

I have:

@a = ( 1, 2, 3 );

I want it to become:

@a = ( 1, 3 );

Is there any shortcut for this in perl?

#ifdef INQUISITIVE_CHAR

I'm keeping an array of tips (read from a file) in memory. At strategic (at
least I think so) locations in the file, a random tip is displayed. Once it
is, it has to be marked as used. Currently, I'm doing this:

            # Tip is done; remove it
            $tips[$tip_num] = $tips[$num_tips - 1];
            undef $tips[$num_tips - 1];
            --$num_tips;

Am I doing it cleanly?
Should I use $#tips instead of a separate count variable (as I've done), and
will decrementing $#tips actually reduce the size of the array in memory?

#endif // INQUISITIVE_CHAR
________________________________________

Abhijit Shylanath
http://mudeth.tripod.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to