downloading data as text file

2003-03-26 Thread T. Murlidharan Nair
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

2003-02-27 Thread T. Murlidharan Nair
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

2003-02-26 Thread T. Murlidharan Nair
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

2003-02-24 Thread T. Murlidharan Nair
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

2003-01-15 Thread T. Murlidharan Nair
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: A HREF=http://www.activestate.com/PPMPackages/zips/6xx-builds-only/GDTextUtil.zip;Here/A 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]




Nested hash

2002-12-12 Thread T. Murlidharan Nair
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

2002-12-03 Thread T. Murlidharan Nair
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]




fetchrow_hashref

2002-11-14 Thread T. Murlidharan Nair
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]




Another Hash ref question

2002-11-14 Thread T. Murlidharan Nair
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]



Perl MSGraph

2002-10-28 Thread T. Murlidharan Nair
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]



Writings PERL CGI in windows environment

2002-10-28 Thread T. Murlidharan Nair
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 CGI Object handling

2002-09-10 Thread T. Murlidharan Nair

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]