RE: problem with variables

2001-04-18 Thread Brent Michalski
cc: [EMAIL PROTECTED] Subject: RE: problem with variables

Re: problem with variables

2001-04-17 Thread Sean O'Leary
At 10:59 AM 4/17/2001, you wrote: >i have this program: > >$sup1='a'; >$sup2='b'; >$sup3='c'; > >for ($i=1 ; $i<4 ;$i++){ > print $sup($i); >} > >but give error, why??? First off, you need to make an array. All you have are some scalars with similar names. You could use symbolic references

Re: problem with variables

2001-04-17 Thread James Fisher
Good point ... note to self ... don't try and help people while to busy to really focus on problem. I jumped down to the loop without looking at the code Tad McClellan wrote: > On Tue, Apr 17, 2001 at 02:01:14PM -0700, James Fisher wrote: > > > the array starts at 0 not 1 > ^ > > The

Re: problem with variables

2001-04-17 Thread Tad McClellan
On Tue, Apr 17, 2001 at 02:01:14PM -0700, James Fisher wrote: > the array starts at 0 not 1 ^ There is no array in the code given (but there probably should be). > you should realy look at foreach instead > > > Pacifico wrote: > > > i have this program: > > > > $sup1='a'; > > $su

Re: problem with variables

2001-04-17 Thread James Fisher
the array starts at 0 not 1 you should realy look at foreach instead Pacifico wrote: > i have this program: > > $sup1='a'; > $sup2='b'; > $sup3='c'; > > for ($i=1 ; $i<4 ;$i++){ > print $sup($i); > } > > but give error, why???

RE: problem with variables

2001-04-17 Thread blowther
, April 17, 2001 1:55 PM To: Pacifico Cc: [EMAIL PROTECTED] Subject: Re: problem with variables To add to the answer(s) already given... for ($i=1 ; $i<4 ;$i++){ print $sup($i); } is actually quite cumbersome, and very 'C'-ish... Let's make it more Perl-ish... for my $i

Re: problem with variables

2001-04-17 Thread Brent Michalski
To add to the answer(s) already given... for ($i=1 ; $i<4 ;$i++){ print $sup($i); } is actually quite cumbersome, and very 'C'-ish... Let's make it more Perl-ish... for my $i (1..4){ print $i; } There is not need to have to deal with incrementing and checking conditions in loops - Perl

Re: problem with variables

2001-04-17 Thread David M. Lloyd
On Tue, 17 Apr 2001, Pacifico wrote: > i have this program: > > $sup1='a'; > $sup2='b'; > $sup3='c'; > > for ($i=1 ; $i<4 ;$i++){ > print $sup($i); > } > > but give error, why??? Because, basically, you can't do that. To get the result you want, you have to do this instead: # Begin perl