perldoc perldata says for clearing arrays:
@array = ();
or...
$#array = -1;
> -Original Message-
> From: Leon [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 8:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Help with clearing an array
>
>
>
--- Leon <[EMAIL PROTECTED]> wrote:
> - Original Message -
> From: "John W. Krahn" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
>
> > @array = qw(1 2 3 4 5);
> > @array = ();
> > print scalar @array, ": @array";
> > 0:
> >
> > As you can see @array = ""; and @array = undef; don't clear t
- Original Message -
From: "John W. Krahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
> @array = qw(1 2 3 4 5);
> @array = ();
> print scalar @array, ": @array";
> 0:
>
> As you can see @array = ""; and @array = undef; don't clear the array.
This gives me an idea of assigning 0 for clea
Hee.. @my_arry = undef; will make the array carrying 1 element --> undef
it will not be a blank array =)
have a nice day
- Original Message -
From: "Leon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 7:54 AM
Subject: Re: He
Leon wrote:
>
> From: "Steve Maroney" <[EMAIL PROTECTED]>
> >
> > @my_arry = "";
>
> Can I use this :-
> @my_arry = undef;
$ perl -le'
@array = qw(1 2 3 4 5);
print scalar @array, ": @array";
@array = "";
print scalar @array, ": @array";
@array = qw(1 2 3 4 5);
@array = undef;
print scalar @ar
On Monday 14 January 2002 04:54 pm, you wrote:
> Can I use this :-
> @my_arry = undef;
No, because it doesn't clear the array. Read the following quote:
Small quote from "Learning Perl" page 53 - under the section "Using
Scalar-Producing Expressions in a List Context"
<>
Going this direction is
- Original Message -
From: "Steve Maroney" <[EMAIL PROTECTED]>
To: "Michael Eggleton" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, January 13, 2002 11:12 PM
Subject: Re: Help with clearing an array
>
> @my_arry = &quo
@my_arry = "";
On Mon, 14 Jan 2002, Michael Eggleton wrote:
> Hello all,
>
> Could some one help me with clearing or re-setting and array.
>
> I have an array that has an unknow number of elements in it, at one
> point in my program I would like to clear that array or reset it so
> that it
At 00:39 2002.01.14, Michael Eggleton wrote:
>Hello all,
>
> Could some one help me with clearing or re-setting and array.
>
> I have an array that has an unknow number of elements in it, at one
>point in my program I would like to clear that array or reset it so
>that it contains nothing. Ho