RE: Table display speed: can be improved?

2001-07-20 Thread Bradley M. Handy

try this:

my $row;
print "";
while($row = $dbh->fetch()) {
print Tr([td([@$row[1..18]])]);
}
print "";

This only pulls a database resultset row into memory when you need.  In your
earlier example you pull everything into memory first and then print it out.
This can be quite inefficient.  I'm not sure how much this will speed up
your load time, if any, but it theoretically should work.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 20, 2001 7:07 AM
> To: [EMAIL PROTECTED]
> Subject: Table display speed: can be improved?
>
>
> Hi,
>
>   I have to display some tables with several hundreds of rows in one
> page. It takes more than 30s for 150 rows with that code:
>
> $recordset = $dbh->selectall_arrayref($query, undef);
>
> print "";
> foreach $row(@$recordset)
>

>   print Tr([td([@$row[1..18]])]);
>   }
> print "";
>
>
> Has anyone a clue how to improve that to some seconds?
>
> Thanks,
>
> Yann
>
>
> ===
> De verzonden informatie is uitsluitend bestemd voor de geadresseerde
> natuurlijke persoon of rechtspersoon en bevat mogelijk
> vertrouwelijke en/of
> geprivilegeerde gegevens. Met uitzondering van de geadresseerde persoon is
> het niet toegestaan de informatie openbaar te maken, te kopiëren, te
> verspreiden of anderszins actie te ondernemen op basis van de informatie.
> Indien u de informatie abusievelijk heeft ontvangen, neem dan
> contact op met
> de afzender en verwijder de informatie uit alle computers. Dutchtone staat
> niet in voor de juiste en complete verzending van de informatie,
> noch is zij
> aansprakelijk voor de vertraagde ontvangst hiervan.
>
> The information transmitted is intended exclusively for the
> person or entity
> to which it is addressed and may contain confidential and/or privileged
> material. Any disclosure, copying, distribution or other action
> based upon
> the information by persons or entities other than the intended
> recipient is
> prohibited. If you receive this information in error, please contact the
> sender and delete the material from any and all computers. Dutchtone does
> not warrant a proper and complete transmission of this
> information, nor does
> it accept liability for any delays.
> ===
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Needing a script to... [ make .doc files ]

2001-07-20 Thread ebgb

Hello Susan and cgi group.


On Tue, Jul 17, 2001 at 10:57:35AM -0700, Susan wrote:

> Does anyone know of a cgi or perl script that will work for taking the information 
>from an online form, inputting the data onto a form on a word doc and then having 
>that word doc form emailed to the email address?  I know this can be done though I 
>can not quite work myself through this one. Thanks for any info...


I am working on something to do this as my company insists on having documentation
submitted in .doc format. I would much prefer to use .html and so should you if
at all possible.  In particular they make me submit Service-Requests in .doc which
is _very_ annoying as it means firing up StarOffice just to inform them that there
is _yet_ another IIS problem that needs fixing. :)  At the moment I have a script
that can generate the appropriate .doc by prompting for the text for each field
and fill in the template doc.  I do not have a web-inteface on it yet but I'm
working on that.  I couldn't use any of the OLE modules as I only use Gnu/Linux
by choice :)  Enough chat, time for how it works;  Nothing clever really.  I just
used StarOffice once to place markers in each field, such as "abababababa"
and then use s/// to replace the markers with the content you want.  You have
to be careful to maintain the same number of characters but you can pad with
spaces.  This isn't ideal as it doesn't allow you to edit a document other than
the prepared template but I might try and do something with storeing the offsets
and trying to combine that with some regex to be able to make a good guess at
where the data is.  I think it would be very difficult to change fonts or put
in more data than the template allowed unless you knew how .doc files work.

If there is any interest I will post the code to the group when I have a web-
interface otherwise I'd be flamed for not using CGI.pm :)  


On a related note;  Has any one made the OLE modules work under Gnu/Linux?  Would
it be possible to do something with WINE?  It would be very handy for work to be
able to get inside windows apps and files from my preferred environment.  Alternativly
has anyone tried anything like having a script running under NT with the OLE hooks
and communicating with a script under Un*x over a network connection?

Apologies for the long post.  I'm rambleing.

Regards all.

EbGb.
--
404 Not Found.
The requested sig://humourous.quote was not found on this server.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Table display speed: can be improved?

2001-07-20 Thread yann . combarnous

Hi,

I have to display some tables with several hundreds of rows in one
page. It takes more than 30s for 150 rows with that code:

$recordset = $dbh->selectall_arrayref($query, undef);   

print "";
foreach $row(@$recordset) 
{   
print Tr([td([@$row[1..18]])]); 
}
print "";


Has anyone a clue how to improve that to some seconds?

Thanks,

Yann


===
De verzonden informatie is uitsluitend bestemd voor de geadresseerde
natuurlijke persoon of rechtspersoon en bevat mogelijk vertrouwelijke en/of
geprivilegeerde gegevens. Met uitzondering van de geadresseerde persoon is
het niet toegestaan de informatie openbaar te maken, te kopiëren, te
verspreiden of anderszins actie te ondernemen op basis van de informatie.
Indien u de informatie abusievelijk heeft ontvangen, neem dan contact op met
de afzender en verwijder de informatie uit alle computers. Dutchtone staat
niet in voor de juiste en complete verzending van de informatie, noch is zij
aansprakelijk voor de vertraagde ontvangst hiervan.

The information transmitted is intended exclusively for the person or entity
to which it is addressed and may contain confidential and/or privileged
material. Any disclosure, copying, distribution or other action  based upon
the information by persons or entities other than the intended recipient is
prohibited. If you receive this information in error, please contact the
sender and delete the material from any and all computers. Dutchtone does
not warrant a proper and complete transmission of this information, nor does
it accept liability for any delays.
===



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: new one...

2001-07-20 Thread Brent Michalski


I see a couple things here that are common mistakes that can be real hard
to find if you are just starting out

Also, you CAN use a here document without quoting the end tag...  So that
is probably not the problem...

... code ...

>   if ($guess = "") {
OOPS!  With ($guess = "") you are assigining an empty string to $guess.
This will ALWAYS return true!  You either meant == for numbers or eq for
text.

... code ...

>   } elsif ($guess = "toe") {
OOPS, here is the same error.  This time you are assigning "toe" to $guess.

>   ) else (
OOPS again, this will cause the program not to compile!  You used:
) else (

instead of:

} else {

The braces make a BIG difference!!!



Hope this helps!

Brent



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: new one...

2001-07-20 Thread Bradley M. Handy

In my experience with Perl, whenever you use the construct 'print
<<"tag_name";' you need to surround it with either single quotes (') or
double quotes (").  That's the only thing that I see that could be wrong.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]

> -Original Message-
> From: bc [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 6:04 PM
> To: [EMAIL PROTECTED]; Mel Matsuoka
> Subject: new one...
>
>
> new error, darn, i wish the browser would print the errored line #, any
> ideas yall?
>
> Execution of customgame.pl aborted due to compilation errors.
>
> was the error...
> here was my page...
>
> #!/usr/bin/perl -w
> use CGI::Carp qw(fatalsToBrowser);
> #howdy
> use CGI qw(param);
>
> print< content-type: text/html
>
> 
> customgame
> 
> 
> end_of_html_start
>
> $guess = param("guess");
> $name = param("name");
>   if ($guess = "") {
>  if ($name eq "") {
>  print ("hello there, please enter name here: action=customgame.pl> value=enter>");
>  } elsif ($name eq "randal") {
>  print ("hi, since you're $name , you do not have to guess the secret
> word!");
>  } else {
>  print ("your not randal, so you have to guess the secret word: method=post action=customgame.pl> type=submit value=enter>");
>  print ("hello there, please enter another name here: action=customgame.pl> value=enter>");
>   }
>   } elsif ($guess = "toe") {
>   print ("you guessed it!  good job bossman!");
>   print ("go read the http://www.abcnews.com>news");
>   ) else (
>   print ("Wrong! http://toes.netfirms.com>go again...");
>   }
>
> print< 
> END
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: e-mailing HTML form results

2001-07-20 Thread Mel Matsuoka

At 07:57 AM 07/20/2001 -0400, Helen Dickey wrote:
>Thank you so far.  I now get
>"(myfile).pl has too many errors." when I try my perl script.
>Is there any debugging tool for perl scripts?

perldoc perldebug

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: e-mailing HTML form results

2001-07-20 Thread Helen Dickey

Thank you so far.  I now get
"(myfile).pl has too many errors." when I try my perl script.
Is there any debugging tool for perl scripts?
Helen



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Can't convert big5 to utf-8

2001-07-20 Thread Michael R. Fahey

I'd like to take some strings encoded in big5, convert them to utf-8,
and send them to the browser. The following script runs but doesn't
convert the strings correctly. The cgi is run by Apache on Redhat 7.1.
Perl is 5.6.0. Have I garbled the syntax for Unicode::Map and
Unicode::String?
Thanks,

Michael Fahey

#!/usr/bin/perl -w

#uni.pl

use CGI;
use Unicode::Map;
use Unicode::String qw(utf8 latin1 utf16);

my $Map = new Unicode::Map("BIG5"); 

my $cgi = new CGI;
$cgi->charset('utf-8');
print $cgi->header();
print $cgi->start_html();

my $data_file = '../data/uni.txt'; #see below for contents of uni.txt
open (IN, $data_file) or die "Couldn't open $data_file: $!\n";

#print some test unicode characters

print "\x{263A}", "","\x{263B}", "",
"\x{2630B}", "", "\x{7C70}", "";
while (){
chomp;
print "This is the raw string: $_", "";
my $utf16 = $Map ->to_unicode ($_);
print $utf16, "";
my $u = utf8($utf16);
print $u->utf8;
print "";


}
print $cgi->end_html();


##uni.txt###
uni.txt contains the characters for 'big', 'middle', and 'small' in
following three lines:

¤j
¤¤
¤p



Re: How to send a notification mail from Windows/NT?

2001-07-20 Thread Maxim Berlin

Hello David,

Friday, July 20, 2001, Nazary, David <[EMAIL PROTECTED]> wrote:

ND> Hi,

ND> When I use the following script to send mail: 

[...]
ND> I get this error message. Any ideas how I can resolve this?

C:\CM\utils>>c:\perl\bin\perl  smtp_mailer2.pl
ND> The system cannot find the path specified.
ND> Use of uninitialized value in scalar assignment at
ND> c:/Perl/site/lib/Net/Domain.pm line 191.
ND> Use of uninitialized value in scalar assignment at
ND> c:/Perl/site/lib/Net/Domain.pm line 191.
ND> Use of uninitialized value in pattern match (m//) at
ND> c:/Perl/site/lib/Net/Domain.pm line 215.
ND> Use of uninitialized value in split at c:/Perl/site/lib/Net/Domain.pm line
ND> 219.

looks like your perl installation damaged. try to reinstall.

Best wishes,
 Maximmailto:[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]