To enhance read directory script

2003-09-25 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:

splitting large strings into chunks, for sending through smtp

2003-09-25 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 chun

Re: Date manipulation in Perl

2003-09-25 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

Re: Array question

2003-09-25 Thread $Bill Luebkert
[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 grep or a RegEx in a readdir loop. -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// //

RE: Array question

2003-09-25 Thread Molumuri, Janardhan
@files = glob("*.cfg") would do. Thanks, -> janardhan. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 10:03 AM To: [EMAIL PROTECTED] Cc: Wong, Danny H.; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Array question Hai, can an

Re: Array question

2003-09-25 Thread Koteswara_Rao
Hai, can any one tell how to pick up a particular pattern of files into that array... Eg:- files with extension .pl or .cfg Thanks in advance Eswar

Re: Array question

2003-09-25 Thread Sisyphus
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 loop and start the subscrip

Re: echo %CD%

2003-09-25 Thread Sisyphus
YANDEX wrote: Can you explain me, why it is better to use module instead of launch ('forking'=clone/double (?), not launch ) a system process?? There's some "overhead" involved in running a system command that is often avoidable if you stick to perl. (There's also some overhead involved in loadi

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
Glenn Linderman wrote: > Any delimiter can be used (other posters were correct about that). > The delimiter used affects which delimiter character would need to be > escaped in the regular expression. Generally, if something other > than / is used as the delimiter character, it is chosen because

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
Strohmeier Ruediger wrote: > Hi Xu Qiang, > > unlike e.g. awk, vi or the shell, perl support different delimiter > for regexes. When a slash is part of the regex or the substitution > pattern, they can either be escaped (i.e. \/) or other characters can > be used as delimiters. > > Thus the reg

RE: Regular Expression problem?

2003-09-25 Thread Xu, Qiang (XSSC SGP)
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 a new line. thx, Regards, Xu Qiang __

Re: Array question

2003-09-25 Thread Glenn Linderman
On approximately 9/25/2003 5:18 PM, came the following characters from the keyboard of Wong, Danny H.: 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

Re: Regular Expression problem?

2003-09-25 Thread Glenn Linderman
On approximately 9/25/2003 6:45 AM, came the following characters from the keyboard of Xu, Qiang (XSSC SGP): Hi, all: I have a regular expression that I can't understand. Suppose $filename is a file name that includes the full path. Say, it is "/u/scan/abc.jpg", The regular expression is: $fil

echo %CD%

2003-09-25 Thread YANDEX
Hello , > Cwd is a standard module, so it comes w/ any perl distribution. You just > need to 'use' it, it should be already installed. Probably better than > 'forking' a system process. > Andy Bach, Sys. Mangler I pack my script with perl2exe. I had previous many modules and my exe had size 3

Re[2]: echo %CD%

2003-09-25 Thread YANDEX
Hello , > print `cd`; > > (those are back tics, not quotes) works. "cd" by itself, in winx returns > the current dir. Waw! it works! Thank you. WDSPAW> If indeed the env. vrbl CD is set, try: WDSPAW> print $ENV{CD}, "\n"; WDSPAW> It's not set on my XP Doze. on my too :-( ---

Re: echo %CD%

2003-09-25 Thread Andy_Bach
print `cd`; (those are back tics, not quotes) works. "cd" by itself, in winx returns the current dir. a Andy Bach, Sys. Mangler Internet: [EMAIL PROTECTED] VOICE: (608) 261-5738 FAX 264-5030 "We are either doing something, or we are not. 'Talking about' is a subset of 'not'."--