Re: Emptying several arrays at once

2007-08-15 Thread Paul Lalli
On Aug 15, 11:03 am, [EMAIL PROTECTED] wrote: > Yes you know this is not a good idea.I don't like to say what,but someone > others maybe say, > DON'T SUGGEST THIS BAD IDEA! Hey, buddy, I didn't suggest it. But pointing out that it's a bad idea and saying "It doesn't work" are two different thin

Re: Emptying several arrays at once

2007-08-15 Thread JeffHua
In a message dated 2007-8-16 0:03:51 中国标准时间, [EMAIL PROTECTED] writes: Hey, please don't shout! YOU TMD SHOUT LIKE A DOG!ZAZHONG! ** Get a sneak peek of the all-new AOL at http://discover.aol.com/memed/aolcom30tour

Re: Emptying several arrays at once

2007-08-15 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: Paul Lalli wrote: On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: From: Andrew Curry <[EMAIL PROTECTED]> I think you could do something like @arrays=('test1','test2','test3'); foreach my $array(@arrays) { @{$array}=(); } This wouldn't work. Correction. Th

Re: Emptying several arrays at once

2007-08-15 Thread Chas Owens
On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > In a message dated 2007-8-15 22:08:56 中国标准时间, [EMAIL PROTECTED] writes: > > Not if you turn off strict like the poster suggested. Then symrefs > are allowed, and you can access the an array by pretending that a > string containing th

Re: Emptying several arrays at once

2007-08-15 Thread JeffHua
In a message dated 2007-8-15 22:08:56 中国标准时间, [EMAIL PROTECTED] writes: Not if you turn off strict like the poster suggested. Then symrefs are allowed, and you can access the an array by pretending that a string containing the name of the array is an array reference. This is not, however,

RE: Emptying several arrays at once

2007-08-15 Thread Andrew Curry
2007 15:08 To: beginners@perl.org Subject: Re: Emptying several arrays at once On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: > >From: Andrew Curry <[EMAIL PROTECTED]> > > >Whilst you can do by turning off strict and using an array of > >arraynames and looping o

Re: Emptying several arrays at once

2007-08-15 Thread Paul Lalli
On Aug 14, 10:17 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: > >From: Andrew Curry <[EMAIL PROTECTED]> > > >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 > > >@arra

RE: Emptying several arrays at once

2007-08-14 Thread Jeff Pang
-Original Message- >From: Andrew Curry <[EMAIL PROTECTED]> >Sent: Aug 15, 2007 4:59 AM >To: DJ Gruby <[EMAIL PROTECTED]>, Perl Beginners Mailing List > >Subject: RE: Emptying several arrays at once > >Whilst you can do by turning off strict and using an

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Chas Owens wrote: > > On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: > >> 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 a

Re: Emptying several arrays at once

2007-08-14 Thread Mr. Shawn H. Corey
Chas Owens wrote: On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: 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

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > for my $type (keys %addr) { > @$_ for keys %$type; > } snip Whoops, typo there, this should be for my $type (keys %addr) { @$_ = () for keys %$type; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: > 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_ad

Re: Emptying several arrays at once

2007-08-14 Thread DJ Gruby
Hello! And thanks for your answer... Andrew Curry wrote: 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. Well, I wouldn't rather go for turning off strict. I'm too much used to be strict with my progr

RE: Emptying several arrays at once

2007-08-14 Thread Andrew Curry
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 Messa