Re: array of anon. hashes sorting

2003-09-26 Thread Keith C. Ivey
Jay Ay <[EMAIL PROTECTED]> wrote: > for example, i create each hash like this and push it on to the > array. push(@senddata,{ 'sender' => $se, 'recip' => $re, > 'smtphost' => $svr, 'number' => $somenbr}); > > what i want to do is sort the array by 'number' key value, in > order greatest number to

array of anon. hashes sorting

2003-09-26 Thread Jay Ay
hi there i want to be able to sort an array of hashes. for example, i create each hash like this and push it on to the array. push(@senddata,{ 'sender' => $se, 'recip' => $re, 'smtphost' => $svr, 'number' => $somenbr}); what i want to do is sort the array by 'number' key value, in order greates

Re: Array question

2003-09-26 Thread Michael D. Smith
> This is perl, arrays start at zero, get used to it. Right :) And to perl you could add C, and it's offspring C++, and Fortran and COBOL and JAVA(Script) and... I didn't even know there was one that didn't. I know nothing of pascal but I believe:) pascal only offers the option of starting w

how to run a perl script in background on NT machine

2003-09-26 Thread Zhang, Lynne C [ITS]
Title: how to run a perl script in background on NT machine Hi,  I am new to Windows environment. How to run a scirpt in background on NT machine? Some thing like Unix  myperl.pl & Thanks, Lynne

Re: Joining Text Files

2003-09-26 Thread $Bill Luebkert
Charles, Chris wrote: > Hello all, > > This is a case of knowing sort of what to do but not knowing which > direction to head off in. Basically, here's what I would like to > ultimately do with Perl... > > I have a series of text files with specific names and the files are full > of numbers. So

RE: How to skip unwanted columns in CSV file?

2003-09-26 Thread Peter Eisengrein
Title: RE: How to skip unwanted columns in CSV file? Something like this, or is this not what you had in mind? #untested foreach my $line () {     my @cols = split(/\,/,$line);     my ($c3,$c12,$c20) = $cols[2,11,19];     &dosomething($c3,$c12,$c20); } -Pete P.S. Don't cross

RES: Joining Text Files

2003-09-26 Thread Fabricio Soares Martins - Site CBN - SGR
Title: Joining Text Files Hello Charles,   look this:   @files = ("file1.txt","file2.txt"); # how many as needed;   $i = ($#files + 2); # if you need the file+1.txt   open (file_out, ">file$i.txt");   foreach $file (@files) {   print file_out "$file\n\r";    open (file_in, "<$file") or di

RES: How to skip unwanted columns in CSV file?

2003-09-26 Thread Fabricio Soares Martins - Site CBN - SGR
Like this? $var = "1,2,3,4,5"; $second = (split ",", $var)[1]; $third = (split ",", $var)[2]; print "$second - $third"; (...) regards, fabricio. -Mensagem original- De: Noushad Dawood [mailto:[EMAIL PROTECTED] Enviada em: Friday, September 26, 2003 11:11 AM Para: [EMAIL PROTECTED]; [

Joining Text Files

2003-09-26 Thread Charles, Chris
Title: Joining Text Files Hello all, This is a case of knowing sort of what to do but not knowing which direction to head off in. Basically, here's what I would like to ultimately do with Perl... I have a series of text files with specific names and the files are full of numbers. So lets sa

Re: Array question

2003-09-26 Thread Michael D. Smith
The book says stay away from this, so I never messed with it (until now for this test) but... $[ = 1; will change the first element of the array to one. On my box it actually loads the first value read into both subscript zero and one, but accessing the array starting from one would get the wh

Re: AmphetaDesk and old Win32 Bugs - RFHelp

2003-09-26 Thread Lee Goddard
At 04:48 24/09/2003, Morbus Iff wrote: Hey all. I'm attempting to clear up two old Win32::GUI bugs reported long ago with my AmphetaDesk application [1]. Could someone take a look at the original bug report and my followups [2], and then my Win32 code [3]: http://cvs.sf.net/cgi-bin/viewcvs.cgi/amp

Re: Array question

2003-09-26 Thread Ken McNamara
Carl - 'Not hardly' .Take a second look at the code. Roughly - opendir @array = readdir push(@array2,'',@array) Now @array2 has just what he wants - a list of directories that starts in position 1. KenMc Carl Jolley wrote: > > On Thu, 25 Sep 2003, Ken McNamara wrote: > > > Use opendir,

Re: Array question

2003-09-26 Thread Carl Jolley
On Fri, 26 Sep 2003 [EMAIL PROTECTED] wrote: > > Hai, > > can any one tell how to pick up a particular pattern of files into that > array... > > Eg:- files with extension .pl or .cfg > @selected=grep{ /\.(?:pl|cfg)$/ } <*.*>; [EMAIL PROTECTED] All opinions are my own and not necessari

Re: To enhance read directory script

2003-09-26 Thread Koteswara_Rao
Hai dawood, Hope the following will help you $dir=; chop($dir); opendir(DIR,$dir) or die"cannot open $dir:$!"; @array=readdir(DIR); while($array[$i] ne ' ' ) { if($array[$i] =~ /.cfg/) { system("move file1 /file");

RE: Regular Expression problem?

2003-09-26 Thread Carl Jolley
On Fri, 26 Sep 2003, Xu, Qiang (XSSC SGP) wrote: > Ted S. wrote: > > Beckett Richard-qswi266 graced perl with these words of wisdom: > >> That should have been s/.*\/// > > > > Don't you have to escape the period, too? > > > > s/\.*\/// > > No, we shouldn't, because here "." stands for any single

Re: Array question

2003-09-26 Thread Carl Jolley
On Thu, 25 Sep 2003, Ken McNamara wrote: > Use opendir, readdir - if $array[0] is really a problem then do > push(@array2,'',@array) - which will leave a null entry in the > $array2{0] slot. > > > "Wong, Danny H." wrote: > > > > Hi all, > > I was wondering if I can start adding elements in

Re: Array question

2003-09-26 Thread Carl Jolley
On Thu, 25 Sep 2003, Wong, Danny H. wrote: > Hi all, > I was wondering if I can start adding elements into an array > starting at 1? Here is what I am trying to do. I'm trying to glob all > files/folders in a directory and assign it to an array, but it start at > subscript 0. I know I can do