[15797] in Perl-Users-Digest
Perl-Users Digest, Issue: 3210 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 30 18:06:05 2000
Date: Tue, 30 May 2000 15:05:29 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959724328-v9-i3210@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 30 May 2000 Volume: 9 Number: 3210
Today's topics:
500 Server Error on require <luisr@juanadiaz.org>
Re: 500 Server Error on require <tina@streetmail.com>
Re: 500 Server Error on require <iceheart@iceheart.org>
Re: 500 Server Error on require <red_orc@my-deja.com>
Re: 500 Server Error on require <luisr@juanadiaz.org>
Re: 500 Server Error on require <tony_curtis32@yahoo.com>
Re: a totally lame question: passwords on pages (Clinton A. Pierce)
Re: Algorythm needed for copying subdirectory hierarchi (Abigail)
Basic question <nipankar@eng.fsu.edu>
Re: Basic question <makarand_kulkarni@My-Deja.com>
Re: can perl do expire page like asp (Abigail)
Re: capturing password via Basic Auth <flavell@mail.cern.ch>
Re: capturing password via Basic Auth (Malcolm Dew-Jones)
Re: capturing password via Basic Auth <tony_curtis32@yahoo.com>
Re: capturing password via Basic Auth (brian d foy)
Re: capturing password via Basic Auth <flavell@mail.cern.ch>
CGI Forms: Save File Dialog instead of processing form 9jerry9@my-deja.com
Re: CGI.pm function list/definitions <dave@dave.org.uk>
Re: CGI.pm function list/definitions <derek@ccil.org>
Re: CGI.pm function list/definitions <dave@dave.org.uk>
Re: CGI.pm function list/definitions <derek@ccil.org>
Re: CGI.pm function list/definitions <jboesNOjbSPAM@qtm.net.invalid>
Re: command line argument (newbie) (Kragen Sitaker)
Re: Converting an alphanumeric string into an integer n (Abigail)
Re: Embedded new lines in a comma delimited file joseph_stiehm@my-deja.com
Re: Foreach Statement (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 May 2000 14:45:27 -0300
From: "Luis E. Rodriguez" <luisr@juanadiaz.org>
Subject: 500 Server Error on require
Message-Id: <sj834pgm5pj105@corp.supernews.com>
I am working on a web site that does most of its job via Perl scripts.
There is a whole host of small scripts for doing specific tasks but there is
also a good number of subroutines that are common to nearly all scripts. I
put all those subroutines in a separate library file that is called at the
beginning of the scripts using a "require" statement.
This library in turn calls a second library which contains file and data
directory information which, again, is common among all scripts. Finally
this second library calls a third one which contains many configurable
parameters which can be modified at will by the web site operator.
All this work properly. If there is a better way to handle these nested
libraries, please let me know.
But this is not the problem at hand. Within this main library there are two
subroutines that are used by just two scripts. These two subroutines
together are about as large as the other subroutines in the library put
together. So I decided to move these two lage subroutines into their own
library to be called by another "require" statement in the scripts where
they are used.
The problem is that now the two scripts which call this library via
"require" fail with a 500 server error. The scripts and the library have
proper sintax as verified by a sintax checker my web hosting provider has.
I don't have telnet shell access so I am stuck with what I have got. All
file permissions are set properly (755) and the libraries have been uploaded
as ASCII via FTP.
What can cause this kind of error when dealing with libraries?
When the subroutines now in a separate library were in the main library they
worked properly. The subroutines were not changed in any way, just moved to
a separate file. And the scripts that use them were not changed either
except for the extra "require".
Thanks for any suggestions.
P.S.: If the answer is somewhere in perldoc, please provide me with a web
site where I can find it. I don't have shell access to Perl or perldoc in
my provider.
------------------------------
Date: 30 May 2000 19:07:49 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: 500 Server Error on require
Message-Id: <8h13i5$268tc$16@fu-berlin.de>
hi,
Luis E. Rodriguez <luisr@juanadiaz.org> wrote:
> [a lot...]
> The problem is that now the two scripts which call this library via
> "require" fail with a 500 server error. The scripts and the library have
> proper sintax as verified by a sintax checker my web hosting provider has.
> I don't have telnet shell access so I am stuck with what I have got. All
> file permissions are set properly (755) and the libraries have been uploaded
> as ASCII via FTP.
hm, could you just shortly describe what the error message is?
if you only get a 500 server error try out to use
CGI::Carp 'fatalsToBrowser';
and it would be a good idea to download a webserver and a
perl distribution to try out your scripts offline, so
you can see compile errors.
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Tue, 30 May 2000 19:24:28 GMT
From: IceHeart <iceheart@iceheart.org>
Subject: Re: 500 Server Error on require
Message-Id: <sh48jsglu4lpi7dijggumsk81hhl5oajja@4ax.com>
On Tue, 30 May 2000 14:45:27 -0300, "Luis E. Rodriguez"
<luisr@juanadiaz.org> wrote:
>I am working on a web site that does most of its job via Perl scripts.
>There is a whole host of small scripts for doing specific tasks but there is
>also a good number of subroutines that are common to nearly all scripts. I
>put all those subroutines in a separate library file that is called at the
>beginning of the scripts using a "require" statement.
>
>This library in turn calls a second library which contains file and data
>directory information which, again, is common among all scripts. Finally
>this second library calls a third one which contains many configurable
>parameters which can be modified at will by the web site operator.
>
>All this work properly. If there is a better way to handle these nested
>libraries, please let me know.
>
>But this is not the problem at hand. Within this main library there are two
>subroutines that are used by just two scripts. These two subroutines
>together are about as large as the other subroutines in the library put
>together. So I decided to move these two lage subroutines into their own
>library to be called by another "require" statement in the scripts where
>they are used.
>
>The problem is that now the two scripts which call this library via
>"require" fail with a 500 server error. The scripts and the library have
>proper sintax as verified by a sintax checker my web hosting provider has.
>I don't have telnet shell access so I am stuck with what I have got. All
>file permissions are set properly (755) and the libraries have been uploaded
>as ASCII via FTP.
>
>What can cause this kind of error when dealing with libraries?
>
>When the subroutines now in a separate library were in the main library they
>worked properly. The subroutines were not changed in any way, just moved to
>a separate file. And the scripts that use them were not changed either
>except for the extra "require".
>
>Thanks for any suggestions.
>
>P.S.: If the answer is somewhere in perldoc, please provide me with a web
>site where I can find it. I don't have shell access to Perl or perldoc in
>my provider.
Required files sometimes have to have a "return" at the end,
outside any loops.
Try adding a return statement.
---------
Kris Thomson (kris@simple.com)
Lead Programmer,
Simple.Com
416.642.3000 x2507
------------------------------
Date: Tue, 30 May 2000 20:19:01 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: 500 Server Error on require
Message-Id: <8h17n2$r38$1@nnrp1.deja.com>
In article <sh48jsglu4lpi7dijggumsk81hhl5oajja@4ax.com>,
IceHeart <iceheart@iceheart.org> wrote:
> On Tue, 30 May 2000 14:45:27 -0300, "Luis E. Rodriguez"
> <luisr@juanadiaz.org> wrote:
>
> >What can cause this kind of error when dealing with libraries?
> >
> >When the subroutines now in a separate library were in the main
library they
> >worked properly. The subroutines were not changed in any way, just
moved to
> >a separate file. And the scripts that use them were not changed
either
> >except for the extra "require".
> >
> >Thanks for any suggestions.
> >
> >P.S.: If the answer is somewhere in perldoc, please provide me with a
web
> >site where I can find it. I don't have shell access to Perl or
perldoc in
> >my provider.
>
> Required files sometimes have to have a "return" at the end,
> outside any loops.
>
> Try adding a return statement.
required files return true.
try putting, as the last line:
1;
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 30 May 2000 16:53:44 -0300
From: "Luis E. Rodriguez" <luisr@juanadiaz.org>
Subject: Re: 500 Server Error on require
Message-Id: <sj8al94t5pj69@corp.supernews.com>
IceHeart wrote in message ...
>>What can cause this kind of error when dealing with libraries?
>>
> Required files sometimes have to have a "return" at the end,
>outside any loops.
>
> Try adding a return statement.
That did it. Thank you very much. I found out (and also suggested here in
another post) that ending the library script with "1;" would work too. Just
to be sure I put "return 1;" after any initialization code or as the first
line if all code was just subroutines.
------------------------------
Date: 30 May 2000 15:59:30 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: 500 Server Error on require
Message-Id: <87em6jsqj1.fsf@limey.hpcc.uh.edu>
>> On Tue, 30 May 2000 16:53:44 -0300,
>> "Luis E. Rodriguez" <luisr@juanadiaz.org> said:
> IceHeart wrote in message ...
>>> What can cause this kind of error when dealing with
>>> libraries?
>>>
>> Required files sometimes have to have a "return" at the
>> end, outside any loops.
>>
>> Try adding a return statement.
> That did it. Thank you very much. I found out (and
> also suggested here in another post) that ending the
> library script with "1;" would work too. Just to be
> sure I put "return 1;" after any initialization code or
> as the first line if all code was just subroutines.
As explained, indeed, in the documentation:
$ perldoc -f require
The file must
return true as the last statement to indicate
successful execution of any initialization code,
so it's customary to end such a file with `1;'
unless you're sure it'll return true otherwise.
But it's better just to put the `1;', in case you
add more statements.
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Tue, 30 May 2000 20:17:03 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: a totally lame question: passwords on pages
Message-Id: <3lVY4.94899$h01.678529@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <tjTY4.9$4N6.534@typhoon.nyu.edu>,
"Edward Grinvald" <eg344@nyu.edu> writes:
> Hi, please forgive my ignorance, but what is "the best" way to put password
> protection on a page?
To read your web server's documentation and to ask in an appropriate group.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: 30 May 2000 21:10:06 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <8h1ane$4s1$1@news.panix.com>
On Mon, 29 May 2000 09:41:45 GMT, Makau Divangamene <makau@multimania.com> wrote
++ I have a subdirectories hierarchy that is so deep that doing a "cp -R"
++ for a recursive copy doesn't work. Indeed The directory tree is so
++ complex it can't fit into memory so I always get an "OUT OF MEMORY"
++ error. This is very crictical because it is for backup purposes ....
Well, I suggest getting a better implementation of cp...
++ So what I want to do is write an algorythm (using Perl) that will copy
++ the hole directory tree with all its files (recursively) by doing -
++ basically - a "cd <src/dir>; md <dest/dir>, cp * <dest/dir>, etc ..."
++
++ For example with the following directory tree :
++ /
++ dir1
++ dir2
++ dir3
++ dir4
++ dir5
++
++ It should do :
++ cd dir1
++ mkdir <dest/dir1>
++ cp * <dest/dir1>
Well, if cp -R gets an out of memory, it's most likely it fails because
of a single file that's too big, hence, the cp * is going to fail somewhere
as well.
I won't do this in Perl, but if I had to, I would do:
perl -e 'system "cd /; tar cfp - * | (cd /dest; tar xf -)"'
Abigail
------------------------------
Date: Tue, 30 May 2000 15:06:36 -0400
From: "Deepti" <nipankar@eng.fsu.edu>
Subject: Basic question
Message-Id: <8h13jg$iqm$1@news.fsu.edu>
Hi!
I have read at many IC -design companies' websites that they need people who
know VHDL/VERILOG and Perl.
Can anybody tell me whats the use of Perl with VHDL/Verilog? Any specific
application?
Where can I find a good tutorial to start with Perl?
-Deepti
------------------------------
Date: Tue, 30 May 2000 14:04:42 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Basic question
Message-Id: <39342CEA.9C088AD6@My-Deja.com>
> I have read at many IC -design companies' websites that they need people who
> know VHDL/VERILOG and Perl.
> Can anybody tell me whats the use of Perl with VHDL/Verilog? Any specific
> application?
There could be many reasons.
(1) Usage of Perl as a scripting or a glue language throughout the
organization.
(2) Some good perl modules are available to work with Verilog/VHDL etc.
check http://www.ultranet.com/~wsnyder/veripool/verilog-perl.html
--
------------------------------
Date: 30 May 2000 21:42:12 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: can perl do expire page like asp
Message-Id: <8h1cjk$59q$3@news.panix.com>
On Sat, 27 May 2000 10:18:05 -0700,
Chung Derek <dchk_78NOdcSPAM@yahoo.com.invalid> wrote:
++ i think everyone have seen asp program. when someone clicks the
++ back button of the browser, a page comes up telling the page
++ have expired.
++
++ i would like to know if there is a way to do that in perl
That's a (mis)feature of a particular browser, triggered by something
in the HTTP specification.
That has as much to do with Perl as a recipe for frog legs.
Abigail
------------------------------
Date: Tue, 30 May 2000 20:45:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: capturing password via Basic Auth
Message-Id: <Pine.GHP.4.21.0005301958460.6082-100000@hpplus01.cern.ch>
On Tue, 30 May 2000, Kurt Krieger wrote:
> Getting the username is trivial ($ENV{'REMOTE_USER'}, or CGI.pm's
> user_name() sub), but I can't figure out how to get the password.
That's because the web server doesn't make it available to CGI
scripts, for security reasons.
Making the plain-text password available may be feasible (by modifying
the server), but has significant security implications for this
already relatively insecure procedure. There's some notes about it in
the Apache distribution, as I recall: look for the build option
SECURITY_HOLE_PASS_AUTHORIZATION (I think the name was chosen to
discourage from using it, which is probably a wise move!).
Ideally you should be looking for some alternative way for the two
servers to convince each other that the client is authentic. Using a
central authentication server might be one possibility. The details of
this would go beyond the scope of this kind of answer.
I've narrowed f'ups, but I strongly recommend redirecting further
discussion to the web servers group where your OS is on topic
(comp.infosystems.www.servers.unix or whichever), or conceivably to
comp.infosystems.www.authoring.cgi
Suggestions on posting style:
It's generally considered inappropriate to cross-post to several
closely-related groups: an issue is usually considered on-topic to
xxx.misc when there is no more-appropriate xxx.[specific] group for
it, and vice versa.
Cross-posting is useful, but it's best kept for situations where a
topic is genuinely relevant to groups that otherwise have little
relationship to each other. On top of that, comp.lang.perl is
obsolete, and, as it happens, your question turns out to be more
appropriate elsewhere, though maybe this wouldn't be obvious
beforehand, I don't know. (Me, I'd think it only too obvious how
non-Perl-specific CGI issues are regularly rebuffed on c.l.perl.*,
but maybe I'm just over sensitive...).
--
Public service announcement: Please ignore the troll.
------------------------------
Date: 30 May 2000 12:58:42 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: capturing password via Basic Auth
Message-Id: <39341d72@news.victoria.tc.ca>
Alan J. Flavell (flavell@mail.cern.ch) wrote:
: On Tue, 30 May 2000, Kurt Krieger wrote:
: > Getting the username is trivial ($ENV{'REMOTE_USER'}, or CGI.pm's
: > user_name() sub), but I can't figure out how to get the password.
: That's because the web server doesn't make it available to CGI
: scripts, for security reasons.
: Making the plain-text password available may be feasible (by modifying
: the server), but has significant security implications for this
I think that the browser encrypts the password before sending it, so the
web server just sees an encrypted password. This protects the plain text
of the user's password for use in other situations, so for example you
couldn't use the web password to login to the user's NT computer even if
the web page and the computer both used the same password.
Of course if you know the authorization method and the userid supplied
then you could look for the encrypted password in the userid database on
the server. I guess this might be useful to pass on the encyrpted
password to another web server to access pages protected with the same
userid/password.
------------------------------
Date: 30 May 2000 15:31:32 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: capturing password via Basic Auth
Message-Id: <87hfbfsrtn.fsf@limey.hpcc.uh.edu>
>> On 30 May 2000 12:58:42 -0800,
>> yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) said:
> Alan J. Flavell (flavell@mail.cern.ch) wrote: : On Tue,
> 30 May 2000, Kurt Krieger wrote:
> : > Getting the username is trivial
> ($ENV{'REMOTE_USER'}, or CGI.pm's : > user_name() sub),
> but I can't figure out how to get the password.
> : That's because the web server doesn't make it
> available to CGI : scripts, for security reasons.
> : Making the plain-text password available may be
> feasible (by modifying : the server), but has
> significant security implications for this
> I think that the browser encrypts the password before
> sending it, so the web server just sees an encrypted
> password. This protects the plain text of the user's
> password for use in other situations, so for example you
The browser *encodes* the password in Base64 for the Basic
authentication scheme.
See http://www.ietf.org/rfc/rfc2617.txt, section 2, "Basic
Authentication Scheme".
Easy to extract and decode. Thus it's (usually) vital to
keep login userIDs and passwords separate from WWW ones.
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Tue, 30 May 2000 16:43:37 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: capturing password via Basic Auth
Message-Id: <brian-ya02408000R3005001643370001@news.panix.com>
[followups set]
In article <39341d72@news.victoria.tc.ca>, yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) posted:
> Alan J. Flavell (flavell@mail.cern.ch) wrote:
> : On Tue, 30 May 2000, Kurt Krieger wrote:
> : > Getting the username is trivial ($ENV{'REMOTE_USER'}, or CGI.pm's
> : > user_name() sub), but I can't figure out how to get the password.
> : That's because the web server doesn't make it available to CGI
> : scripts, for security reasons.
> I think that the browser encrypts the password before sending it, so the
> web server just sees an encrypted password.
don't think whenyou can know. in Basic authentication, the username
and password are not encrypted. see the HTTP specification (referenced
in the CGI Meta FAQ) for details.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Tue, 30 May 2000 23:06:00 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: capturing password via Basic Auth
Message-Id: <Pine.GHP.4.21.0005302254380.4744-100000@hpplus01.cern.ch>
On 30 May 2000, Malcolm Dew-Jones wrote:
> I think that the browser encrypts the password before sending it,
Do you know the first thing about Basic Auth? The specs are online,
please read them before commenting further on security issues.
> web server just sees an encrypted password. This protects the plain text
> of the user's password for use in other situations, so for example you
> couldn't use the web password to login to the user's NT computer even if
> the web page and the computer both used the same password.
sheesh. Anyone who does that deserves to lose all accumulated guru
points (as many of us already know from reading the documentation).
x'post and f'up to a more appropriate group.
------------------------------
Date: Tue, 30 May 2000 19:52:52 GMT
From: 9jerry9@my-deja.com
Subject: CGI Forms: Save File Dialog instead of processing form data
Message-Id: <8h166b$pp3$1@nnrp1.deja.com>
Any ideas why the browser presents a "Save File" dialog box when I try
to submit form data instead running the perl script?
Browser is: Internet Explorer 4.0 (Netscape 4.0 always gives the dialog
box)
OS is NT4 and Win95
Server is NT4, Running IIS v2.0
Code is from ch. 4, O'Reilly, CGI Programming 3rd edition.
Actually, the code works fine when I just print the Name data. When I
try to print the email data that's when I get the 'Save' dialog box
instead of running the Perl script.
# -------------------
# Code Sample
(File.htm)
# -------------------
<FORM ACTION="/cgi-bin/auto.pl" METHOD="GET">
<STRONG><FONT size=3>
Your Name:    <INPUT TYPE="text" NAME="user"
SIZE=60></FONT></STRONG>
<font size=4 color=red>*</font>
<BR><BR>
<STRONG><FONT size=3>
Your Email:    <INPUT TYPE="text" EMAIL="email"
SIZE=60></FONT></STRONG>
<font size=4 color=red>*</font>
<P>
<INPUT TYPE="submit" VALUE="Submit">
<INPUT TYPE="button" NAME="reset" VALUE="Clear All">
</FORM>
Name data is obtained in the Query String but not the 'email' data.
# -----------------------------------
perl script
# -----------------------------------
#!/bin/perl
&parse_form_data (*auto_form) ; # Parse Form Data
# DEBUG
$user = $auto_form {'user'} ;
$email = $auto_form {'email'} ;
# DEBUG
print "Content-type: text/plain.\n\n" ;
print "<HTML>" ;
print "<HEAD>" ;
print "<TITLE>Testing CGI Form</TITLE>" ;
print "</HEAD>" ;
print "<BODY>" ;
print "<H2>Testing CGI Form</H2>" ;
if ($user || $email)
{
# DEBUG
print "<HR>You entered: ", $user, "<HR>\n" ;
print "<HR>You entered: ", $email, "<HR>\n" ;
# DEBUG
} else {
print "<HR>You did not enter a value.<HR>\n" ;
}
if (0) # Don't execute this...
{
foreach $key (sort keys %ENV) {
print "<PRE>" ;
print $key, " = ", $ENV{$key}, "\n" ;
# ------------------------------------------------------------------
sub parse_form_data
{
local (*FORM_DATA) = @_ ;
local ( $request_method, $query_string, @key_value_pairs,
$key_value, $key, $value ) ;
$request_method = $ENV {'REQUEST_METHOD'} ;
if ($request_method eq "GET") {
$query_string = $ENV {'QUERY_STRING'} ;
}
elsif ($request_method eq "POST") {
read (STDIN, $query_string, $ENV {'CONTENT_LENGTH'} ) ||
die ("\n**\n** WARNING: Can't read STDIN
!!!\n**\n\n") ;
}
# else {
# &return_error (500, "Server Error.",
# "CGI Message: Server does not use GET or POST.\n") ;
# }
@key_value_pairs = split (/&/, $query_string) ;
foreach $key_value (@key_value_pairs) {
($key, $value) = split (/=/, $key_value) ;
$value =~ tr/+/ / ; # Convert '+' to
'blank'
$value =~ s/%([\dA-Fa-f] [\dA-Fa-f])/pack ("C", hex
($1))/eg ;
if (defined ($FORM_DATA {$key} )) {
$FORM_DATA {$key} = join ("\0", $FORM_DATA
{$key},
$value) ;
} else {
$FORM_DATA {$key} = $value ;
}
}
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 30 May 2000 19:30:22 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: CGI.pm function list/definitions
Message-Id: <bv18jsg4djft3l6itcsa2lmepo06mgucb5@4ax.com>
On Tue, 30 May 2000 17:15:35 GMT, Derek D'Angelo <derek@ccil.org>
wrote:
>Where do I find the function list/definitions for CGI.pm?
You can get a list of the pre-defined functions by reading the docs
for the module (perldoc CGI) or even(!) the source code.
Note, however that CGI.pm generates a number of functions on the fly
and you can even force it to generate completely new HTML[1] tags for
you. For example:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard tag);
my $q = CGI->new;
print $q->tag({-type=>'invented'}, 'I invented this!');
Which gives the output:
<TAG TYPE="invented">I invented this!</TAG>
hth,
Dave...
[1] Or even XML!
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Tue, 30 May 2000 18:16:15 GMT
From: Derek D'Angelo <derek@ccil.org>
Subject: Re: CGI.pm function list/definitions
Message-Id: <8h10gt$l9c$1@nnrp1.deja.com>
I printed out a copy of the doc by L. Stein and I found it to be pretty
cryptic. I understand the book is a better source for a guide to the
functions and usage. Is there a less cryptic guide out there? I have
a copy of the Linux definitive guide by O'Riely and I think
documentation of merely the function/definition (like the definitive
guide books) is more what I want. Do you know that Stein's book leans
more that way than his documentation?
In article <8h0uh1$jf5$1@nnrp1.deja.com>,
Rodney Engdahl <red_orc@my-deja.com> wrote:
> In article <8h0sv5$i9s$1@nnrp1.deja.com>,
> Derek D'Angelo <derek@ccil.org> wrote:
> > Where do I find the function list/definitions for CGI.pm?
> >
> > Thanks
> >
> > --
>
> You can find them on your perl system using:
>
> perldoc CGI
>
> or you can find them on:
>
> http://www.cpan.org
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
derek@ccil.org
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 30 May 2000 19:39:16 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: CGI.pm function list/definitions
Message-Id: <2l28jsgra9gh7qd1nt8jjh42c9ikkd78vt@4ax.com>
On Tue, 30 May 2000 18:16:15 GMT, Derek D'Angelo <derek@ccil.org>
wrote:
>I printed out a copy of the doc by L. Stein and I found it to be pretty
>cryptic. I understand the book is a better source for a guide to the
>functions and usage. Is there a less cryptic guide out there? I have
>a copy of the Linux definitive guide by O'Riely and I think
>documentation of merely the function/definition (like the definitive
>guide books) is more what I want. Do you know that Stein's book leans
>more that way than his documentation?
If that's the sort of thing that you're looking for then there's a
good section on CGI.pm in "Perl In A Nutshell".
Lincoln's book is very good too.
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: Tue, 30 May 2000 18:36:58 GMT
From: Derek D'Angelo <derek@ccil.org>
Subject: Re: CGI.pm function list/definitions
Message-Id: <8h11o7$m8e$1@nnrp1.deja.com>
Nevermind, I had only read the abstract, the rest of the guide is more
or less what I want.
thanks
In article <8h0uh1$jf5$1@nnrp1.deja.com>,
Rodney Engdahl <red_orc@my-deja.com> wrote:
> In article <8h0sv5$i9s$1@nnrp1.deja.com>,
> Derek D'Angelo <derek@ccil.org> wrote:
> > Where do I find the function list/definitions for CGI.pm?
> >
> > Thanks
> >
> > --
>
> You can find them on your perl system using:
>
> perldoc CGI
>
> or you can find them on:
>
> http://www.cpan.org
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
derek@ccil.org
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 30 May 2000 12:56:39 -0700
From: Mur <jboesNOjbSPAM@qtm.net.invalid>
Subject: Re: CGI.pm function list/definitions
Message-Id: <01288880.5ee6d1b5@usw-ex0106-046.remarq.com>
Let me also add that if you expect to do any *significant* work
in CGI.pm (beyond a simple form-handler, say), the book is
*essential*. Well worth the $20-$25 or so.
Jeff Boes//ICQ=3394914//Yahoo!=jeffboes//AOL IM=jboes
//home=jboes@qtm.net//professional=mur@consultant.com
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Tue, 30 May 2000 18:32:34 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: command line argument (newbie)
Message-Id: <6PTY4.127415$681.2404813@news-east.usenetserver.com>
In article <u9em6k56do.fsf@wcl-l.bham.ac.uk>, <nobull@mail.com> wrote:
>frank <frank@french-connexion.com> writes:
>
>> How can I pass variables thru the command line ?
>
>To all intents and purposes you can't (you'll have to make your script
>parse the command line) but see also the answers given to this question
>last time it was asked here.
Well, you can use -s, which will make Perl parse the command line and
put it in variables. See perldoc perlrun. @ARGV is far better if your
script is more than one line long, as a rule of thumb.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
The power didn't go out on 2000-01-01 either. :)
------------------------------
Date: 30 May 2000 20:40:10 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <8h18va$4di$2@news.panix.com>
On Sat, 27 May 2000 19:11:55 -0700,
Diablito <diab.litoNOdiSPAM@usa.net.invalid> wrote:
++ I have a variable 'word' (letters and numbers) and I want to
++ convert that into an integer in the range of 1-100.
++ I need something like a=1,b=2,c=3,...Then I want the script to
++ calculate a x variable:(example) if word is 'dog' x=26,if
++ it's 'cat' x=23 and so on.
And what have you done so far?
Abigail
------------------------------
Date: Tue, 30 May 2000 18:17:22 GMT
From: joseph_stiehm@my-deja.com
Subject: Re: Embedded new lines in a comma delimited file
Message-Id: <8h10iu$la5$1@nnrp1.deja.com>
Here's the solution I used, albeit without regexp. Anybody know a more
elegant solution?
- Joseph
#!/usr/local/bin/perl
$FILEIN = $ARGV[0];
open FILEIN or die "can't open $FILEIN: $!\n";
open(FILEOUT,">FileOut.csv") or die "Cannot create FileOut.csv: $!\n";
$quotes = 0;
while (<FILEIN>) {
$line = $_;
while ($line =~ m/"/g) {
$quotes++;
}
if (int($quotes/2) != ($quotes/2)) {
chomp($line);
}
print FILEOUT $line;
}
close FILEOUT or die "Cannot close FileOut.csv: $!\n"; close FILEIN or
die "Cannot close $FILEIN: $!\n";
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 30 May 2000 18:47:18 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Foreach Statement
Message-Id: <8h12bm$1rq$1@news.panix.com>
On Sat, 27 May 2000 11:32:04 GMT, Carlos Ramirez <cramirez@gte.net> wrote:
++ Try:
++
++ foreach (@years) {
++ $unique_years{$_} = 1;
++ }
++
++ # print unique years
++ print keys %unique_years;
Or in one line:
print keys %{{map {$_ => 1} @years}};
Abigail
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3210
**************************************