downloading data as text file
Hi!! I need to provide the users that access my database a way to download data as a text file. The data is stored in a mysql database, has anyone done this, if so I would really appreciate their help. Thanks and Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: checking if its a real number
Thanks to all for replying to my questions. Cheers always!! Murli zentara wrote: On Wed, 26 Feb 2003 16:30:56 -0800, [EMAIL PROTECTED] (T. Murlidharan Nair) wrote: I have a cgi that need to accept only numeric values. ie +ve or -ve real numbers. Is there a quick and easy way to check this. I was trying using a reg exp if(/^[-0-9][\.0-9]*/) { do something } but this breaks when the number is say --75.4 It still accepts if it has two - signs. $_ = 4.01; if (/\D/){ print "has nondigits\n" } if (/^\d+$/) { print "is a whole number\n" } if (/^-?\d+$/) { print "is an integer\n" } if (/^[+-]?\d+$/){ print "is a +/- integer\n" } if (/^-?\d+\.?\d*$/) { print "is a real number\n" } if (/^-?(?:\d+(?:\.\d*)?|\.\d+)$/) { print "is a decimal number\n" } if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/) { print "a C float\n" } ° Also check out the Regex::Common module, it has number-type detection. - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
checking if its a real number
I have a cgi that need to accept only numeric values. ie +ve or -ve real numbers. Is there a quick and easy way to check this. I was trying using a reg exp if(/^[-0-9][\.0-9]*/) { do something } but this breaks when the number is say --75.4 It still accepts if it has two - signs. Thanks for your help. Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NULL insertion
Hi!! I need to insert NULL into the database using a perl CGI . So if a variable is to be made NULL in perl and it needs to be used in an sql statement what is best way to do it. Do I assign ' \N' to it or 'NULL' ? Thanks and Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Graphs on the fly
Does this work for Unix? Which module do I use for Unix ... Thanks and Cheers always!! Murli [EMAIL PROTECTED] wrote: In a message dated 1/14/2003 4:33:13 PM Eastern Standard Time, [EMAIL PROTECTED] writes: Can anybody tell me how to install GD for Active State Perl? Thanks a lot. Go: http://www.activestate.com/PPMPackages/zips/6xx-builds-only/GDTextUtil.zip";>Here and download GD.zip. Unzip, and chdir to the directory you downloaded to. Then do "ppm install GD.ppd" Repeat with GDGraph. - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Graphs on the fly
Hi !! Does any one have a module that I can use to generate bar graphs using a cgi ? Thanks and Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nested hash
Hi!! I have a CGI that updated a mysql database, I have a nested hash structure in it. something like $repeats{$solID[i]}{$expId[i]}{$elemenet[$i]}=1 If I am to check this hash is the inner loop written as foreach $k1 (keys %repeats){ foreach $k2 (keys %repeats{$k1}) { foreach $k3( keys %repeats{$k1}{$k2}){ if ($repeats{$k1}{$k2}{$k3} ==1){ print "I got it\n"; } } } } Is this correct ?? Thanks and Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Checking for existance for data in a column
Hi!! I have a CGI that looks up data from a mysql data base and does a bunch of calculations. I only want to do calculations on the columns which contains any data. What I mean is for some colums there is no data available at all. So I don't want to do any calculations on them obviously. How do I check whether the column contains data, once I have retrived all the data using fetchrow_hashref(). Thanks and Cheers alway!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another Hash ref question
I am writing this as part of a module, so it prints fine in the main but not in the method... Any suggestions . sub new{ while (my $hashRef = $sth->fetchrow_hashref()) { foreach $keys(keys %$hashRef){ $self->{'_colData'}{$keys}=$$hashRef{$keys}; print "$self->{'_colData'}{$keys}\n"; # IT PRINTS FINE HERE #print "$keys\t"; #print "$$hashRef{$keys}\n"; } } } sub dump{ my $self = shift; my ($keys, $n_col, $n_row); foreach $keys(keys (%{$self->{'_colData'}})){ print $self->{'_colData'}{$keys}; IT IS NOT DOING IT HERE, I CALLING THE METHODS PROPERLY } my $getchar =<>; } Thanks and cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
fetchrow_hashref
Hi!! I am retriving data in a while loop using fetchrow_hashref How do I assign it to another hash. I am trying the following while (my %hashRef =$sth->fetchrow_hashref()){ foreach $keys (keys %hashRef){ print $keys; print "$hashRef{$keys}\t"; } print "\n"; } Its does not return me anything. Please let me know if there is a better way to handle it. Thanks and cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Writings PERL CGI in windows environment
Hi!! Has any one written something similar to using a LWP user agent under windows environment ? If you have an example code that greatly help. Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl MSGraph
Hi!! I must confess this is not a Perl CGI question, but,since we have some Perl gurus here I am taking the liberty to ask this question, hoping that someone might be able to help me out. Has anyone used the MSGraph module developed by Mark Solomon? I am getting having problems with his example code. It is asking for some dec2hex.pl file. The example code does not provide them. The code contains a statement requires dec2hex.pl .. I tried other examples which does not contain this, then it complains by saying Can't locate object method "gif" via package "GD: :Image" at pie.pl line 19 The URL for MSGraph is http://www.seva.net/~msolomon/MSGraph/ I would really appreciate if someone could help. Thanks and Cheers always!! Murli - Department 0537, San Diego Supercomputer Center University of California, San diego, La Jolla, CA 92093, USA Lab: 858-822-0887 Res: 858-277-8809 http://www.sdsc.edu/~nair - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl CGI Object handling
Hi !! Well, I am not sure how to pose this question properly, but let me give it a try. I am have a cgi that reads the file and loads it into a mysql database. The entire file is read as an object and the methods associated with that object then does all the work like chacking the data formats and loading the file in to the database. Once I have created the object is it possible throw something to the browser and access that object back again. What I want to avoid here is the reading of the file and intantiating the object again. Thanks Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Oracle stored procedures and Perl CGI
Hi All: This for the benifit of all. I had a wonderful time discussing this topic with David Kirol (one of the members in the list) and was finally able to solve it. David had the following comments " I can think of two approaches. The first involves dynamically creating a temporary table to hold the result set your procedure currently prints, then using a Perl/DBI query to fetch the results in a while loop (as you tried in the script below). The other approach is actually easier to dream up than it is to realize, and infact may not work with the perl DBI module. It goes as follows: Create a package and define in it a REF CURSOR and a function or procedure to accept the query parameters and return the REF CURSOR. That much is straight forward (and works from SQL*+) but I am stalled as to how to handle the returning REF CURSOR in perl/DBI HTH " For handling the perl/DBI part use the DBD::Oracle qw(ORA_RSET) I was actually able to get it to work. Cheers always!! Murli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]