[23236] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5457 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 7 21:06:07 2003

Date: Sun, 7 Sep 2003 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 7 Sep 2003     Volume: 10 Number: 5457

Today's topics:
    Re: Call PL/SQL procedure from Perl - DBI <r_reidy@comcast.net>
    Re: Help configuring Perl with Apache 2 <cyde@umd.edu>
    Re: Help configuring Perl with Apache 2 <postmaster@castleamber.com>
    Re: Help configuring Perl with Apache 2 <cyde@umd.edu>
    Re: Help configuring Perl with Apache 2 <cyde@umd.edu>
    Re: Help configuring Perl with Apache 2 <postmaster@castleamber.com>
    Re: Help configuring Perl with Apache 2 <cyde@umd.edu>
    Re: Help configuring Perl with Apache 2 <tony_curtis32@yahoo.com>
    Re: Help configuring Perl with Apache 2 <cyde@umd.edu>
    Re: Help configuring Perl with Apache 2 <minceme@start.no>
    Re: How do I count blocks of characters in a string var (Greg)
    Re: How do I count keys in a BerkeleyDB *quickly* (usin (Sam Holden)
        HTML or XHTML in CGI [was: Help configuring Perl...] <noreply@gunnar.cc>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <minceme@start.no>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <noreply@gunnar.cc>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <postmaster@castleamber.com>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <postmaster@castleamber.com>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <noreply@gunnar.cc>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <minceme@start.no>
    Re: HTML or XHTML in CGI [was: Help configuring Perl... <noreply@gunnar.cc>
    Re: Newby Question: Displaying Excel from within my CGI <zoooz@gmx.de>
    Re: Newby Question: Displaying Excel from within my CGI <cyde@umd.edu>
    Re: Newby Question: Displaying Excel from within my CGI <kbass@midsouth.rr.com>
    Re: Newby Question: Displaying Excel from within my CGI <noreply@gunnar.cc>
    Re: Possible bug?; keywords for sub idenifier? <zoooz@gmx.de>
        Problem using TableExtract 1.08 <ddunham@redwood.taos.com>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 07 Sep 2003 17:33:43 -0600
From: Ron Reidy <r_reidy@comcast.net>
Subject: Re: Call PL/SQL procedure from Perl - DBI
Message-Id: <3F5BC057.4040600@comcast.net>

perldoc DBD::Oracle

Sashafay wrote:
> Hi,
> 
> How I can call PL/SQL store procedure from Perl - DBI script?
> 
> Thanks in advance,
> Alex


-- 
Ron Reidy
Oracle DBA



------------------------------

Date: Sun, 07 Sep 2003 06:18:14 -0400
From: "Cyde Weys" <cyde@umd.edu>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <pan.2003.09.07.10.18.13.735046@umd.edu>

On Sun, 07 Sep 2003 14:07:32 -0400, Cyde Weys wrote:


> BTW, as of now, index.pl is this:
> 
> #!/usr/bin/perl
> print("Test\n");

Thanks everyone for all the help.  Reading the error_log for apache was
indeed the key to solving this problem.  I got an error message basically
saying, "Option ExecCGI isn't set in this directory."  Apparently, the
/var/www/html directory was set to allow override none, so even though I
had blanket Options ExecCGI that wasn't being allowed.  So in the
Directory definition for /var/www/html I included Options +ExecCGI ... and
immediately got another error (internal server configuration error).

The logs said the problem was due to bad headers.  Well, DUH, I know how
to use CGI.pm.  So I fixed up my .pl file and everything works now!  If
you want to see my (very pathetic) website, you can check it out here:
http://terpy.student.umd.edu

Once again, thanks a lot to all you helpful guys out there.


------------------------------

Date: Mon, 08 Sep 2003 00:24:46 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <1062973590.890956@halkan.kabelfoon.nl>

Cyde Weys wrote:

> Directory definition for /var/www/html I included Options +ExecCGI ... and
> immediately got another error (internal server configuration error).

:-) He he he :-)

> The logs said the problem was due to bad headers.  Well, DUH, I know how
> to use CGI.pm.  So I fixed up my .pl file and everything works now!  If
> you want to see my (very pathetic) website, you can check it out here:
> http://terpy.student.umd.edu

"<i>See the source <a href = \"index.txt\">here</a>.<br>";

Misses </i>. Which reminds me of an earlier post in this thread wrt 
using the cgi perl stuff (which you did until this line) to prevent 
things like this. Also: validate your pages.

Why does it spit out XHTML?


-- 
Kind regards,       feel free to mail: mail(at)johnbokma.com (or reply)
                     virtual home: http://johnbokma.com/  ICQ: 218175426
John                web site hints: http://johnbokma.com/websitedesign/



------------------------------

Date: Sun, 07 Sep 2003 18:53:24 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <bjgct2$3k8$1@grapevine.wam.umd.edu>

John Bokma wrote:
> Cyde Weys wrote:
Also: validate your pages.

What do you mean, validate my pages?

> Why does it spit out XHTML?

No clue ... is this bad?



------------------------------

Date: Sun, 07 Sep 2003 19:02:38 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <bjgdeb$3pc$1@grapevine.wam.umd.edu>

Abigail wrote:

> Then why you posting here?
> 
> *PLONK*

Because I believed this question was more likely to be answered in the 
Perl newsgroup (which I was right about).  I wasn't expecting to have to 
deal with people like YOU.



------------------------------

Date: Mon, 08 Sep 2003 01:08:05 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <1062976189.431301@halkan.kabelfoon.nl>

Cyde Weys wrote:

> John Bokma wrote:
> 
>> Cyde Weys wrote:
> 
> Also: validate your pages.
> 
> What do you mean, validate my pages?

http://validator.w3.org/

It checks for mistakes in HTML / XHTML.

Has also links to the specs wrt HTML, XHTML, CSS enz.

>> Why does it spit out XHTML?
> 
> No clue ... is this bad?

If you want to output XHTML there are some things you must be aware of. 
I use XHTML currently on parts of my site, but am going to change it 
(back) to HTML 4.01 strict.

If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even bad.

-- 
Kind regards,       feel free to mail: mail(at)johnbokma.com (or reply)
                     virtual home: http://johnbokma.com/  ICQ: 218175426
John                web site hints: http://johnbokma.com/websitedesign/



------------------------------

Date: Sun, 07 Sep 2003 19:17:06 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <bjge9h$484$1@grapevine.wam.umd.edu>

John Bokma wrote:

> If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even bad.

This does appear to be the case.  I am simply doing "print header;" and 
it is assuming I want to use XHTML (which I don't, I don't even know how 
to use it).  Does anyone know how to tell CGI.pm to use different 
headers, i.e. HTML 4.1?  Thanks.



------------------------------

Date: Sun, 07 Sep 2003 18:24:31 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <87pticxjv4.fsf@limey.hpcc.uh.edu>

>> On Sun, 07 Sep 2003 19:17:06 -0400,
>> Cyde Weys <cyde@umd.edu> said:

> John Bokma wrote:
>> If CGI.pm defaults to XHTML I consider this a bit
>> odd. Maybe even bad.

> This does appear to be the case.  I am simply doing
> "print header;" and it is assuming I want to use XHTML
> (which I don't, I don't even know how to use it).  Does
> anyone know how to tell CGI.pm to use different headers,
> i.e. HTML 4.1?

perldoc CGI ?

       -no_xhtml ...

-dtd might also be of interest.

hth
t


------------------------------

Date: Sun, 07 Sep 2003 19:47:40 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <bjgg2r$4vg$1@grapevine.wam.umd.edu>

Vlad Tepes wrote:

> Since you're now plonked by Tad and Abigail, you're not likely to get an
> answer from them.

Yeah, I figure as much.  I'm not stupid.  But sometimes people only say 
*plonk* just to show off or make a statement, but they never actually go 
through with their threat.

> If you know your question belongs in another group, then don't post it
> here. Doing so decreases the signal-to-noise ratio and makes the group
> less useful for the rest of us.

I should have phrased my question more carefully then.  I didn't mean, 
"I know this belongs in another group but I'll post it here just to 
screw with you guys and lower the s/n ratio."  I meant, "Perhaps this is 
more applicable to an Apache newsgroup, but since the question deals 
with how to configure Apache to work WITH PERL, I think I might get more 
knowledgable responses here."



------------------------------

Date: Mon, 8 Sep 2003 00:11:15 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: Help configuring Perl with Apache 2
Message-Id: <bjghf3$p2g$1@troll.powertech.no>

Cyde Weys <cyde@umd.edu> wrote:
> Vlad Tepes wrote:
>
> I should have phrased my question more carefully then.  I didn't mean,
> "I know this belongs in another group but I'll post it here just to
> screw with you guys and lower the s/n ratio."  

Good.

> I meant, "Perhaps this is more applicable to an Apache newsgroup, but
> since the question deals with how to configure Apache to work WITH
> PERL, I think I might get more knowledgable responses here."

I'd like to inform you about these groups:

    comp.infosystems.www.servers
    comp.infosystems.www.authoring.cgi

Asking for help in the proper group is likely to give you the best
resonses.

Hope this helps,
-- 
Vlad



------------------------------

Date: 7 Sep 2003 17:43:55 -0700
From: gdsafford@hotmail.com (Greg)
Subject: Re: How do I count blocks of characters in a string variable?
Message-Id: <a8f367ed.0309071643.3750401b@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<bjdong$hp5o9$1@ID-184292.news.uni-berlin.de>...
> Researcher wrote:
> > I'm trying to create a code to count a certain character in a 
> > string, lets say that I want to know how many letters "o" there are
> > in the text "The book is yellow",
> 
> <snip>
> 
> > what if I want to count a block of characters instead of one only
> > (e.g. how many "el" there are in $text)?
> 
> This method works with both single characters and strings:
> 
>      $text = "The book is yellow";
>      $count++ while $text =~ /o/g;
> 
> Btw, you asked a FAQ. This is where you should have looked up the
> answer:
> 
>      perldoc -q count

Just as an alternative to the regex methods, a common way in some
languages of counting all the character types in a string would be to
use the character code as an array index:

my $text = "The book is yellow";
my @a;

$a[ord(lc $_)]++ for split(//, $text);

print $a[ord('o')], $/;


Not an expert, so FWIW.


------------------------------

Date: 7 Sep 2003 22:14:51 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: How do I count keys in a BerkeleyDB *quickly* (using DB_File)?
Message-Id: <slrnblnber.dae.sholden@flexal.cs.usyd.edu.au>

On 07 Sep 2003 21:09:37 GMT, Abigail <abigail@abigail.nl> wrote:
> Damon Hastings (damonhastings@yahoo.com) wrote on MMMDCLVIII September
> MCMXCIII in <URL:news:76c7896d.0309051913.6bf1afb7@posting.google.com>:
>:)  I have a berkeley db which I'm accessing via the DB_File interface (a
>:)  btree).  I would like a quick way to count how many keys are in the
>:)  file.  If I just use "scalar keys %hash", then it takes forever!  (The
>:)  file has millions of keys.)  Can anyone help me?
> 
> 
> 'scalar keys %hash' is the way to go. The only way to get the number
> of keys from a db hash is to count them.

Of course if the hash is only used by you script (or scripts) then
you could add a 'count' key to the db hash, and keep it up to date
when you modify the hash.

See sig below for the big drawback of that approach...

-- 
Sam Holden

There's no such thing as a simple cache bug.
        --Rob Pike


------------------------------

Date: Mon, 08 Sep 2003 01:39:50 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgfol$j0t55$1@ID-184292.news.uni-berlin.de>

John Bokma wrote:
> I use XHTML currently on parts of my site, but am going to change
> it (back) to HTML 4.01 strict.
> 
> If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even
> bad.

Why? at http://www.w3.org/MarkUp/ I read: "XHTML is the successor of
HTML, and a series of specifications has been developed for XHTML."

Defaulting to a more recent W3C recommendation does not appear odd or
bad to me. Even if I'm not a member of the CGI.pm fan club, this seems
not to be a proper base for criticizing the module.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Sun, 7 Sep 2003 23:46:51 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgg1b$oks$1@troll.powertech.no>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> John Bokma wrote:
>
>> I use XHTML currently on parts of my site, but am going to change
>> it (back) to HTML 4.01 strict.
>> 
>> If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even
>> bad.
>
> Why? at http://www.w3.org/MarkUp/ I read: "XHTML is the successor of
> HTML, and a series of specifications has been developed for XHTML."
>
> Defaulting to a more recent W3C recommendation does not appear odd or
> bad to me. Even if I'm not a member of the CGI.pm fan club, this seems
> not to be a proper base for criticizing the module.

Is it not so that one of the most used browsers have trouble with XHTML?
If this is the case, using XHTML as default could be a bad thing.

-- 
Vlad


------------------------------

Date: Mon, 08 Sep 2003 02:05:02 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgh80$ivhfp$1@ID-184292.news.uni-berlin.de>

Vlad Tepes wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>> Defaulting to a more recent W3C recommendation does not appear
>> odd or bad to me. Even if I'm not a member of the CGI.pm fan
>> club, this seems not to be a proper base for criticizing the
>> module.
> 
> Is it not so that one of the most used browsers have trouble with
> XHTML? If this is the case, using XHTML as default could be a bad
> thing.

I suppose it depends on the nature of the trouble. Btw, which browser
is it?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Mon, 08 Sep 2003 02:40:26 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <1062981730.275190@halkan.kabelfoon.nl>

Gunnar Hjalmarsson wrote:

> John Bokma wrote:
> 
>> I use XHTML currently on parts of my site, but am going to change
>> it (back) to HTML 4.01 strict.
>>
>> If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even
>> bad.
> 
> 
> Why? at http://www.w3.org/MarkUp/ I read: "XHTML is the successor of
> HTML, and a series of specifications has been developed for XHTML."

Well, since XHTML assumes that browsers accept *invalid* HTML like:

<br />

for one. Also when you output XHTML you should send the proper headers. 
I don't know if CGI.pm does this (i.e. text/html for a non-XML browser 
but application/xml-something for an XML browser, have to look that up). 
Also some browsers choke on the XML prolog, see:

http://www.webstandards.org/learn/reference/prolog_problems.html

> Defaulting to a more recent W3C recommendation does not appear odd or
> bad to me.

To me it does. It used to output HTML, now it switches to XHTML 
"suddenly". This happens under the hood. Which is bad. It means that the 
output of your CGI script changes when you update CGI.pm... (or worse, 
when your hosting provider does...)

> Even if I'm not a member of the CGI.pm fan club, this seems
> not to be a proper base for criticizing the module.

See above. It means that an update of CGI.pm changes the output of CGI 
scripts which is bad bad bad. Especially since CGI.pm belongs to the 
core (IIRC). It means people have to update *all* their CGI scripts to 
make it behave as it did in the past. Doesn't that strike you as 
somewhat odd?


-- 
Kind regards,       feel free to mail: mail(at)johnbokma.com (or reply)
                     virtual home: http://johnbokma.com/  ICQ: 218175426
John                web site hints: http://johnbokma.com/websitedesign/



------------------------------

Date: Mon, 08 Sep 2003 02:49:20 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <1062982264.415630@halkan.kabelfoon.nl>

Gunnar Hjalmarsson wrote:

> Vlad Tepes wrote:
> 
>> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>>
>>> Defaulting to a more recent W3C recommendation does not appear
>>> odd or bad to me. Even if I'm not a member of the CGI.pm fan
>>> club, this seems not to be a proper base for criticizing the
>>> module.
>>
>>
>> Is it not so that one of the most used browsers have trouble with
>> XHTML? If this is the case, using XHTML as default could be a bad
>> thing.
> 
> 
> I suppose it depends on the nature of the trouble. Btw, which browser
> is it?

see

http://www.webstandards.org/learn/reference/prolog_problems.html
http://hixie.ch/advocacy/xhtml

the latter was given me in a question regarding which one to choose: 
XHTML 1.0 or HTML 4.01:

<http://groups.google.com/groups?th=b01676c5c4c075fd&seekm=3f2cba65.104919996%40news.cis.dfn.de>



-- 
Kind regards,       feel free to mail: mail(at)johnbokma.com (or reply)
                     virtual home: http://johnbokma.com/  ICQ: 218175426
John                web site hints: http://johnbokma.com/websitedesign/



------------------------------

Date: Mon, 08 Sep 2003 02:51:34 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgjve$itocj$1@ID-184292.news.uni-berlin.de>

John Bokma wrote:
> Gunnar Hjalmarsson wrote:
> 
>> John Bokma wrote:
>>
>>> I use XHTML currently on parts of my site, but am going to change
>>> it (back) to HTML 4.01 strict.
>>>
>>> If CGI.pm defaults to XHTML I consider this a bit odd. Maybe even
>>> bad.
>>
>>
>>
>> Why? at http://www.w3.org/MarkUp/ I read: "XHTML is the successor of
>> HTML, and a series of specifications has been developed for XHTML."
> 
> 
> Well, since XHTML assumes that browsers accept *invalid* HTML like:
> 
> <br />
> 
> for one. Also when you output XHTML you should send the proper headers. 
> I don't know if CGI.pm does this (i.e. text/html for a non-XML browser 
> but application/xml-something for an XML browser, have to look that up). 
> Also some browsers choke on the XML prolog, see:
> 
> http://www.webstandards.org/learn/reference/prolog_problems.html
> 
>> Defaulting to a more recent W3C recommendation does not appear odd or
>> bad to me.
> 
> 
> To me it does. It used to output HTML, now it switches to XHTML 
> "suddenly". This happens under the hood. Which is bad. It means that the 
> output of your CGI script changes when you update CGI.pm... (or worse, 
> when your hosting provider does...)
> 
>> Even if I'm not a member of the CGI.pm fan club, this seems
>> not to be a proper base for criticizing the module.
> 
> 
> See above. It means that an update of CGI.pm changes the output of CGI 
> scripts which is bad bad bad. Especially since CGI.pm belongs to the 
> core (IIRC). It means people have to update *all* their CGI scripts to 
> make it behave as it did in the past. Doesn't that strike you as 
> somewhat odd?
> 
> 


-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Mon, 8 Sep 2003 00:54:46 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgk0m$pqr$1@troll.powertech.no>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:

> Vlad Tepes wrote:
>> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>>> Defaulting to a more recent W3C recommendation does not appear
>>> odd or bad to me. Even if I'm not a member of the CGI.pm fan
>>> club, this seems not to be a proper base for criticizing the
>>> module.
>> 
>> Is it not so that one of the most used browsers have trouble with
>> XHTML? If this is the case, using XHTML as default could be a bad
>> thing.
>
> I suppose it depends on the nature of the trouble. Btw, which browser
> is it?

Internet Explorer.  Some of the problems are explained here:

    http://devedge.netscape.com/viewsource/2003/xhtml-style-script/

-- 
Vlad


------------------------------

Date: Mon, 08 Sep 2003 03:00:55 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HTML or XHTML in CGI [was: Help configuring Perl...]
Message-Id: <bjgkh0$it8cm$1@ID-184292.news.uni-berlin.de>

[sorry for my previous post - pushed the Send button by mistake. :( ]

John Bokma wrote:
> Gunnar Hjalmarsson wrote:
>> Defaulting to a more recent W3C recommendation does not appear
>> odd or bad to me.
> 
> To me it does. It used to output HTML, now it switches to XHTML 
> "suddenly". This happens under the hood.

<snip>

> It means that an update of CGI.pm changes the output of CGI scripts
> which is bad bad bad. Especially since CGI.pm belongs to the core
> (IIRC). It means people have to update *all* their CGI scripts to 
> make it behave as it did in the past. Doesn't that strike you as 
> somewhat odd?

I see your point, but it rather strikes me as a natural consequence of
using a module in such a dynamic area as generating HTML. (Personally
I don't do that.)

What would the alternative be? Never change anything, even if 'the
outside world' changes?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Mon, 08 Sep 2003 01:02:01 +0200
From: Amir Kadic <zoooz@gmx.de>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjgdcl$ies5f$1@ID-142982.news.uni-berlin.de>

kbass@midsouth.rr.com wrote:

> I have created a table from my CGI program with data coming from Postgres
> and I want to now display this table as an Excel file. How can this be
> done? Thanks!
> 
> Kevin

An old excel format (still recognized by newer versions)
uses newlines to separate rows and tabs to separate columns.

Thus, you may want to write something like: 

print join ("\t", @attributes),"\n";

to display a row.

HTH
Amir



------------------------------

Date: Sun, 07 Sep 2003 19:05:55 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjgdkg$3pc$3@grapevine.wam.umd.edu>

Gunnar Hjalmarsson wrote:

> kbass@midsouth.rr.com wrote:

> CGI ... Postgres ... Excel ...
> 
> Do you have a Perl question?

Maybe he wanted to do it with Perl (That's the unspoken assumption I 
garnered from his post, anyway).



------------------------------

Date: Sun, 07 Sep 2003 23:11:35 GMT
From: <kbass@midsouth.rr.com>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <HWO6b.3545$WW5.1970@clmboh1-nws5.columbus.rr.com>


"Cyde Weys" <cyde@umd.edu> wrote in message
news:bjgdkg$3pc$3@grapevine.wam.umd.edu...
> Gunnar Hjalmarsson wrote:
>
> > kbass@midsouth.rr.com wrote:
>
> > CGI ... Postgres ... Excel ...
> >
> > Do you have a Perl question?
>
> Maybe he wanted to do it with Perl (That's the unspoken assumption I
> garnered from his post, anyway).
>

I want to do it in Perl.




------------------------------

Date: Mon, 08 Sep 2003 01:23:22 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjgepo$iovdq$1@ID-184292.news.uni-berlin.de>

Cyde Weys wrote:
> Gunnar Hjalmarsson wrote:
>> CGI ... Postgres ... Excel ...
>> 
>> Do you have a Perl question?
> 
> Maybe he wanted to do it with Perl (That's the unspoken assumption
> I garnered from his post, anyway).

Really? :)  The reason why I pretended not to 'understand' is that
OP's "How can this be done?" doesn't indicate that he had made any own
attempt to find a solution. Such as a simple search for 'Excel' at
search.cpan.org...

Maybe that's just me, but I think it's reasonable to expect some own
effort before asking for help here.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



------------------------------

Date: Mon, 08 Sep 2003 02:43:30 +0200
From: Amir Kadic <zoooz@gmx.de>
Subject: Re: Possible bug?; keywords for sub idenifier?
Message-Id: <bjgjav$ip512$1@ID-142982.news.uni-berlin.de>

Trent Curry wrote:

> I just wondering, why does Perl allow you to use supposedly reserved words
> for a sub (function) identifier?

Why not? 
Can you imagine any trouble resulting from it
(except for human-unreadable code)
?

The interpreter knows what you mean when you call
a method on a blessed reference, doesn't it?

It also has no trouble with main::my, &my, or &my(),
but it will give up when you say just my(), so everything
is just perfect, IMHO.

Amir



------------------------------

Date: Sun, 07 Sep 2003 23:01:24 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Problem using TableExtract 1.08
Message-Id: <8NO6b.12276$FM6.5237@newssvr25.news.prodigy.com>

I'm trying to pull some data out of a table that I retrieve from an HTML
page.  I found HTML::TableExtract and it looks like it could do what I
want.  Is there a better module I should be using or any known problems
with it?

However, I'm having trouble getting the "header" method to behave
exactly like I want.  The first thing I did was to have it print all the
tables from the html to see the bits.   This is the relevant bit of the
code that does that...

# Examine all matching tables
foreach my $ts ($te->table_states) {
  print "Table (", join(',', $ts->coords), "):\n";
  print "MAP (", join(',', $ts->column_map), "):\n";
  foreach my $row ($ts->rows) {
     print join('<>', @$row), "\n";
  }

And then this is the stuff from the top of the table I want...

Table (1,8):
MAP (0,1,2,3,4,5,6,7,8):
[Blah blah blah useless data on top line]<><><><><><><>
Player<>AB<>H<>HR<>RBI<>R<>OPS<>SB<>BA
Abad, Andy 1B BOS<>0<>0<>0<>0<>0<>0.000<>0<>0.0000
[.. table continues]

So I tried the simple "header" extraction method.  If I supply all the
headers from the line that begins "Player", then I get no data.  If I
supply some of the headers, I sometimes get data.  The strange thing is
that simply rearranging the order will change whether or not data is
returned.

my $te = new HTML::TableExtract(
headers => [ "Player","AB","H","HR"],
);

# perl extract
#                 (no data returned).

Change the above to this...

my $te = new HTML::TableExtract(
headers => [ "Player","AB","HR","H"],
);

# perl extract
Table (1,8):
MAP (0,1,3,2):
Abad, Andy 1B BOS<>0<>0<>0
[... more data...]
#

So the order of the headers matters (which I don't think it should).  

Is there any way to use the "headers" to simply select a table (rather
than relying on it being in position (1, 8) for example), but then
returning all columns, or is there something I'm doing wrong here?

Thanks.

-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >


------------------------------

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5457
***************************************


home help back first fref pref prev next nref lref last post