Really simple XML question

2006-03-31 Thread Dave Adams
How do I print the value of 'Time Magazine'? Here is my file (ejournlist.xml): ?xml version='1.0'? EJOURNLIST EJOURN TIAfrica Confidential/TI ISSUEVol. 1, no.1/ISSUE FILEFORMATPDFformat/FILEFORMAT /EJOURN EJOURN TITime Magazine/TI ISSUEVol. 1, no.1/ISSUE FILEFORMATTXTformat/FILEFORMAT

sending email problem....

2006-03-31 Thread Tony Marquis
Hi everyone, The problem is really simple. When i try to send a message with this function with a wrong sender email address, my script just stops... as an exemple : sender address [EMAIL PROTECTED] the error message is - user not found on this server and the script stops.

Re: Really simple XML question

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 09:39 -0500, Dave Adams wrote: How do I print the value of 'Time Magazine'? What do you mean by 'value'? I see no element value or even VALUE and no attribute with those names. Here is my file (ejournlist.xml): ?xml version='1.0'? EJOURNLIST EJOURN TIAfrica

Re: Really simple XML question

2006-03-31 Thread Dermot Paikkos
On 31 Mar 2006 at 9:39, Dave Adams wrote: How do I print the value of 'Time Magazine'? Here is my file (ejournlist.xml): ?xml version='1.0'? EJOURNLIST EJOURN TIAfrica Confidential/TI ISSUEVol. 1, no.1/ISSUE FILEFORMATPDFformat/FILEFORMAT /EJOURN EJOURN TITime Magazine/TI

Re: the only difference is the 'x' after '/g'

2006-03-31 Thread Hans Meier (John Doe)
tom arnall am Freitag, 31. März 2006 09.56: i need the blank in 'From [' etc in order to distinguish it from the strings with 'From:' one solution to the problem, btw, is to use '\s' instead of a literal blank. does this behavior rank as a bug in perl? No, absolutely not. To make your

Re: sending email problem....

2006-03-31 Thread JupiterHost.Net
Tony Marquis wrote: Hi everyone, The problem is really simple. When i try to send a message with this function with a wrong sender email address, my script just stops... as an exemple : sender address [EMAIL PROTECTED] the error message is - user not found on this server and the

Re: the only difference is the 'x' after '/g'

2006-03-31 Thread tom arnall
Hans, got it: /x tells sys' to ignore all white space, not just \n. thanks very much. and thanks to the people who make possible this great mailing list. ;o) tom arnall north spit, ca On Friday 31 March 2006 07:29 am, Hans Meier (John Doe) wrote: tom arnall am Freitag, 31. März 2006 09.56:

Getting number of children of the root in an XML object

2006-03-31 Thread Dave Adams
I am trying to get the number of children of the root element and my script gives me the number of children of the children instead. Here is my XML document (ejournlist.xml): ?xml version='1.0'? EJOURNLIST EJOURN TIAfrica Confidential/TI ISSUEVol. 1, no.1/ISSUE

Script need help

2006-03-31 Thread Omabele Onome
Hi!!! I have written this script (see below) to check when the server or database is not running...but I can not seem to work around the error it is giving. The result it gave me is: Website is up and running Can't connect to data source #!/usr/bin/perl use strict; use

Re: Getting number of children of the root in an XML object

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 15:42 -0500, Dave Adams wrote: I am trying to get the number of children of the root element and my script gives me the number of children of the children instead. Here is my XML document (ejournlist.xml): ?xml version='1.0'? EJOURNLIST EJOURN TIAfrica

Re: Script need help

2006-03-31 Thread Chas Owens
On 3/31/06, Omabele Onome [EMAIL PROTECTED] wrote: Hi!!! I have written this script (see below) to check when the server or database is not running...but I can not seem to work around the error it is giving. The result it gave me is: Website is up and running Can't connect to data

simple profiling?

2006-03-31 Thread Bryan Harris
I have a script that takes ~5 seconds to run, but I'd like to get it down to 1 sec. My problem is I don't know which part is the slow part. So given something like this: ** #! /usr/bin/perl -w (code chunk 1 here) (code chunk 2 here) (code chunk 3 here)

RE: simple profiling?

2006-03-31 Thread Timothy Johnson
Check out the Benchmark module. I believe it's standard. perldoc Benchmark -Original Message- From: Bryan Harris [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 1:42 PM To: Beginners Perl Subject: simple profiling? I have a script that takes ~5 seconds to run, but I'd like

Re: simple profiling?

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 14:41 -0700, Bryan Harris wrote: I have a script that takes ~5 seconds to run, but I'd like to get it down to 1 sec. My problem is I don't know which part is the slow part. So given something like this: ** #! /usr/bin/perl -w

How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I need to handle a set of numbers where I want only the lowest 1000. There will be no rhyme or reason as the data comes in. I will do some calculations and take this total against the array or hash or ? The number of calculations will be tremendous and either I come up with a way

Re: How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 15:12 -0800, Wagner, David --- Senior Programmer Analyst --- WGO wrote: I need to handle a set of numbers where I want only the lowest 1000. There will be no rhyme or reason as the data comes in. I will do some calculations and take this total against the array or

Re: How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Tom Phoenix
On 3/31/06, Wagner, David --- Senior Programmer Analyst --- WGO [EMAIL PROTECTED] wrote: I need to handle a set of numbers where I want only the lowest 1000. There will be no rhyme or reason as the data comes in. You should loop over the input, pushing each item on to an array. If at

Re: How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 15:45 -0800, Tom Phoenix wrote: You should loop over the input, pushing each item on to an array. If at any time you have 2000 items in the array, sort them and discard any you don't want to keep. $#data = 999 if $#data 999;# OBperl: one way to discard

Re: How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Wiggins d'Anconia
Mr. Shawn H. Corey wrote: On Fri, 2006-31-03 at 15:45 -0800, Tom Phoenix wrote: You should loop over the input, pushing each item on to an array. If at any time you have 2000 items in the array, sort them and discard any you don't want to keep. $#data = 999 if $#data 999;# OBperl:

Re: simple profiling?

2006-03-31 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Fri, 2006-31-03 at 14:41 -0700, Bryan Harris wrote: I have a script that takes ~5 seconds to run, but I'd like to get it down to 1 sec. My problem is I don't know which part is the slow part. So given something like this: ** #!

Re: simple profiling?

2006-03-31 Thread Bryan Harris
I have a script that takes ~5 seconds to run, but I'd like to get it down to 1 sec. My problem is I don't know which part is the slow part. So given something like this: ** #! /usr/bin/perl -w my $start_time = time; (code chunk 1 here) print chunk

Re: How to manage around 1000 entries which will constantly be changing

2006-03-31 Thread Mr. Shawn H. Corey
On Fri, 2006-31-03 at 17:15 -0700, Wiggins d'Anconia wrote: Unless the sort optimizes out the need to loop through so many elements, and/or is written at a lower level. If each new item that is entered goes in the last place then you have to loop over every element of the list every time. But