Re: Possible to get field names and types in a table without executing a query?

2006-06-27 Thread JupiterHost.Net
It doesn't matter what fetchall_hashref() returns. You get the list of columns from $sth->{NAME}. Cool. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: disappointing '.*?'

2006-06-27 Thread Tom Phoenix
On 6/26/06, tom arnall <[EMAIL PROTECTED]> wrote: > > 1 #!/usr/bin/perl -w > > 2 > > 3 $_ = " [11] [22] a "; > > 4 > > 5 #with .*? > > 6 $re1 = qr/a|\[.*?\d\d\]/; > > 7 $re2 = qr/($re1\s)?$re1/; > > 8 ($f) = /($re2)/; > > 9 print "with .*? : $

Re: reg ex problem

2006-06-27 Thread Ryan Moszynski
thanks for the help, that did the trick On 6/27/06, Ryan Moszynski <[EMAIL PROTECTED]> wrote: i have this string extracted from a text file i'm writing a program to process: test_freq = 1.0001; and i have to extract the "1.0001" i can't count on the whitspace being where it now is. I wo

Re: reg ex problem

2006-06-27 Thread John Ackley
Ryan Moszynski wrote: i have this string extracted from a text file i'm writing a program to process: test_freq = 1.0001; and i have to extract the "1.0001" i can't count on the whitspace being where it now is. I would like to change this line of perl $getTestFRQ =~ s/\D+//g; so that

Re: reg ex problem

2006-06-27 Thread Dr.Ruud
"Ryan Moszynski" schreef: > i have this string extracted from a text file i'm writing a program > to process: > > test_freq = 1.0001; > > and i have to extract the "1.0001" > > i can't count on the whitspace being where it now is. > > I would like to change this line of perl > > $getTestFRQ =

RE: reg ex problem

2006-06-27 Thread Timothy Johnson
Here's one example of how you could go about it: ## use strict; use warnings; my $testString = " test_freq = 1.0001;"; print "Test One: "; if($testString =~ /=\s*([0-9.]+)\s*;\s*$/){ print $1; }else{ print "Failed!"; } print "\n"; ##

RE: reg ex problem

2006-06-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ryan Moszynski wrote: > i have this string extracted from a text file i'm writing a program > to process: > > test_freq = 1.0001; > > and i have to extract the "1.0001" > > i can't count on the whitspace being where it now is. > > I would like to change this line of perl > > $getTestFRQ

reg ex problem

2006-06-27 Thread Ryan Moszynski
i have this string extracted from a text file i'm writing a program to process: test_freq = 1.0001; and i have to extract the "1.0001" i can't count on the whitspace being where it now is. I would like to change this line of perl $getTestFRQ =~ s/\D+//g; so that instead of killing all no

Re: disappointing '.*?'

2006-06-27 Thread tom arnall
On Monday 26 June 2006 12:37 pm, Tom Phoenix wrote: > On 6/26/06, tom arnall <[EMAIL PROTECTED]> wrote: > > 1 #!/usr/bin/perl -w > > 2 > > 3 $_ = " [11] [22] a "; > > 4 > > 5 #with .*? > > 6 $re1 = qr/a|\[.*?\d\d\]/; > > 7 $re2 = qr/($re1\s)?$re1/; > >

Re: puzzling '.{1,4}'

2006-06-27 Thread tom arnall
inline. > > Check this out: > > #!/usr/bin/perl > > $_ = " x11x x22x a "; > > #with '.*?' > $re1 = qr/x.*?\d\dx|a/; > ($j) = /($re1\s)?/; > ($k) = /($re1\s){1}/; > print "j:$j:$/"; > print "k:$k:$/"; > > > Gives you: > j:: > k:x11x : > very helpful. i would have thought that /($re1\s)?/ would p

Re: '-d' with '>' creates errors

2006-06-27 Thread tom arnall
inline. Tom Arnall On Thursday 22 June 2006 06:35 pm, Tom Phoenix wrote: > On 6/22/06, tom arnall <[EMAIL PROTECTED]> wrote: > > invoking a perl script with '#!/usr/perl -wd' in its first line and > > with './myscript >t' on the command line, > > What are you trying to do? i want to enable th

RE: eval problem

2006-06-27 Thread Jorge Almeida
On Tue, 27 Jun 2006, Smith, Derek wrote: So could this `$SIG{'PIPE'}="IGNORE";' be considered a global similar to $ENV{"PATH"} = qq(/opt/SUNWsamfs/sbin:/usr/bin); Yes, %SIG is a global hash. Jorge -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

RE: eval problem

2006-06-27 Thread Smith, Derek
-Original Message- From: Jorge Almeida [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 27, 2006 9:37 AM To: John W. Krahn Cc: Perl Beginners Subject: Re: eval problem On Tue, 27 Jun 2006, John W. Krahn wrote: > Jorge Almeida wrote: >> What is happening? > > When find dies a SIGPIPE signa

Re: eval problem

2006-06-27 Thread Jorge Almeida
On Tue, 27 Jun 2006, John W. Krahn wrote: Jorge Almeida wrote: What is happening? When find dies a SIGPIPE signal is sent to the parent process which kills it. Thank you. Putting `$SIG{'PIPE'}="IGNORE";' in the beginning of my program solves my problem. Jorge -- To unsubscribe, e-mail

Apache::Session Error.

2006-06-27 Thread Mike Blezien
Hello, we've been using the Apache/Session module for quiet sometime in many applications, for managing cookie/session management and it works great. But now all of a sudden we've noticed the following error quiet often over the last few days. -- [Tue Jun 27 06:27:39

Re: eval problem

2006-06-27 Thread John W. Krahn
Jorge Almeida wrote: > Can someone help me to understand what's wrong with this? (Or: what I > didn't understand about eval?) > > $ perl -e 'use strict;use warnings;eval{open(OUT,"|file")};eval{print > OUT "aa\n";};eval{close OUT};;' > Usage: file [-bcikLnNsvz] [-f namefile] [-F separator] [-m mag

eval problem

2006-06-27 Thread Jorge Almeida
Can someone help me to understand what's wrong with this? (Or: what I didn't understand about eval?) $ perl -e 'use strict;use warnings;eval{open(OUT,"|file")};eval{print OUT "aa\n";};eval{close OUT};;' Usage: file [-bcikLnNsvz] [-f namefile] [-F separator] [-m magicfiles] file... file -C

Re: What's this error in regex?

2006-06-27 Thread Rob Dixon
Practical Perl wrote: > > I got a warning message from my perl script,it's this: > > Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HERE ?/ at ./.pl line 703. > > The 703st line is in a subroutine,the subroutine is: > > > sub some_sub > { >my $arg1=shift; >my $

Re: disappointing '.*?'

2006-06-27 Thread Rob Dixon
Tom Arnall wrote: > > 1 #!/usr/bin/perl -w > 2 > 3 $_ = " [11] [22] a "; > 4 > 5 #with .*? > 6 $re1 = qr/a|\[.*?\d\d\]/; > 7 $re2 = qr/($re1\s)?$re1/; > 8 ($f) = /($re2)/; > 9 print "with .*? : $f\n"; >10 >11 #without .*? >12 $re1 = qr/a|\[\

Re: substr question

2006-06-27 Thread Rob Dixon
David Gilden wrote: > I am not sure I have the syntax quite right here, any suggestions would be > welcome. > > $line = "Friday, June 23, 2006 12:30 PM" ; > > $last_updated = substr($line, 0, (length($line) -9)); # remove the time > part of time stamp > # the above line is throwing an error Hi