Re: regexp

2003-08-26 Thread Janek Schleicher
Anton Arhipov wrote at Tue, 26 Aug 2003 13:02:00 +0300: > i've a string like "BLAH" (guotes included). > i need to control if the BLAH is in uppercase and then if it is in > uppercase truncate the quotes ("), so "BLAH" becomes BLAH. s/"([A-Z]+)"/$1/g; or on a POSIX operating system I would pref

Re: Process Timestamp?

2003-08-26 Thread david
Jeremy Jones wrote: > Hello World! > > I'm looking for a way to check a Processes age (how long it's been > running). Is there a way to do this without installing extra modules? > I know ps-ef does it, I was hoping for elegance over the hammer & > chisel... > one way of doing that is to interfa

Re: Do i run a script with do{} or make it a module? Opinions.

2003-08-26 Thread Rob Dixon
Jenda wrote: > > From: zanardi2k3 <[EMAIL PROTECTED]> > > That poses the problem of executing my script for several folders, > > with different parameters for each of them. Now i'm wondering if i > > have to include the possibility of multiple "backups" in the script > > itself, if i better write a

Parsing mbox file

2003-08-26 Thread K Old
Hello everyone, I am using SpamAssassin to determine what is SPAM, and what isn't on my server. Everything works great and two files are written/appended based on if the mail is spam - almost-certainly-spam and probably-spam. Given that the majority of the mail that makes it in these files is sp

Re: nested parenthesis in regex and launching a new process

2003-08-26 Thread harrisb
>> 2. How do I set off a new process, not waiting or caring about any >> return values? >> >> $myApp = "/proj/mycoolexecutable"; >> $myOptions = "-f -n2 file1 file2"; >> # execute $myApp." ".$myOptions here, and do not wait for any return >> values > > See: > perldoc -f fork > perldoc -f exec

Outputting the status while the processes are running

2003-08-26 Thread T.S.Ravi Shankar
Hi all : I need to run a process for thousands of (known number) of combinations of the settings needed for the process to run. I have the settings in different arrays & I am running the process as shown below : I would like to see the status after every 50 runs in a separate file. But the fol

Re: Length() is bits/bytes or neither

2003-08-26 Thread zsdc
Hanson, Rob wrote: length() returns the length in characters, which for ASCII is also the number of bytes. To get the bits, just multiply by 8. If you are using a Unicode character set instead, I'm not too sure what will be returned, or how you can convert it to bits. #!/usr/bin/perl -wl use

Re: nested parenthesis in regex and launching a new process

2003-08-26 Thread zsdc
Bryan Harris wrote: ... which seems to work (correctly returns file_3.1.1), but I'm not sure how the nested parenthesis are supposed to be referenced. How would I get what was matched by the inner set? Is this the best way to do this? Everything is captured in $1, $2, $3... in the order of openi

Re: MailSender Quotes Problem

2003-08-26 Thread Jenda Krynicky
To: Pablo Fischer <[EMAIL PROTECTED]> > On Mon, 25 Aug 2003 23:51:47 +, Pablo Fischer wrote: > > my $sender = new Mail::Sender ({ > > smtp => "$this->{SERVER_IP}", > > from => "pablin <[EMAIL PROTECTED]>", > > to => "$nombre <$correo>", > >

Re: Do i run a script with do{} or make it a module? Opinions.

2003-08-26 Thread Jenda Krynicky
From: zanardi2k3 <[EMAIL PROTECTED]> > That poses the problem of executing my script for several folders, > with different parameters for each of them. Now i'm wondering if i > have to include the possibility of multiple "backups" in the script > itself, if i better write another script that calls

Re: Changing case of the first letter of words in string

2003-08-26 Thread zsdc
bis wrote: #!/usr/bin/perl -p s/(\s)(.)/$1\u$2/g if/SCTN:/; This capitalises the first letter of every word in the whole document. No, it doesn't. Only the lines containing "SCTN:" Have you run it? yes i have run it and below is the kind of output i get (original input all lower case except cap

RE: Length() is bits/bytes or neither

2003-08-26 Thread Dan Muey
Yeah I did a test where I put the data I was using in length() into afile then did du-sh on the file. Where length() gave me 1048576 the du -sh on the file said 1.0 MB So length() returns bytes and so length() * 8 is the bits and length() / 1024 is the Kilobytes I believe. Thanks for the repli

Re: redirecting the output of a command to a file

2003-08-26 Thread John W. Krahn
Ivan Novick wrote: > > Hi, Hello, > does anyone know syntax to run a command and redirect its output directly to > a file? > > Equivalent to myCommand > myFile in shell open my $pipe, 'myCommand |' or die "Cannot open pipe from myCommand: $!"; open my $fh, '>', 'myFile' or die "Cannot open myF

Re: Length() is bits/bytes or neither

2003-08-26 Thread James Edward Gray II
On Tuesday, August 26, 2003, at 10:29 AM, Dan Muey wrote: I know that the number returned by the length function is the number of characters. With ascii text is that the bits or bytes also? Can't fit a character in a 1 or a 0, so I think we can safely rule out it being the bits. I would assume

RE: Length() is bits/bytes or neither

2003-08-26 Thread Hanson, Rob
length() returns the length in characters, which for ASCII is also the number of bytes. To get the bits, just multiply by 8. If you are using a Unicode character set instead, I'm not too sure what will be returned, or how you can convert it to bits. Rob -Original Message- From: Dan Muey

RE: pronunciation guide

2003-08-26 Thread McMahon, Christopher x66156
On a Tandem, all processes begin with "$". As in: "$WRITER is writing to the file; $BILL is the process that monitors the bank balance". You'll definitely confuse Tandem people if you call the dollar sign "string". -Chris -Original Message- From: George

Length() is bits/bytes or neither

2003-08-26 Thread Dan Muey
I know that the number returned by the length function is the number of characters. With ascii text is that the bits or bytes also? If not is there a function similar to length() that tells you the bits or bytes of a string or a way to figure that with the return value of length? TIA Dan -- To

RE: Full path to the perl intrepter

2003-08-26 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I'm in a very old project and my scripts are calling other scripts. I > have 3 or 4 different perl version in the server. I need to call the > sub-scripts with the some version of perl that I'm using in the > caller script. > > How to find the full path to the perl inte

Re: Full path to the perl intrepter

2003-08-26 Thread Tassilo von Parseval
On Tue, Aug 26, 2003 at 04:12:59PM +0200 [EMAIL PROTECTED] wrote: > I'm in a very old project and my scripts are calling other scripts. I have 3 > or 4 different perl version in the server. I need to call the sub-scripts > with the some version of perl that I'm using in the caller script. > > How

RE: Full path to the perl interpreter

2003-08-26 Thread Marcos . Rebelo
the script are being called like /usr/local/bin/perl5.8.0/bin/perl -w /proj/xpto.pl I need the "/usr/local/bin/perl5.8.0/bin/perl" The usual path is for a older version in this case. The perl path is in a database that I don't see and I don't want to pass the perl path to the script. That will

RE: Full path to the perl intrepter

2003-08-26 Thread Paul Kraus
If its in a UNIX env then just look at the she bang line :) #!/usr/bin/perl Then you could go to usr bin and see where perl is linked to. If you have scripts that have a different line then just use perl to search and replace with the correct line. Paul -Original Message- From: [EMAIL

Full path to the perl intrepter

2003-08-26 Thread Marcos . Rebelo
I'm in a very old project and my scripts are calling other scripts. I have 3 or 4 different perl version in the server. I need to call the sub-scripts with the some version of perl that I'm using in the caller script. How to find the full path to the perl interpter that is being used? Thanks MArc

Re: MailSender Quotes Problem

2003-08-26 Thread Pablo Fischer
I think it was the hour and time.. Cause now im checking what does $this->{SERVER_IP} contains and it contains an ip 192.168.1.43 and I dont have that computer (just from .1 to .4) and thats why I was hanging up :-( Sorry and thanks! Pablo El día Monday 25 August 2003 11:51 a Pablo Fischer mand

RE: Perl Codes Written in Windows Env

2003-08-26 Thread Dan Muey
> I restored my windows 2000 advanced server, active perl 5.6 > and apache 1.3. After restorating, my post-news script are > working but the view_news script is not working. When i > execute the htm page (on which the view_news script is > suppose to display the news headings) in the browser, t

Re: redirecting the output of a command to a file

2003-08-26 Thread Rob Dixon
Marcos Rebelo wrote: > > What is your real problem? > Exactly. Using Perl as an agent to simply run a program and record its output is misuse. Just use a shell script. What are you trying to do? /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: Do i run a script with do{} or make it a module? Opinions.

2003-08-26 Thread Rob Dixon
Zanardi2k3 wrote: > > Hello, not a technical problem, i'm just looking for opinions. > > Using "Archive::Zip", i made a script with the main purpose of making a > quick backup of a folder and all its subfolders in a zip file. > > The script can take a few parameters: > - the main folder backup (man

Re: filling an array

2003-08-26 Thread Rob Dixon
Marcos Rebelo wrote: > try > > @temparry = `"$lcf_tools\\pslist EXCEL"`; > foreach $temp (@temparray){ > next if $temp !~ /EXCEL/; > ($name,$pid,$pri,$thd,$hnd,$Mem,$usertime,$kerneltime,$elapsedtime) = > split(" ",$temp); > ... > } Better would be next if $temp !~ /^EXCEL/; which is 'doesn

RE: redirecting the output of a command to a file

2003-08-26 Thread Marcos . Rebelo
What is your real problem? open(IN, "myCommand |"); open(OUT, ">$outputFileName"); print OUT join("", ); close OUT; close IN; -Original Message- From: Ivan Novick [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 1:47 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE:

RE: redirecting the output of a command to a file

2003-08-26 Thread Ivan Novick
Is there no other way some perl syntax to redirect to a file the output of a command? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 7:14 AM To: Ivan Novick; [EMAIL PROTECTED] Subject: RE: redirecting the output of a command to a file

Re: regexp

2003-08-26 Thread Ramprasad A Padmanabhan
Anton Arhipov wrote: Hi, i've a string like "BLAH" (guotes included). i need to control if the BLAH is in uppercase and then if it is in uppercase truncate the quotes ("), so "BLAH" becomes BLAH. any solutions? Thx You mean If you find any upper case word within quotes remove quotes right ?

RE: redirecting the output of a command to a file

2003-08-26 Thread Marcos . Rebelo
system("myCommand > myFile"); must work -Original Message- From: Ivan Novick [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 1:11 PM To: [EMAIL PROTECTED] Subject: redirecting the output of a command to a file Hi, does anyone know syntax to run a command and redirect its output

redirecting the output of a command to a file

2003-08-26 Thread Ivan Novick
Hi, does anyone know syntax to run a command and redirect its output directly to a file? Equivalent to myCommand > myFile in shell Thanks, Ivan

Re: beginner trying to parse a piece of mail

2003-08-26 Thread Tassilo von Parseval
On Mon, Aug 25, 2003 at 05:19:14PM -0700 nntp.perl.org wrote: > I have had success now using Mail::MboxParser for all my basic mail parsing > needs, like getting subject, from, to. Now bossman wants me to do more > extensive regex filtering and grabbing weird data in the email body. > > I wrote

Re: filling an array

2003-08-26 Thread Rob Dixon
Zsdc wrote: > > Anthony J Segelhorst wrote: > > > I am working on script to kill a process if it have been running for 45 > > minutes or more. > > > > I am using a pstool called pslist to gather the data on the process. This > > out put looks like: > > (...) > > > > I started to build my array by

regexp

2003-08-26 Thread Anton Arhipov
Hi, i've a string like "BLAH" (guotes included). i need to control if the BLAH is in uppercase and then if it is in uppercase truncate the quotes ("), so "BLAH" becomes BLAH. any solutions? Thx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Do i run a script with do{} or make it a module? Opinions.

2003-08-26 Thread zanardi2k3
Hello, not a technical problem, i'm just looking for opinions. Using "Archive::Zip", i made a script with the main purpose of making a quick backup of a folder and all its subfolders in a zip file. The script can take a few parameters: - the main folder backup (mandatory); - the full path of the

Re: filling an array

2003-08-26 Thread Rob Dixon
"Anthony J Segelhorst" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am working on script to kill a process if it have been running for 45 > minutes or more. > > I am using a pstool called pslist to gather the data on the process. This > out put looks like: > > C:\Tivoli\lcf\bin

Re: beginner trying to parse a piece of mail

2003-08-26 Thread Ramprasad A Padmanabhan
Nntp.Perl.Org wrote: I have had success now using Mail::MboxParser for all my basic mail parsing needs, like getting subject, from, to. Now bossman wants me to do more extensive regex filtering and grabbing weird data in the email body. I wrote a little test script, shown below. I am able to get

Re: filling an array

2003-08-26 Thread zsdc
Anthony J Segelhorst wrote: I am working on script to kill a process if it have been running for 45 minutes or more. I am using a pstool called pslist to gather the data on the process. This out put looks like: (...) I started to build my array by doing: @temparry = `"$lcf_tools\\pslist EXCE

RE: filling an array

2003-08-26 Thread Marcos . Rebelo
try @temparry = `"$lcf_tools\\pslist EXCEL"`; foreach $temp (@temparray){ next if $temp !~ /EXCEL/; ($name,$pid,$pri,$thd,$hnd,$Mem,$usertime,$kerneltime,$elapsedtime) = split(" ",$temp); ... } for avoiding errors, use 'strict' module at beggining of the script do use strict and define all

beginner trying to parse a piece of mail

2003-08-26 Thread nntp.perl.org
I have had success now using Mail::MboxParser for all my basic mail parsing needs, like getting subject, from, to. Now bossman wants me to do more extensive regex filtering and grabbing weird data in the email body. I wrote a little test script, shown below. I am able to get the "appointment dat

Re: Perl Codes Written in Windows Env

2003-08-26 Thread zsdc
Chuck Fox wrote: BTW, there is a nifty little program called dos2unix (not sure if this is standard for all (*nix)), that removes extraneous carriage returns from files. To remove every CR, use: perl -pe 's/\r//' or even just tr: tr -d '\r' -zsdc. -- To unsubscribe, e-mail: [EMAIL PRO

Re: Changing case of the first letter of words in string

2003-08-26 Thread bis
--- zsdc <[EMAIL PROTECTED]> wrote: > *Please* CC the mailing list when you answer. I'm > writing it so everyone > on the list could learn something, not just to fix > your program or solve > your particular problem. > thanks for the reminder zsdc - i should have remembered to cc the list when

Re: Form Paragraph

2003-08-26 Thread Ramprasad A Padmanabhan
Ryan K Whippo wrote: I have a form paragraph that once it has more than 1975 characters in it, the submit button on the form will not work. Any ideas? Thank you in advance, Ryan Whippo Not a perl question. Do it with Javascript. If you do it after the form is submitted It will irritate the user

Re: Perl Codes Written in Windows Env

2003-08-26 Thread SiyandaK
I restored my windows 2000 advanced server, active perl 5.6 and apache 1.3. After restorating, my post-news script are working but the view_news script is not working. When i execute the htm page (on which the view_news script is suppose to display the news headings) in the browser, the page is bla

Re: MailSender Quotes Problem

2003-08-26 Thread Janek Schleicher
Pablo Fischer wrote at Mon, 25 Aug 2003 23:51:47 +: > I was in a final test of my script and well it fails :-), however I found that > it fails in the form that Im creating the 'mail sender' object. > > If I do this: > smtp => '$this->{SMTP_SERVER}' (single quotes for elements) > > I get

Re: Match min and max chars

2003-08-26 Thread Oliver Schnarchendorf
On Tue, 26 Aug 2003 14:23:07 +1000, Anthony English wrote: > # make sure year is at least 2 but not more # than 4 digits > if ($year =~ /\d{2,4}/) { Hello Anthony, it is clear while your regex does match numbers bigger than 4 characters. There isn't

Re: MailSender Quotes Problem

2003-08-26 Thread Oliver Schnarchendorf
On Mon, 25 Aug 2003 23:51:47 +, Pablo Fischer wrote: > my $sender = new Mail::Sender ({ > smtp => "$this->{SERVER_IP}", > from => "pablin <[EMAIL PROTECTED]>", > to => "$nombre <$correo>", > subject => "$this->{MENSAJE_TITULO}",

MailSender Quotes Problem

2003-08-26 Thread Pablo Fischer
Hi! I was in a final test of my script and well it fails :-), however I found that it fails in the form that Im creating the 'mail sender' object. If I do this: smtp => '$this->{SMTP_SERVER}' (single quotes for elements) I get this error when Closing the message: Can't call method "Open" with

nested parenthesis in regex and launching a new process

2003-08-26 Thread Bryan Harris
Two quick questions for the gurus: 1. How are nested parenthesis in a match m// backreferenced? I have a folder full of files: file_3.0 file_3.0.1 file_3.0.1a file_3.0.1b file_3.0.10 file_3.1 file_3.1.1 file_3.2a And I want the last one without any letters in the number (not an alpha/beta).

Match min and max chars

2003-08-26 Thread Anthony English
I want to set a minimum and maximum number of characters to a field. I can't seem to get any value to get the maximum to check. On the perlretut I read a{n,m} = match at least n times, but not more than m times. If I type in a year of 12345678 I still seem to find a match: print "What year? ";

Re: Software Design - Software Management - Project Management

2003-08-26 Thread David Wall
--On Tuesday, August 26, 2003 12:36 AM +0200 Paul Johnson <[EMAIL PROTECTED]> wrote: You might like to take a look at some of the ideas from XP (that's extreme programming). Type that into google and poke around for a bit. They have some interesting ideas on these topics. Things that many peo

filling an array

2003-08-26 Thread Anthony J Segelhorst
I am working on script to kill a process if it have been running for 45 minutes or more. I am using a pstool called pslist to gather the data on the process. This out put looks like: C:\Tivoli\lcf\bin\w32-ix86\tools>pslist EXCEL PsList 1.23 - Process Information Lister Copyright (C) 1999-2002