Re: Preventing CPU spikes / was switch confusion

2005-04-14 Thread Sean Davis
On Apr 14, 2005, at 2:09 PM, Charles K. Clarkson wrote: How about skipping the Switch stuff and using something like this. use CGI qw/:standard Button/; . . . if ( param() ) { if ( param( 'action' ) =~ /Upload/ ) { # call upload sub } elsif ( para

RE: Preventing CPU spikes / was switch confusion

2005-04-14 Thread Charles K. Clarkson
arp qw(fatalsToBrowser); : use strict; Also need to turn on warnings. use warnings; # or use -w switch on older perl versions : use switch; CPAN has only Switch.pm, not switch.pm. Did you create your own module or is this a typo? : my $action = $q->param( "action" ); You h

RE: Preventing CPU spikes / was switch confusion

2005-04-13 Thread David Gilden
Dear Perl Gurus, I have some problems that I think are a result of how my Switch statement is written. This script is invoked via a web browser to upload a file, and do a few other things. However it appears that the user system / network, or my script is stalling. So the user clicks the

Re: Insecure dependency in glob ... with -T switch

2005-01-21 Thread Scott R. Godin
l pathname. Or you may need to run somethings thru a "dumb regex", which will satisfy the taint checking. It's a dirty hack, but you can do sub untaint_me{ my $in = shift; $in =~ /(.*)/; return $1; } which totally obviates the whole reason for using the -T switch to begin with

RE: Insecure dependency in glob ... with -T switch

2005-01-17 Thread David Gilden
Hi, The code below works fine if run like: using PERL version 5.00503 #!/usr/bin/perl -w but with #!/usr/bin/perl -wT I am still getting error: Insecure dependency in glob while running with -T switch Can I turn off 'tainting' for this block { # turn off taint for this

RE: Insecure dependency in glob while running with -T switch

2005-01-17 Thread Bob Showalter
David Gilden wrote: > Last question here, > > #!/usr/bin/perl -wT > > > Snip ... > > my @filesToRemove = <*>; > > The line above is causing: > > Insecure dependency in glob while running with -T switch > > What can I do still have t

Re: Insecure dependency in glob while running with -T switch

2005-01-17 Thread Paul Archer
Snip ... my @filesToRemove = <*>; The line above is causing: Insecure dependency in glob while running with -T switch What can I do still have this functionally and satisfy 'tainting' Thanks, Dave tel: 817-741-2327 fax: 972-916-3451 (kora musician / audiophile / webmaster @ ww

RE: Insecure dependency in glob ... with -T switch

2005-01-16 Thread David Gilden
I thought this would do it, but I am at stopping point: #!/usr/bin/perl -wT my @filesToRemove = map {$_ =~ /^(\w[\w.-]*)/} <*>; Still getting : Insecure dependency in glob while running with -T switch What can I do still have this functionally and satisfy 'tainting' Thanks

Insecure dependency in glob while running with -T switch

2005-01-16 Thread David Gilden
Last question here, #!/usr/bin/perl -wT Snip ... my @filesToRemove = <*>; The line above is causing: Insecure dependency in glob while running with -T switch What can I do still have this functionally and satisfy 'tainting' Thanks, Dave tel: 817-741-2327 f

SWITCH / CASE statements

2005-01-16 Thread David Gilden
Quick question here for the PERL gurus! What should be the order for these two statements? exit; last switch; i.e is this correct? Thanks!! Dave -- Ft. Worth __CODE__ SWITCH: { if ($action =~ /Update/) { print redirect("./import_clean_cs

Re: Switch

2004-05-13 Thread David Dorward
On 13 May 2004, at 10:29, Werner Otto wrote: Is there some kind of a swtich statement in perl? Yes and no. See: perldoc -q switch -- David Dorward <http://dorward.me.uk/> <http://blog.dorward.me.uk/> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Switch

2004-05-13 Thread Werner Otto
Is there some kind of a swtich statement in perl? -- Kind Regards, Werner Otto -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Some Qs about the -w switch and initializing vars.

2003-06-17 Thread Charles K. Clarkson
Daedalus <[EMAIL PROTECTED]> wrote: : : Hi all, : : I have a cgi prog that complains about uninitialized : values when I use the -w switch. To avoid those errors : I have done stuff like this: [snip] I think the best solution is a sub routine re-write. I don't play with DBI much

Re: Some Qs about the -w switch and initializing vars.

2003-06-17 Thread drieux
On Tuesday, Jun 17, 2003, at 09:33 US/Pacific, Daedalus wrote: [..] # function get_address# sub get_address {my ($dbh, $sth, $searchid, $name, $address1, $address2, $address3, $address4) = @init_array; I would have do

Some Qs about the -w switch and initializing vars.

2003-06-17 Thread Daedalus
Hi all, I have a cgi prog that complains about uninitialized values when I use the -w switch. To avoid those errors I have done stuff like this: --- # Up near the top with a bunch of other defs and the main prog... my @init_array

Re: How can I switch to a Window like using the combination ALT+TAB.

2003-01-14 Thread William McKee
n will > be killed only after x seconds). I want to write a Perl script that test if > a window "Search Window1" exist then do only a switch to it else then create > a new Window. Sounds like you need Javascript, not Perl. Try the Javascript resources at http://www.irt.org.

How can I switch to a Window like using the combination ALT+TAB.

2003-01-14 Thread Khalid . Naji
e a Perl script that test if a window "Search Window1" exist then do only a switch to it else then create a new Window. Thanks KN -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: binmode with graphics, @ARGV, -T switch

2002-01-21 Thread Harvey Quamen
Briac: Thanks so much for all the help and advice. It's great to have a list like this, and I certainly appreciate the time you took to answer all my questions. That particular example is A LOT clearer now, and I learned a lot from your email. Thank you! Harv Quamen (P.S. Sorry to take u

Re: binmode with graphics, @ARGV, -T switch

2002-01-20 Thread Briac Pilpré
erldoc -f binmode > 4) When I test for syntax errors on the command line, I get the following: > Too late for "-T" option at image_fetch.cgi line 1. > I'm using Perl 5.6.0 and Apache 1.3.20 on Mac OS 10.1. Try adding the -T switch on your command line: $ perl -T my

binmode with graphics, @ARGV, -T switch

2002-01-20 Thread Harvey Quamen
Hello all: I'm just starting to learn CGI (about 3 days into it) and I have a few questions about the following script called "image_fetch.cgi" (it's example 3-4 in O'Reilly's "CGI Programming with Perl" by Guelich, Gundavaram & Birznieks, pp. 60-61). Sorry there are so many questions, but I

RE: E-mail with the -T switch

2001-10-11 Thread Rob
Thanks, this one worked. $ENV{PATH}='/usr/sbin'; my($mailprog) = 'sendmail'; my($recipient) = '[EMAIL PROTECTED]'; open (MAIL, "|$mailprog -t") ; #Do mail stuff delete $ENV{PATH}; :wq -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: E-mail with the -T switch

2001-10-11 Thread Kipp, James
> open (MAIL, "|-", "$mailprog" , "-t"); try changing $mailprog to "/usr/sbin/sendmail" >> > Can't use an undefined value as filehandle reference at > /home/rob/cgi-bin/completeOrder.cgi line 9. did you try : or you can do at the top of script: $ENV{PATH} = 'bin:/usr/bin'; # restrict the

Re: E-mail with the -T switch

2001-10-11 Thread RaFaL Pocztarski
Rob wrote: > I've been following this list with the digest version for some time now > and have started using the -T swith in all of the scripts that I write > now. Unfortunately, I don't know how to send e-mail with the -T switch > turned on. I would normally do it like

RE: E-mail with the -T switch

2001-10-11 Thread Rob
open (MAIL, "|-", "$mailprog" , "-t"); gives me the following in the error log... Can't use an undefined value as filehandle reference at /home/rob/cgi-bin/completeOrder.cgi line 9. On Thu, 11 Oct 2001, Kipp, James wrote: > > > > my($name) = "John"; > > my($mailprog) = '/usr/sbin/sendmail';

RE: E-mail with the -T switch

2001-10-11 Thread Kipp, James
> > my($name) = "John"; > my($mailprog) = '/usr/sbin/sendmail'; > my($recipient) = '[EMAIL PROTECTED]'; > open (MAIL, "|$mailprog -t"); #The script fails here Try this: open (MAIL, "|-", "$mailprog" , "-t"); #avoids using the shell or you can do at the top of script: $ENV{PATH} = 'bin:/usr/bi

E-mail with the -T switch

2001-10-11 Thread Rob
I've been following this list with the digest version for some time now and have started using the -T swith in all of the scripts that I write now. Unfortunately, I don't know how to send e-mail with the -T switch turned on. I would normally do it like this... /usr/bin/perl -wT