[25849] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8084 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 16 03:05:40 2005

Date: Mon, 16 May 2005 00:05:05 -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           Mon, 16 May 2005     Volume: 10 Number: 8084

Today's topics:
        format <J_dog69@yahoo.com>
    Re: query = new CGI; <segraves_f13@mindspring.com>
    Re: query = new CGI; <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 16 May 2005 16:52:19 +1000
From: "James" <J_dog69@yahoo.com>
Subject: format
Message-Id: <42884317$1@dnews.tpgi.com.au>

if i have an array how can i print all element in the array in a format
block when i don't know the length of the array until run time?

by format block i mean

format = STDOUT
number = @#####
                $num
name = @<<<<<<<<<
             $name
 .
that sort of thing.





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

Date: Mon, 16 May 2005 04:39:55 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: query = new CGI;
Message-Id: <vuVhe.2186$M36.244@newsread1.news.atl.earthlink.net>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns96577282FE30Casu1cornelledu@127.0.0.1...
<snip>
> Upon reading your response, I decided to add a start_html call to my
> snippet to show how it ought to be done, but I have not been able to
> convince CGI.pm to emit a HTML4.01 strict doctype. What would be the
> proper arguments to
>
> $cgi->start_html(
>     -dtd => 'what should I put there for HTML4.01 strict'
>     );
>
> I am beginning to realize why I do not use the HTML generating functions
> of CGI.pm -- too deep for me.
>
> The following does not generate valid HTML either (at least according to
> the HTML validator at http://validator.w3.org/):
>
> use CGI();
> use CGI::Pretty;
>
> my $cgi = CGI->new;
>
> print $cgi->start_html(
>     -dtd      => [
>                     '-//W3C//DTD HTML 4.01//EN',
>                     'http://www.w3.org/TR/html4/strict.dtd',
>                  ],
>     Title => 'Test Document',
> ), $cgi->p('The test was successful'), $cgi->end_html;

Sinan, I tried function-oriented variations of your code, obtaining "This
Page Tentatively Validates As HTML 4.01 Strict". It seems the problem is
caused by a lack of character encoding labeling.

Accordingly, I added a line to (the function-oriented equivalent of) your
code, the output from which the validator finds to be "valid HTML 4.01
Strict":

use strict;
use warnings;
use CGI qw(-no_xhtml :standard);
print
start_html(
    -dtd=>['-//W3C//DTD HTML 4.01//EN',
                'http://www.w3.org/TR/html4/strict.dtd'],
    -head=>'<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=ISO-8859-1">',
    -title=>'Test Document',
),
 p('The test was successful'), end_html;

Note that I ran this script from the command line, saving as HTML. See
http://www.htmlhelp.com/tools/validator/charset.html for the reference I
used for the correct syntax for the META HTTP-EQUIV method that I added.

Hope this helps.
--
Bill Segraves








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

Date: Mon, 16 May 2005 04:47:24 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: query = new CGI;
Message-Id: <Xns96587E3B5D55asu1cornelledu@127.0.0.1>

"Bill Segraves" <segraves_f13@mindspring.com> wrote in
news:vuVhe.2186$M36.244@newsread1.news.atl.earthlink.net: 

> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns96577282FE30Casu1cornelledu@127.0.0.1...
> <snip>
 ...
>> I am beginning to realize why I do not use the HTML generating
>> functions of CGI.pm -- too deep for me.
 ... 
> Sinan, I tried function-oriented variations of your code, obtaining
> "This Page Tentatively Validates As HTML 4.01 Strict". It seems the
> problem is caused by a lack of character encoding labeling.
 ...
> Hope this helps.

Thank you. It does.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 8084
***************************************


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