Re: a Bug in PERL

2002-12-03 Thread Jenda Krynicky
From: Paul Johnson <[EMAIL PROTECTED]> > On Tue, Dec 03, 2002 at 04:40:37PM +0100, Jenda Krynicky wrote: > > [ Rearranging slightly to get your summary first ] > > > The documentation says you should not do it. Not because it would be > > that hard to say what happens (once you understand what di

Re: a Bug in PERL

2002-12-03 Thread Paul Johnson
On Tue, Dec 03, 2002 at 04:40:37PM +0100, Jenda Krynicky wrote: [ Rearranging slightly to get your summary first ] > The documentation says you should not do it. Not because it would be > that hard to say what happens (once you understand what did I say > above), but because it would be easy to

Re: a Bug in PERL

2002-12-03 Thread david
Pradeep Goel wrote: > $ in NO case a language changes its behaviour for an array with 1 > element > & the same code with array of 2 or more elements ( what the PERL is doing > here ) > it does pops out if last element also happens to be the only element of > array. >> You are correct tha

Re: a Bug in PERL

2002-12-03 Thread Jenda Krynicky
> > PRADEEP GOEL said: > > > If i am not wrong somewhere , there is a bug come to my notice , > > > in PERL > > > > > > @lastnotpop = > > > ("where_gone_me","remaining_is_alright","no_fear_now"); foreach > > > $faltu (@lastnotpop) #$faltu is extra doesn't makes difference > > > even if removed { $

Re: a Bug in PERL

2002-12-03 Thread Jenda Krynicky
From: "PRADEEP GOEL" <[EMAIL PROTECTED]> > $ in NO case a language changes its behaviour for an array > with 1 element & the same code with array of 2 or more elements ( what > the PERL is doing here ) it does pops out if last element also happens > to be the only element of array. Differ

Re: a Bug in PERL

2002-12-03 Thread wiggins
> > > I am really sorry if I am appearing offensive , > I never meant to be . Nope just curious I take it... > In perlsyn documen it does says " Don't do that " else it will get " > confused" > & quite below it says a C programmer does this - while same can be written > in perl as this > ( a

Re: a Bug in PERL

2002-12-03 Thread Rob Dixon
- Original Message - From: "PRADEEP GOEL" <[EMAIL PROTECTED]> To: "Paul Johnson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 12:57 PM Subject: Re: a Bug in PERL > > > > Patient: Doctor, it hurts when

Re: a Bug in PERL

2002-12-03 Thread PRADEEP GOEL
- Original Message - From: "PRADEEP GOEL" <[EMAIL PROTECTED]> To: "Paul Johnson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 6:27 PM Subject: Re: a Bug in PERL > > - Original Message - > From: &

Re: a Bug in PERL

2002-12-03 Thread Paul Johnson
PRADEEP GOEL said: >> > & also that any programming language must follow some sure >> mathematical >> > rules & should not get confused . >> >> The rule is "don't do that". Most languages have rules like that for >> various situations. In C, for example, a statement such as i = i++ is >> unede

Re: a Bug in PERL

2002-12-03 Thread PRADEEP GOEL
- Original Message - From: "Paul Johnson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 5:13 PM Subject: Re: a Bug in PERL > > PRADEEP GOEL said: > > > > - Original Message --

Re: a Bug in PERL

2002-12-03 Thread Paul Johnson
PRADEEP GOEL said: > > - Original Message - > From: "Paul Johnson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, December 02, 2002 5:01 PM > Subject: Re: a Bug in PERL > > >> >> P

Re: a Bug in PERL

2002-12-02 Thread PRADEEP GOEL
- Original Message - From: "Christopher D.Lewis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, December 02, 2002 8:34 PM Subject: Re: a Bug in PERL > Perhaps what the user intends is a WHILE loop. > > while (@las

Re: a Bug in PERL

2002-12-02 Thread PRADEEP GOEL
- Original Message - From: "Paul Johnson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, December 02, 2002 5:01 PM Subject: Re: a Bug in PERL > > PRADEEP GOEL said: > > If i am not wrong somewhere , th

Re: a Bug in PERL

2002-12-02 Thread Christopher D . Lewis
Perhaps what the user intends is a WHILE loop. while (@lastnotpop) { $current_element = pop(@lastnotpop); print "Just Popped $current_element\n"; } This does what you want via pop. For a while loop, leave the array as it is, and just iterate through it. Enjoy, Chris On Monday, December 2, 200

Re: a Bug in PERL

2002-12-02 Thread Paul Johnson
PRADEEP GOEL said: > If i am not wrong somewhere , there is a bug come to my notice , in PERL > > @lastnotpop = ("where_gone_me","remaining_is_alright","no_fear_now"); > foreach $faltu (@lastnotpop) #$faltu is extra doesn't makes difference > even if removed > { $pch = pop(@lastnotpop ); > print