Re: variable in perl

2008-10-16 Thread Jean-Rene David
* Telemachus [2008.10.15 12:35]: > In Debian (and so probably many of its > children), perl-doc is a distinct package and > not installed automatically when you install the > perl package. > > Stupid, but true. Well, not to drift off-topic but it is my understanding that it is general Debian poli

Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
Hi, A little problem I encountered recently. I have an array of integers and two indexes within that array. I need to get another array identical to the first one, except that all cells between the two indexes (inclusive) must be compressed to one column which is the sum of the originals cells.

Re: Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
* Paul Lalli [2008.06.19 13:52]: > On Jun 19, 11:41 am, [EMAIL PROTECTED] (Jean-Rene David) wrote: > > I have an array of integers and two indexes within > > that array. I need to get another array identical > > to the first one, except that all cells between > > the t

Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
Hi, A little problem I encountered recently. I have an array of integers and two indexes within that array. I need to get another array identical to the first one, except that all cells between the two indexes (inclusive) must be compressed to one column which is the sum of the originals cells.

Re: Looping through lines stored in a scalar

2008-01-03 Thread Jean-Rene David
* Paul Johnson [2008.01.01 22:10]: > The most direct analogy would be to use an > in-memory file: > > open my $fh, "<", \$scalar; > print while <$fh>; Very nice. Thanks. I didn't understand what John and Chas were trying to say until I saw the term "in-memory file". Exactly the kind of stuff I

Looping through lines stored in a scalar

2008-01-01 Thread Jean-Rene David
Hi, I wonder what idioms are available to loop through the lines stored in a scalar variable. I guess I'm looking for something analogous to these idioms for files and arrays respectively: while() { # do stuff } foreach (@array) { # do stuff } When I had to do this I split the scalar in an arra

Re: Beginning to use the stricts and warnings

2007-04-09 Thread Jean-Rene David
* Chas Owens [2007.04.09 11:00]: > > for (my $i = 0; $i < @banks; $i++) > > If you must loop this way at least do it like this: > > for my $i (0 .. $#banks) {} > > But most likely you don't need to loop that way and it is better to > loop this way: > > for my $bank (@banks) {} I've been

Re: Perl versus other scripting language

2007-03-30 Thread Jean-Rene David
* Rob Dixon [2007.03.30 08:30]: > - You could add Lua to the list. But then remove > it - it's awful. FYI, I have read much harsher comments about perl on the lua mailing list. I ignored them at the time and will do the same here, though I wouldn't mind hearing more substantive criticisms. That i