RE: Sorting HTML tables

2004-08-05 Thread Paul Harwood
The table is fairly complicated. I'll take a look at those modules though. Thanks! -Original Message- From: Chris Devers [mailto:[EMAIL PROTECTED] Posted At: Wednesday, August 04, 2004 5:03 PM Posted To: Perl Conversation: Sorting HTML tables Subject: Re: Sorting HTML tables On Wed, 4 Au

Reading binary files in Perl

2004-05-06 Thread Paul Harwood
I am trying to read a binary file with the following code: $filename = "binary_file.rpy"; open(FILE, $filename) or die "can't open $filename: $!"; binmode(FILE); binmode(STDOUT); while (read(FILE, $buff, 8 * 2**10)) { print STDOUT $buff; } I get *some* rea

HTML reports via email

2004-01-26 Thread Paul Harwood
I am trying to learn the best way to send HTML formatted reports via e-mail using the standard modules that come with Perl 5.8. The examples I have seen assign blocks of HTML code to scalars and pass them to the NET::SMTP datasend() method etc. I was wondering if there was a better, more efficient

Use of FOR statement

2004-01-08 Thread Paul Harwood
I am reading through a book on Objects and References and I don't understand this statement: $sum += $_ for split //; I thought a FOR statement needed to be in braces. How is it being used in this context? --Paul

RE: Getting the most recent file

2003-12-14 Thread Paul Harwood
One question I have: With this statement: @files = sort { -M $a <=> -M $b } @files; How does Perl understand that these are files and not just text entries? Did using the readdir beforehand make this possible? -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Posted At: Sat

RE: SMTP From field using MIME::Lite

2003-12-10 Thread Paul Harwood
It might be my mail server settings. I am using Exchange Server 2003. SMTP MAIL command failed: 5.5.4 Invalid Address I will check into this more. -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 4:21 PM To: Paul Harwood; Beginner Perl

RE: SMTP From field using MIME::Lite

2003-12-09 Thread Paul Harwood
I want to be able to add a display name as well. For example: Paul Harwood instead of the SMTP address. > I wrote the following code: > > MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60); > > $msg = MIME::Lite->new( >

SMTP From field using MIME::Lite

2003-12-09 Thread Paul Harwood
I wrote the following code: MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60); $msg = MIME::Lite->new( From =>"[EMAIL PROTECTED]", To =>'[EMAIL PROTECTED]', Subject =>"TEST",

Using Benchmark module

2003-11-25 Thread Paul Harwood
Can Benchmark be used to gather performance data on a complete script rather than just a portion of code?

Using print to overwrite a line

2003-11-25 Thread Paul Harwood
Is there a simple way to print over an existing line? For example: I would like to have a progress report that reads 10%, 20% etc. I don't want to print a new line each time. I want to write over the existing line and have it update as it goes. --Paul

RE: Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
OK, maybe I am confusing myself. :) -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 9:27 AM To: Paul Harwood Cc: James Edward Gray II; Beginner Perl Subject: RE: Creating uniqueness in complex data structures On Nov 24, Pa

RE: Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
Perl Conversation: Creating uniqueness in complex data structures Subject: Re: Creating uniqueness in complex data structures On Nov 23, 2003, at 6:36 PM, Paul Harwood wrote: > The log files I am parsing have threads (a T followed by several > alphanumeric numbers) associated with each line

Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
The log files I am parsing have threads (a T followed by several alphanumeric numbers) associated with each line of text. I want to push each value of $2 (which is a server name) into an anonymous array. This works fine in the following code. if ($_ =~ /(T[0-9A-F]+) SCTS\((.+)\)/)

RE: Array de-referencing problem

2003-11-21 Thread Paul Harwood
onversation: Array de-referencing problem Subject: Re: Array de-referencing problem From: "Paul Harwood" <[EMAIL PROTECTED]> > I wrote the following code: > > $thread = "TEFD0"; > $logfile = "V_DEBUG12121.txt"; > $delay = "10232"

Array de-referencing problem

2003-11-21 Thread Paul Harwood
I wrote the following code: $thread = "TEFD0"; $logfile = "V_DEBUG12121.txt"; $delay = "10232"; @servers = qw (SERVER1 SERVER2 SERVER3 SERVER4); $server {$thread}->{$logfile}->{$delay} = @servers; print @$server {$thread}->{$logfile}->{$delay}; My expectation is that it would simply print out

Question on grep search

2003-11-16 Thread Paul Harwood
I am trying to push an element into a nested array, but ONLY if it doesn't already exist. I thought the best way to do this might be the code I wrote below but it doesn't work. @{$names{TEST}} = ('Paul', 'Mike'); print "Arrays is: "; print @{$names{TEST}}; print "\n"; $another_name = "George"; pus

Getting last element of anonymous array

2003-11-15 Thread Paul Harwood
I am trying to get the last element of the anonymous array below. Using $# I keep getting the 1st element (or so it seems anyway). What am I doing wrong? $server {TED0} = ['SERVER1', 'SERVER2', 'SERVER3']; push @{$server{TED0}}, "SERVER4"; push @{$server{TED0}}, "SERVER5"; print "\nFull array

RE: Regex search using scalar

2003-11-06 Thread Paul Harwood
's confusing me. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tore Aursand Posted At: Wednesday, November 05, 2003 5:12 AM Posted To: Perl Conversation: Regex search using scalar Subject: Re: Regex search using scalar On Tue, 04 Nov 2003 20:41:17 -0800, Paul Harwood wrot

Regex search using scalar

2003-11-05 Thread Paul Harwood
I would like to enumerate a list and search through each element like so: If (/$logs[i]/) { # code} I know the syntax is wrong so I was hoping someone could explain how to do this. Thanks. --Paul

Regex search question

2003-10-29 Thread Paul Harwood
I know that if ( /VALUE={1}(\d+)/ ) { looks for the first occurrence of value. How do I find the last occurrence? --Paul

Regex searches including spaces

2003-10-23 Thread Paul Harwood
I am trying to parse through the following line: TUITimer> TUI Dead Air Timer::1828ms:: I want to extract the 1828 value. The regex I have is: if ( /TUI Dead Air(\d+)/ ) { I know this is wrong but I have tried every variation of \s that I can think of with no success. Also, is there a Regex

Question on transliteration

2003-10-23 Thread Paul Harwood
Can someone translate into English: ($filename) = $file =~ m!([^/]*)$!; Why is $filename in parens?

Re: File sorting by a specific date

2003-10-21 Thread Paul Harwood
This isn't working for some reason. The $date scalar seems unchanged throughout. Paul Harwood wrote: > > I want to search a directory of log files and populate a list of those > log files ONLY if they match today's date (localtime). > > $logs = 'c:\logs\W3SVC1&#x

File sorting by a specific date

2003-10-17 Thread Paul Harwood
I want to search a directory of log files and populate a list of those log files ONLY if they match today's date (localtime). $logs = 'c:\logs\W3SVC1'; opendir LOGS, "$logs" or die "Can't open directory: $!\n"; my @files = grep /\.TXT$/, readdir LOGS; #Right here, I am wondering if there is a

Comparing file dates with current date

2003-10-16 Thread Paul Harwood
I am trying to compare a file's modified timestamp with the current date. I can use 'stat' to get the timestamp of the file but am not sure how to compare it to the localtime(). More importantly I want to be able to quantify the difference in days, month, hours and minutes. Any suggestions?

Reporting with HTML forms in Perl

2003-03-21 Thread Paul Harwood
I am trying to find a module that will make it easier to embed scalar data in HTML for reporting purposes. So far I have looked at HTML::Template but that seems more for CGI related operations. I just want to be able to generate a report and then email it to a distribution list. I want the report

Using 'IF EXISTS'

2003-02-07 Thread Paul Harwood
The English of what I want to do is "If this remote value is not defined, then skip over it and proceed on to the next entry in the list." I want to avoid an error is the key doesn't exist. Every variation of IF EXISTS I use doesn't work correctly. Is there something obvious I am missing?

Using 'IF EXISTS'

2003-02-07 Thread Paul Harwood
The English of what I want to do is "If this remote value is not defined, then skip over it and proceed on to the next entry in the list." I want to avoid an error is the key doesn't exist. Every variation of IF EXISTS I use doesn't work correctly. Is there something obvious I am missing?

Need help parsing a DN

2003-01-21 Thread Paul Harwood
What would be the best method to parse the following DN? I just want the first part of this DN so I can create a server list into an array (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure how to get the first part of the text I want. Any help appreciated. CN=EX-MSG-01,CN=

Net:Ldap question

2002-11-26 Thread Paul Harwood
I can't seem to get this to work at all. Here's what I've done: 1) Downloaded the .PM file. 2) Created a NET directory under c:\perl\lib 2) Copied the LDAP.PM file to c:\perl\lib\Net 3) Created Convert directory under c:\perl\lib. 4) Copied the Convert::ASN1 file (ASN1.PM) to the c:\perl\lib\con

Module NET:LDAPapi question

2002-11-23 Thread Paul Harwood
I am having a ton of difficulty getting this to work on my WIN32 system. I copied the LDAPapi.PM file to the c:\perl\lib\Net folder but I still keep getting errors. Is there something simple I am missing? Can't locate loadable object for module Net::LDAPapi in @INC (@INC contains: C:/Perl/lib C:/P