Re: Input template for data File

2005-05-19 Thread Offer Kaye
On 5/20/05, Craig Nock wrote: > > I would like to have this ?template? outside of my script, so this can > change without the script changing (it will become an executable). > I'm new to Perl and not sure of where to start looking for this > functionality, and sure that someone else will have solve

Input template for data File

2005-05-19 Thread Craig Nock
I have a tab delimited file I wish to process via a Perl script. Different columns should be converted to a "Code", plus the value in the column, both written to a output file line. eg column 17 contains "7", corresponding output line is "1234 DC 7". This is reasonably straight forward, except th

Re: using Mail::Sender

2005-05-19 Thread Offer Kaye
On 5/19/05, Graeme McLaren wrote: > Offer, everyone, I tried sending an email from a mail server and I got an > error: > > Local user "user" unknown on host "mail.smtpserver.com" > > > It seems to break on $email. The "user" that the error reports is the value > of $email, so why isn't it sendi

Re: p. 561 in camel book.

2005-05-19 Thread Randal L. Schwartz
> "Charles" == Charles K Clarkson <[EMAIL PROTECTED]> writes: Charles> So what should be written there? How does the OP untaint data properly? There is never a general answer to that question. "data" doesn't have an "untaint". Instead, write a specific regex for the narrowest possible

Re: Removing multiple spaces

2005-05-19 Thread John W. Krahn
Charles K. Clarkson wrote: Dale wrote: : Hi Jeff 'japhy' Pinyan, you wrote: : : : if ($line =~ /^[\s\d]+$/) { ... } : : Can I just check something here Jeff. I thought the ^ symbol was for : "not equal", so why does this work when I'm looking for digits? A circum

RE: Removing multiple spaces

2005-05-19 Thread Charles K. Clarkson
Dale wrote: : Hi Jeff 'japhy' Pinyan, you wrote: : : : if ($line =~ /^[\s\d]+$/) { ... } : : Can I just check something here Jeff. I thought the ^ symbol was for : "not equal", so why does this work when I'm looking for digits? A circumflex (^) means "not" insid

RE: p. 561 in camel book.

2005-05-19 Thread Charles K. Clarkson
Randal L. Schwartz wrote: : When *I* was in charge of the camel book (first and second editions), : such crap would never have remained. {sigh} So what should be written there? How does the OP untaint data properly? Charles K. Clarkson -- Mobile Homes Specia

Re: p. 561 in camel book.

2005-05-19 Thread Randal L. Schwartz
> "John" == John Doe <[EMAIL PROTECTED]> writes: John> Imagine the above tainted() without the '#' in the evaled string, and $data John> contains 'system ("rm -rf;")': John> 1. $nada would be executed John> 2. the quotes around the evaled string would not be necessary But this is still bro

Re: Removing multiple spaces

2005-05-19 Thread Dale
Hi Jeff 'japhy' Pinyan, you wrote: if ($line =~ /^[\s\d]+$/) { ... } Can I just check something here Jeff. I thought the ^ symbol was for "not equal", so why does this work when I'm looking for digits? Cheers! -- Dale -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: p. 561 in camel book.

2005-05-19 Thread John Doe
Am Donnerstag, 19. Mai 2005 22.11 schrieb Matthew Sacks: > Greetings, > This is the sort of little question that drives me nuts. > I am reading about tainting/taintedness etc. in the Camel book. Look at p. > 561 for an example of a perl subroutine that tests data to see if it is > tainted, returni

p. 561 in camel book.

2005-05-19 Thread Matthew Sacks
Greetings, This is the sort of little question that drives me nuts. I am reading about tainting/taintedness etc. in the Camel book. Look at p. 561 for an example of a perl subroutine that tests data to see if it is tainted, returning true or false. It contains this line (writing from memory):

Re: using Mail::Sender

2005-05-19 Thread Graeme McLaren
Offer, everyone, I tried sending an email from a mail server and I got an error: Local user "user" unknown on host "mail.smtpserver.com" It seems to break on $email. The "user" that the error reports is the value of $email, so why isn't it sending the email? Offer thank you for your reply, tha

RE: Perl syntax questions from source code in queue.pm

2005-05-19 Thread Siegfried Heintze
Problem with Thread::Queue fixed. The sample program for Thread::Queue is incorrect (or maybe I just missed the ":shared" when declaring variable @Q). Well it is definitely incorrect in Larry's book: Programming Perl, 3rd Edition. Do they need a volunteer to update the documentation? This works f

RE: Matching a $string w/ $string plus any extension

2005-05-19 Thread Brian Volk
-Original Message- From: Brian Volk Sent: Thursday, May 19, 2005 11:44 AM To: Beginners (E-mail) Subject: Matching a $string w/ $string plus any extension Hi All, I'm trying to print a file name(s) if it matches $query... which is the basename. I think I can do this w/ a regex?

Matching a $string w/ $string plus any extension

2005-05-19 Thread Brian Volk
Hi All, I'm trying to print a file name(s) if it matches $query... which is the basename. I think I can do this w/ a regex? This is the line I'm having trouble with. print "$_\n" if (/$query.\w*/ eq $_); If I'm understanding Learning Perl correctly... the dot ( . ) is a wildcard and wil

RE: Problems accessing oracle via cgi and apache

2005-05-19 Thread brian . barto
Bob you are brilliant. Apache didn't have the environment but my user did. I set the environmental variables in the script like you suggested and it works great! Thanks, Brian -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Thursday, May 19, 2005 1:45 PM To: '[EMAIL

RE: Problems accessing oracle via cgi and apache

2005-05-19 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi all. I think I have some sort of permissions problem here i'm > hoping to get help for. > > I'm running apache on HP-UX. I have a perl script that accesses a > database (local) and displays the results in a HTML table format. > Pretty simple. I've done lots of databas

Problems accessing oracle via cgi and apache

2005-05-19 Thread brian . barto
Hi all. I think I have some sort of permissions problem here i'm hoping to get help for. I'm running apache on HP-UX. I have a perl script that accesses a database (local) and displays the results in a HTML table format. Pretty simple. I've done lots of database scripting before so i figured this

Re: passing input to an external programs shell

2005-05-19 Thread Wiggins d'Anconia
p.s. I assume you can't just set the 'always-trust' flag when importing a key? http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: passing input to an external programs shell

2005-05-19 Thread Wiggins d'Anconia
D. J. Birkett wrote: > D. J. Birkett wrote: > >> Chris Devers wrote: >> >>> On Wed, 18 May 2005, D. J. Birkett wrote: >>> >>> I'm trying to call gpg externally >>> >>> >>> >>> >>> Why? Can't you just use something like Crypt::GPG? >>> >>>

Re: passing input to an external programs shell

2005-05-19 Thread D. J. Birkett
D. J. Birkett wrote: Chris Devers wrote: On Wed, 18 May 2005, D. J. Birkett wrote: I'm trying to call gpg externally Why? Can't you just use something like Crypt::GPG? This script is to be run from an nfs mount on many systems, so it has to

Re: Baffling unicode wierdness

2005-05-19 Thread angie ahl
On 5/19/05, Randy Kobes <[EMAIL PROTECTED]> wrote: > On Wed, 18 May 2005, Jay Savage wrote: > > > On 5/18/05, angie ahl <[EMAIL PROTECTED]> wrote: > > > I can confirm that it's happening before the data's gone > > > to the database or anything. I'm getting the params from > > > CGI.pm and then dec

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-19 Thread Nan Jiang
Not really, think how much programming effort would it take to generate a file where and corresponding would be intermixed :) To be honestly, that's why I'm using perl because it is fast and reliable for processing text... Assuming that you keep only one file open at a time and your filehandle

Re: XML

2005-05-19 Thread Scott Taylor
Thank you for most helpful information. :) Offer Kaye said: > On 5/19/05, Scott Taylor wrote: >> >> ... to pump out lines of data to my SQL statement. >> >> I'll need to end up with something like: >> qw($vid,$eid,$event,$desc >> ,$date,$mid_desc,$mid_val >> ,$pid_desc,$pid_val,$min,$max,$val

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-19 Thread Peter Rabbitson
> I have to say that I'm very lucky because the document keeps a very well > defined order of and ... Not really, think how much programming effort would it take to generate a file where and corresponding would be intermixed :) > The last question about my approach is, I found a good place

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-19 Thread Nan Jiang
Hi Peter, I finally start understanding how XML::twig handlers work though it sounds a bit tricky to me at first because I didn't put much debug code to trace the execution of each important line. Now I understand that XML:Twig still reads the whole document from top to bottom, but the thing is

Crystal Reports

2005-05-19 Thread Brent Clark
Hi all Has anyone ever managed to get perl to talk to Crystal Reports. Currently one of developers got a hack working my getting perl to run a system subroutine and then that in its self runs a vbscript: system("WSCRIPT","crystal.vbs","$crystal_rpt_name","$username","$ibookref","$outputfile"); Al

Re: using Mail::Sender

2005-05-19 Thread Offer Kaye
On 5/19/05, Graeme McLaren wrote: > Hi all, I'm wanting to use the Mail::Sender module. When sending emails > I'll need to use an SMTP server. On CPAN I found the following in the > documentation, is this all I would need to send email? What is the "auth" > key for? Surely all you need is a hos

using Mail::Sender

2005-05-19 Thread Graeme McLaren
Hi all, I'm wanting to use the Mail::Sender module. When sending emails I'll need to use an SMTP server. On CPAN I found the following in the documentation, is this all I would need to send email? What is the "auth" key for? Surely all you need is a host, username and password? if ($sender-

Re: Emulate "tail -f" on file

2005-05-19 Thread Chris Knipe
On Thu, May 19, 2005 at 11:54:35AM +0530, Ramprasad A Padmanabhan wrote: > use File::Tail; > > > On Thu, 2005-05-19 at 11:37, Tielman Koekemoer (TNE) wrote: > > Hi All, > > > > If I wanted to monitor a file in a way that would emulate "tail -f" > > (in the shell), how would I open the file? > >

Re: Baffling unicode wierdness

2005-05-19 Thread Randy Kobes
On Wed, 18 May 2005, Jay Savage wrote: > On 5/18/05, angie ahl <[EMAIL PROTECTED]> wrote: > > I can confirm that it's happening before the data's gone > > to the database or anything. I'm getting the params from > > CGI.pm and then decoding via decode("utf8", $v) The page > > the params came from