Re: Date manipulation in Perl

2003-09-26 Thread Carl Jolley
On Wed, 24 Sep 2003, ashish srivastava wrote: Hi I have 2 queries each of which return date in the following format : dd=mon-yy:hh:mi The results are (say) final_time and start_time. I want to get the time difference between the 2 times(in days or hours). Any pointers in this regard would

splitting large strings into chunks, for sending through smtp

2003-09-26 Thread Jay Ay
hi there, i want to split a series of strings (messages) into junks for sending through SMTP. basically, i want to be able switch between each message( by sending it in parts,chunks) rotating through each sockets until all the chunks are sent. eg. send 500kb chunk of message one send 500kb

To enhance read directory script

2003-09-26 Thread Noushad Dawood
This simple code works fine to get all the file names from the folder specified. @dir_contents; $dir_to_open=c:\\mydir\\mysubdir; opendir(DIR,$dir_to_open) || die(Cannot open directory !\n); @dir_contents= readdir(DIR); closedir(DIR); Now I want to enhance the script to handle the following: 1.

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 a

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 into an array

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 character except

Re: To enhance read directory script

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

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] Carl Jolley All opinions are my own and not

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: 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]:

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

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: 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

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

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]; [EMAIL

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 die "Cannot

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 greatest

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 smallest

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 (FILE) { my @cols = split(/\,/,$line); my ($c3,$c12,$c20) = $cols[2,11,19]; dosomething($c3,$c12,$c20); } -Pete P.S. Don't cross-post groups, as

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 lets