[message rearranged chronologically - please don't top-post]

Luke wrote:
> 
> From: "John W. Krahn" <[EMAIL PROTECTED]>
> 
> > Barry Kingsbury wrote:
> > >
> > > I have an array that I wish to reuse. Before I reuse it, I want to clear
> out all
> > > elements. Both of the following seem to work:
> > >
> > >     @an_array = "";
> >
> > This does not clear out all elements, it assigns one element to
> > @an_array with the value of "".
> >
> >
> > > and
> > >
> > >     $#an_array = -1;
> >
> > This is one way to do it properly, another way is:
> >
> >      @an_array = ();
> >
> > This assigns an empty list to @an_array.
> 
> you can always set it to undef also:
> 
> @an_array=undef;

This does not clear out all elements, it assigns one element to
@an_array with the value of undef.


John
-- 
use Perl;
program
fulfillment

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

Reply via email to