Whilst you can do by turning off strict and using an array of arraynames and
looping over them, its clear concise the way you are doing it.

I think you could do something like 

@arrays=('test1','test2','test3');

foreach my $array(@arrays) {
@{$array}=();
}

But not tested.
 

-----Original Message-----
From: DJ Gruby [mailto:[EMAIL PROTECTED] 
Sent: 14 August 2007 21:48
To: Perl Beginners Mailing List
Subject: Emptying several arrays at once

Hello there!

Have question if that is possible to empty a few arrays with one simple
command?

For the moment I clear these six tables by assigning them an empty list:

   @bitmap_addr_lo = ();
   @bitmap_addr_hi = ();
   @screen_addr_lo = ();
   @screen_addr_hi = ();
   @colors_addr_lo = ();
   @colors_addr_hi = ();

Just wondering if there is a more elegant way to achieve the same result?

Many thanks in advance for your help!

Regards,
DJ Gruby.

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/



This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to