Re: Extract user from email address

2007-02-07 Thread Mathew Snyder
Does this look like it *should* work? while ($data->get_tag("small")) { my $email = $data->get_trimmed_text("/small"); my $addr= new Email::Address1(undef, $email); my $addrUser= $addr->user; if ($email =~ m/^ids-tripwire/gmx or $email =~ m/^tripwi

Re: pictures and Tk::Canvas

2007-02-07 Thread Mumia W.
On 02/07/2007 02:20 PM, Herman Gerritsen wrote: Hi there, I have a seemingly simple problem. I want a picture (format doesn't really matter to me, but I tried jpeg and xpm) on a Tk::Canvas. I have been reading Mastering perl/TK (oreilly) but somehow the explanations in that book dont get to m

using ssmtp to send mail from Intel cygwin platform

2007-02-07 Thread oryann9
Hello...: ) I am having issues sending mail from within a perl script on an intel using the cygwin platform; the code is simply not sending email. CYGWIN_NT-5.1 laptop 1.5.23(0.156/4/2) 2006-12-19 10:52 i686 Cygwin snippet... qx(/usr/sbin/ssmtp $user < $log); system("/usr

Re: Opening multiple files for parsing

2007-02-07 Thread Rob Dixon
Rob Dixon wrote: > use strict; use warnings; use Carp; my @maillog = do { opendir my $dh, '.' or croak "Can't open directory: $!"; grep /^maillog/, readdir $dh; }; my @parsedmail; foreach my $log (@maillog) { open my $fh, $log or croak "Can't open $log: $!"; while (<$fh>) { if

Re: Opening multiple files for parsing

2007-02-07 Thread Rob Dixon
Tom Smith wrote: > > I'm writing a Perl script to parse 31 maillog files. The files are named > maillog, maillog.1, and so on up to 31. This is the default logrotate > scheme for naming rotated logs. > > My current order for processing these files is this: > > 1) Open the directory. > 2) List mail

Re: Opening multiple files for parsing

2007-02-07 Thread John W. Krahn
Tom Smith wrote: > I'm writing a Perl script to parse 31 maillog files. The files are named > maillog, maillog.1, and so on up to 31. This is the default logrotate > scheme for naming rotated logs. > > My current order for processing these files is this: > > 1) Open the directory. > 2) List maill

RE: Opening multiple files for parsing

2007-02-07 Thread Moon, John
-Original Message- From: Tom Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 07, 2007 5:09 PM To: beginners@perl.org Subject: Opening multiple files for parsing I'm writing a Perl script to parse 31 maillog files. The files are named maillog, maillog.1, and so on up to 31. This

Opening multiple files for parsing

2007-02-07 Thread Tom Smith
I'm writing a Perl script to parse 31 maillog files. The files are named maillog, maillog.1, and so on up to 31. This is the default logrotate scheme for naming rotated logs. My current order for processing these files is this: 1) Open the directory. 2) List maillog* files in the directory and

pictures and Tk::Canvas

2007-02-07 Thread Herman Gerritsen
Hi there, I have a seemingly simple problem. I want a picture (format doesn't really matter to me, but I tried jpeg and xpm) on a Tk::Canvas. I have been reading Mastering perl/TK (oreilly) but somehow the explanations in that book dont get to my brain... Perldoc didnt get me there either.. Can

Re: how to embed data in perl programs

2007-02-07 Thread D. Bolliger
Sharan Basappa am Mittwoch, 7. Februar 2007 16:13: > On 2/7/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Sharan Basappa wrote: > > > On 2/6/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: > > >> On 2/6/07, Sharan Basappa <[EMAIL PROTECTED]> wrote: > > >>> Question is how to embed text in a perl program

Re: how to embed data in perl programs

2007-02-07 Thread Ken Foskey
On Wed, 2007-02-07 at 20:43 +0530, Sharan Basappa wrote: > cmd line arg, the script needs to output one of these template files. > Definitely > I would not like to open a file, read it and then output it since moving the > script > (to another project etc) would mean that the files need to be moved

Re: mailing images from a url

2007-02-07 Thread Ken Foskey
On Tue, 2007-02-06 at 15:43 -0500, Matt Herzog wrote: > [EMAIL PROTECTED] corp2 corp1 corp3 corp5 > [EMAIL PROTECTED] corp6 corp7 corp9 corp8 This line is missing a closing quote. my $req = HTTP::Request->new(GET => "http://mon.xeering.com/cricket/grapher.cgi?type=png;target=%2FPSHome-Data%

Re: loop through a log file

2007-02-07 Thread Jon W
> > I have a log file that contains a collection of individual test > results, each beginning with a "START", and ending with a "FINISH". > > I would like to print out the names of the tests that have the error > message "LOOKING FOR THIS STRING". > > log file: > --

Re: regular expression

2007-02-07 Thread John W. Krahn
Sayed, Irfan (Irfan) wrote: > > I have modified the code in this fashion > > # /usr/bin/perl > use strict; > use warnings; > > my $CT = "/usr/atria/bin/cleartool"; > my @vob_list2 = map qq{"$_ ",}, `$CT lsvob -s`; > chomp (@vob_list2); > print "@vob_list2"; > > but output is as follows > >

Re: Problem with Fcntl.pm in a compiled(perlcc) Perl-cgi program

2007-02-07 Thread Tom Phoenix
On 2/7/07, I BioKid <[EMAIL PROTECTED]> wrote: I have a compiled perl-cgi program (using perlcc compiled on a 32bit Linux Machine), now I have moved my program to another machine (64bit). Now I am not able to run the program. Have you tried running the non-compiled version (i.e., your real Pe

Problem with Fcntl.pm in a compiled(perlcc) Perl-cgi program

2007-02-07 Thread I BioKid
Dear All, I have a compiled perl-cgi program (using perlcc compiled on a 32bit Linux Machine), now I have moved my program to another machine (64bit). Now I am not able to run the program. In the error_log I am getting the error : Can't locate Fcntl.pm. But Fcntl.pm is there, When tried : locat

Re: how to embed data in perl programs

2007-02-07 Thread Rob Coops
Sharan, Personaly would make use of a hash variable where the templates are named by the key and the actual template is the value. This will give you the option to add more templates as and where needed. With a little time and effort more complex templates can be created if you expand upon the b

Re: how to embed data in perl programs

2007-02-07 Thread Sharan Basappa
Hi Rob, Actually I am writing a script that actually spits out various make template files. People then fill in these templates with neccessary details and use them. The thing is that there are atleast 4-5 different templates and depending on the cmd line arg, the script needs to output one of th

XUL::Node Question

2007-02-07 Thread Bill Jones
XUL::Node Question Has anyone gotten a working example or basic application operational using http://search.cpan.org/~eilara/XUL-Node-0.05/lib/XUL/Node.pm The docs state I should be able to access http://localhost:8077/start.xul?SplitterExample#1 But I can't seem to get any example to work -- I

Re: while(1) or redo [was: Re: IPC problem]

2007-02-07 Thread Adriano Ferreira
On 2/7/07, Rob Dixon <[EMAIL PROTECTED]> wrote: Igor Sutton wrote: > Hi fellows, > >> Dave, you wanted to use >> >> while (1) { >> ... >> the code to be repeated >> .. >> } >> > > The above code could be written like this: > > { >... ># the code to be repeated >... >redo; >

Re: while(1) or redo [was: Re: IPC problem]

2007-02-07 Thread Rob Dixon
Igor Sutton wrote: Hi fellows, Dave, you wanted to use while (1) { ... the code to be repeated .. } The above code could be written like this: { ... # the code to be repeated ... redo; } Do you think this is better or worse than the other idiom? I like the last more.

Re: how to embed data in perl programs

2007-02-07 Thread Rob Dixon
Sharan Basappa wrote: > On 2/6/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 2/6/07, Sharan Basappa <[EMAIL PROTECTED]> wrote: Question is how to embed text in a perl program instead of reading it from a file or initializing the text in a string variable. Are you looking for here-documents?

Re: split w. regex question/problem

2007-02-07 Thread Rob Dixon
John W. Krahn wrote: Rob Dixon wrote: John W. Krahn wrote: Gauthier, Dave wrote: Getting unwanted list elements when using split with regex. Here's an example $str = "abc=In"; @arr = split(/[a-zA-Z0-9]/,$str); foreach $a (@arr) {print "$a\n";} I get... <> <> <> <=> ^ ^ ^ ^

Re: how to embed data in perl programs

2007-02-07 Thread Adriano Ferreira
On 2/7/07, Sharan Basappa <[EMAIL PROTECTED]> wrote: Hi Tom, What if I wanted to have multiple embedded (and separate) texts embedded in my program. Are you saying that I can have only one text section and that should have keyword DATA. Actually when I wrote example, I assumed that double unders

Re: how to embed data in perl programs

2007-02-07 Thread Sharan Basappa
Hi Tom, What if I wanted to have multiple embedded (and separate) texts embedded in my program. Are you saying that I can have only one text section and that should have keyword DATA. Actually when I wrote example, I assumed that double underscore tell the parser that a text section starts (so us