help in if - else loop in perl

2007-11-27 Thread Sayed, Irfan (Irfan)
Hi All, I am getting error while running following script.Error is due to improper if else loop and curly braces. Can you please guide me in placing the braces in right position and doing proper if..else looping My requirement is that I want to quit as soon as "if condition" fails.Please guide

Re: help in if - else loop in perl

2007-11-27 Thread Klaus Jantzen
Sayed, Irfan (Irfan) wrote: Hi All, I am getting error while running following script.Error is due to improper if else loop and curly braces. Can you please guide me in placing the braces in right position and doing proper if..else looping My requirement is that I want to quit as soon as "

Re: Trouble Installing Carp-Clan 5.9.x

2007-11-27 Thread Jenda Krynicky
And if you reply to someone you should trim down the message ... there is no reason to include the unsubscribe notice three times. - Because then it's all backwards. - Why is that? - Please, don't top post! From: "Gerald Wheeler" <[EMAIL PROTECTED]> > Correction, I did get to the end of one bra

Re: help in if - else loop in perl

2007-11-27 Thread Matthew Whipple
Sayed, Irfan (Irfan) wrote: > Hi All, > > I am getting error while running following script.Error is due to > improper if else loop and curly braces. > > Can you please guide me in placing the braces in right position and > doing proper if..else looping > > My requirement is that I want to quit

Re: Trouble Installing Carp-Clan 5.9.x

2007-11-27 Thread Gerald Wheeler
Sorry about the top posting.. Is there a way to resolve the make problem for Bit::Vector J. >>> "Jenda Krynicky" <[EMAIL PROTECTED]> 11/27/2007 5:57:13 AM >>> And if you reply to someone you should trim down the message ... there is no reason to include the unsubscribe notice three times. - Beca

Returning multiple MySQL rows from module

2007-11-27 Thread Steve Bertrand
Hi all, I am trying to modularize some standard MySQL queries that I frequently do against our RADIUS DB. The current setup feels very 'kludgy' to me. The code snip below comes out of the module. I hope there is enough context to see why I think it can be improved. Essentially, I'd like a gracef

Custom pragmas

2007-11-27 Thread manojkumarg
Hello List,Working hard to edit a perl program. I came across use Custom::E::Objname in pragma section. How can I find where is this Custom pragma defined?Please help. ThanksManoj

Re: Custom pragmas

2007-11-27 Thread Tom Phoenix
On 11/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello List,Working hard to edit a perl program. I came across use > Custom::E::Objname in pragma section. How can I find where is > this Custom pragma defined?Please help. ThanksManoj It's not a module I've ever heard of; from the name,

Re: Returning multiple MySQL rows from module

2007-11-27 Thread Tom Phoenix
On 11/27/07, Steve Bertrand <[EMAIL PROTECTED]> wrote: > The current setup feels very 'kludgy' to me. The code snip below comes > out of the module. I hope there is enough context to see why I think it > can be improved. Actually, the snippet you submitted seems pretty straightforward. It could b

Trouble with Email::MIME modules

2007-11-27 Thread Filip Sneppe
Hi, I am trying to do the following: I have (an) email that is fetched from an IMAP server What I want to do is go over this mail and do two things: - change all "Content-Transfer-Encoding: quoted-printable" or "7bit" to 8bit - drop all MIME parts that are "Content-Type: text/html" and then sa

RE: Custom pragmas

2007-11-27 Thread Manoj
Yes it's a custom module. Digging to find out the exact use of the module. Thanks Manoj -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix Sent: Tuesday, November 27, 2007 10:20 PM To: [EMAIL PROTECTED] Cc: beginners@perl.org Subject: Re: Custom

Re: Trouble with Email::MIME modules

2007-11-27 Thread Tom Phoenix
On 11/27/07, Filip Sneppe <[EMAIL PROTECTED]> wrote: > At this point I am getting so frustrated that I would simply like > to look at working code of what I need to achieve and then learn > where I went wrong. Well, the first part of what you'd like would seem to imply that somebody else should w

Re: Returning multiple MySQL rows from module

2007-11-27 Thread Steve Bertrand
Tom Phoenix wrote: > On 11/27/07, Steve Bertrand <[EMAIL PROTECTED]> wrote: > >> The current setup feels very 'kludgy' to me. The code snip below comes >> out of the module. I hope there is enough context to see why I think it >> can be improved. > > Actually, the snippet you submitted seems pret

Re: Trouble with Email::MIME modules

2007-11-27 Thread Filip Sneppe
On Nov 27, 2007 7:20 PM, Tom Phoenix <[EMAIL PROTECTED]> wrote: > Well, the first part of what you'd like would seem to imply that > somebody else should write your program for you. But maybe you don't > mean that, you just want code that shows how to use the module? Any > good module should inclu

can't run mailx as PERL system command

2007-11-27 Thread Elliot Holden
ok this is problem going to be real easy for one of you PERL gurus but my little brain just can't figure it out. From the command line (Solaris 9) I can do this fine: echo my little test | mailx -s "Test Message" [EMAIL PROTECTED] But in PERL the below code does not work: system("echo my lit

Re: can't run mailx as PERL system command

2007-11-27 Thread Tom Phoenix
On 11/27/07, Elliot Holden <[EMAIL PROTECTED]> wrote: > system("echo my little test | mailx -s \"Test Message\" > [EMAIL PROTECTED]"); What is that command? This code should show it to you: print "The command is: echo my little test | "; print "mailx -s \"Test Message\" "; print "[EMAIL PR

Extracting one record from multiple-records textfile

2007-11-27 Thread Giuseppe.G.
Hello there. I'm a real beginner and I was wondering if you could be so kind to help me on this. I have a text file, containing a number of varying length documents, all tagged with DOC-START and DOC-END, structured as follows: DOC-START content of the document DOC-END DOC-START some text DOC-EN

about ( .)

2007-11-27 Thread ciwei2103
can someone explain how this code segment works: # execute a command which may be on a local system or a remote system sub _lrdo { my ($cmd,$exec,$rtn); ($cmd) = (@_); $exec = (_localsys()) ? $cmd : "$SRSH{$SYS} $SYS $cmd"; $rtn=_do($exec); return "$rtn"; } sub _haconfmak

Re: can't run mailx as PERL system command

2007-11-27 Thread Celejar
On Tue, 27 Nov 2007 19:43:55 -0500 Elliot Holden <[EMAIL PROTECTED]> wrote: > But in PERL the below code does not work: > > system("echo my little test | mailx -s \"Test Message\" > [EMAIL PROTECTED]"); > > even if I just do: > > system("mailx [EMAIL PROTECTED]"); You need to escape the '@' i

Re: about ( .)

2007-11-27 Thread Jeff Pang
On Nov 28, 2007 4:09 AM, ciwei2103 <[EMAIL PROTECTED]> wrote: > > Q1: is the parenthes () around > _lrdo ( .. ) optional when called? > what's the meanings of "parenthes"? you can call _Irdo(...) directly in the script. > > Q2: why (_) around > ($cmd ) = ( @_) , This can be written as: (

Re: about ( .)

2007-11-27 Thread Tom Phoenix
On 11/27/07, ciwei2103 <[EMAIL PROTECTED]> wrote: > # execute a command which may be on a local system or a remote system > sub _lrdo { > my ($cmd,$exec,$rtn); > ($cmd) = (@_); > $exec = (_localsys()) ? $cmd : "$SRSH{$SYS} $SYS $cmd"; > $rtn=_do($exec); > return "$rtn"; >

Re: Extracting one record from multiple-records textfile

2007-11-27 Thread Tom Phoenix
On 11/27/07, Giuseppe.G. <[EMAIL PROTECTED]> wrote: > I have a text file, containing a number of varying length documents, > all tagged with DOC-START and DOC-END, structured as follows: > > > DOC-START > content of the document > DOC-END > I need to take every document and pass it to a parsing f

Re: Extracting one record from multiple-records textfile

2007-11-27 Thread Jeff Pang
Hello, Just show another way to do it. use strict; local $/="\n\n"; while() { next unless /^DOC-START\n(.*?)\nDOC-END$/sm; my $content = $1; parse($content); } sub parse { my $c = shift; print length($c),"\n"; } __DATA__ DOC-START content of the document DOC-END DOC-START

Re: error on simple system command

2007-11-27 Thread lerameur
works good now: my $file_to_print = ( `ls -1c /test/*log | tail -1 `); print "file_to_print: $file_to_print"; open (FILE, "< /test/$file_to_print") or die "Could not open file_to_print $: $!"; although the third line is not opening the file. It prints out good but but I

Re: Extracting one record from multiple-records textfile

2007-11-27 Thread John W . Krahn
On Tuesday 27 November 2007 11:29, Giuseppe.G. wrote: > Hello there. Hello, > I'm a real beginner and I was wondering if you could be > so kind to help me on this. > I have a text file, containing a number of varying length documents, > all tagged with DOC-START and DOC-END, structured as follows

Re: error on simple system command

2007-11-27 Thread John W . Krahn
On Tuesday 27 November 2007 08:18, lerameur wrote: > > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; > > open (FILE, "< /test/$file_to_print") or die "Could not open > file_to_print $: $!"; > > although the thi

Re: error on simple system command

2007-11-27 Thread Tom Phoenix
On 11/27/07, lerameur <[EMAIL PROTECTED]> wrote: > works good now: > my $file_to_print = ( `ls -1c /test/*log | tail -1 `); > > print "file_to_print: $file_to_print"; Since you didn't chomp() it, and since you didn't need to add a newline when you printed it, it seems that $file_

Re: Returning multiple MySQL rows from module

2007-11-27 Thread Rob Dixon
Steve Bertrand wrote: > Tom Phoenix wrote: >> Steve Bertrand wrote: The current setup feels very 'kludgy' to me. The code snip below comes out of the module. I hope there is enough context to see why I think it can be improved. Actually, the snippet you submitted seems pretty straightforward