Sorting an array by one of it's fields.

2001-06-16 Thread Tirthankar C.P
Folks, # How do I sort an array by one of it's fields? I have a this code: for ($i=1; $i<=$N; $i++) { } $dummy[$i][0] = &ParseDate($data{$key}[$i][0]); if (! $dummy[$i][0]) { } warn "Could not parse $data{$key}[$i][0]\n"; } $dummy[$i][1] = $da

Re: Sorting an array by one of it's fields.

2001-06-16 Thread Tirthankar C.P
Thnaks a lot Jos. The idea of reading the array into a hash is quite appealing, and simple too. But I have a small problem with this: What if I want to sort on the second column of the array? Or if there are more than two columns? Say we have: my @arr = qw( 1 2 3 4 4 5 6 7 5 6 7 8 1 2 3 4 3

Re: Sorting an array by one of it's fields.

2001-06-18 Thread Tirthankar C.P
Thanks a million to Jos Boumans, and Me (whoever that is). Me, thanks for the explanation, and Jos, for your patient and detailed answer. -tir On Sat, 16 Jun 2001, Me wrote: > > This should've worked. But why do I get a warning: > > > > Use of uninitialized value at ./mk2_ratingchangedb.p

Re: Hi, my first question is about binary data

2001-06-18 Thread Tirthankar C.P
> Hey folks, > > Please don't scold me if I am asking a very stupid > question. =) > > I am now handling some sort of text files, > however, they are eating me a lot of harddisk. > > I tried to using PACK, however, I found that I cannot > unpack it if I pack the file with "B" or "H"... > >

Loading extra modules.

2001-05-09 Thread Tirthankar C.P
Folks, how do I load extra modules? I got Date::Manip today, and I know I should be putting it in the search-path of perl (@INC ?), but how do I do it? Can I get a small code snippet? I do not have su privileges on the machine I work, and would like the search-path to have my modules dir, $HOM

Re: Loading extra modules.

2001-05-09 Thread Tirthankar C.P
> > Be careful -- you can't just move modules into a directory and expect them > to work, since some depend on loading native code shared libraries. Brett was right. I tried installing it, but wasn't successful. I then got the Sys Admin folks to install it, and it went just fine!! Apparently

Breaking up a file.

2001-05-10 Thread Tirthankar C.P
Folks, I have a file like this: Asea Brown Boveri Ltd. 02-Aug-1999 | 02-Aug-1999 | 399.05 03-Aug-1999 | 03-Aug-1999 | 395.00 04-Aug-1999 | 04-Aug-1999 | 426.5 06-Aug-1999 | 06-Aug-1999 | 406.00 31-Jul-2000 | 31-Jul-2000 | 203.00 01-Aug-2000 | 01-Aug-2000 | 203.65 | Overa

Re: Breaking up a file.

2001-05-10 Thread Tirthankar C.P
Many thanks to Paul. His solution works. -tir On Thu, 10 May 2001, Paul wrote: > > --- "Tirthankar C.P" <[EMAIL PROTECTED]> wrote: > > > > Folks, I have a file like this: > > > > Asea Brown Boveri Ltd. > > 02-Aug-1999 | 02-Aug-1999

Simple Matrix Question

2001-05-16 Thread Tirthankar C.P
What is the simplest way to read in a matrix, say 19911231 12200 4274 19921231 12205 7822 19931231 3313 8208 19941231 2362 12292 19951231 4348 11673 19961231 11751 14255 19971231 6318 12339 19981231 14901 11530 19991231 373 17353 in perl? I just know that the matrix has to have three