[13925] in Perl-Users-Digest

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

No subject found in mail header

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 17:48:07 1999

Date: Mon, 8 Nov 1999 15:10:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942102621-v9-i1321@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 8 Nov 1999     Volume: 9 Number: 1321

Today's topics:
    Re: Help with HTML forms and MYSQL insert (Shawn Smith)
    Re: Help with HTML forms and MYSQL insert <jeff@vpservices.com>
    Re: Help with HTML forms and MYSQL insert <jeff@vpservices.com>
    Re: Help with HTML forms and MYSQL insert <gellyfish@gellyfish.com>
    Re: Help with HTML forms and MYSQL insert (Shawn Smith)
    Re: How do U parse from the end of the line? mirranda@my-deja.com
        how to call a CGI script (written in Perl) from HTML co <cuteman@sensewave.com>
    Re: how to call a CGI script (written in Perl) from HTM <AgitatorsBand@yahoo.com>
    Re: localtime object y2k compliant? <aqumsieh@matrox.com>
    Re: localtime object y2k compliant? <newsposter@cthulhu.demon.nl>
    Re: localtime object y2k compliant? <cassell@mail.cor.epa.gov>
    Re: Looking for Perl cgi that can handle 'accounts'...h (Kragen Sitaker)
    Re: Looking for Perl cgi that can handle 'accounts'...h <jboes@qtm.net>
    Re: Looking for Perl cgi that can handle 'accounts'...h (Kragen Sitaker)
    Re: Mail a form <jeff@vpservices.com>
        Need some tips with ImageMagick... (Markus Svilans)
    Re: newbi: system call find, grep (Martien Verbruggen)
    Re: Perl and AIX v4.3.2 mgrabens@popd.isinet.com
    Re: Perl and AIX v4.3.2 mgrabens@popd.isinet.com
    Re: perl as first language? <cassell@mail.cor.epa.gov>
        Perl forgot 3 lines of the script <b.herzog@netcourrier.com>
    Re: Perl forgot 3 lines of the script <arthur.haas@westgeo.com>
    Re: Perl forgot 3 lines of the script (Matthew Bafford)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 08 Nov 1999 19:08:06 GMT
From: SPAMshawns@unt.edu (Shawn Smith)
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <38281d29.906589@news.unt.edu>

On 8 Nov 1999 01:03:18 -0600, abigail@delanet.com (Abigail) wrote:

>Shawn Smith (SPAMshawns@unt.edu) wrote on MMCCLX September MCMXCIII in
><URL:news:38276c36.39566868@news.unt.edu>:
>%% 
>%% I got it where I can do selects but I can't seem to get the insert to
>%% work.  I dont' need help with the HTML forms; I need  help with the
>%% Perl MYSQL insert script.
>
>
>This is comp.lang.perl.misc, not comp.lang.sql.

It must have been the header that threw you.  

Let me clarify: I have no problem with sql, I have no problem with
HTML forms.  

My problem is with perl.  My problem is using perl to interface my
HTML form with my database.  My problem is with the syntax of perl.
All I wanted was an example of someone using perl to interface a form
to a db doing an insert.


All the best,
Shawn Smith !UNT Proud!
My freeware: http://people.unt.edu/~shawns 
ICQ: 475-8706 AOL/Netscape IM: "mrgitdown"
"Whatever you do will be insignificant, but 
it is very important that you do it."
--Mahatma Gandhi 




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

Date: 8 Nov 1999 19:22:15 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <382722AA.136F295B@vpservices.com>

Shawn Smith wrote:
> 
> [snip]
> I need  help with the Perl MYSQL insert script.
> [snip]
> My test db has a table called cars(make, model, year)

Read the DBI docs on prepare, execute, and placeholders. If you need to,
read the mysql or SQL docs on insert.  Here's an example. Note that you
can put in as many execute statements as you want after just one prepare
statement.  This assumes you already have a working table called 'cars'
in the database called 'test' and that your mysqld is running:

#!/usr/local/perl -w
use strict;
use DBI;
my $dbh = DBI->connect('DBI:mysql:test',,,{RaiseError=>1});
my $sth = $dbh->prepare(qq/
    INSERT INTO cars (make,model,year) VALUES (?,?,?)
/);
$sth->execute('honda','odyssey','1997');
$sth->execute('honda','civic'  ,'1998');
$dbh->disconnect();

-- 
Jeff


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

Date: 8 Nov 1999 19:52:57 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <382729DB.1C076FF6@vpservices.com>

I wrote in my last message on this thread wrote:
> 
>  This assumes you already have a working table called 'cars'
> in the database called 'test' and that your mysqld is running:

My example also assumes you have DBI.pm and DBD::mysql.pm properly
installed on your computer.  Get them from CPAN or from activestate if
you are on winblows -- they are the essential ingredients for accessing
mysql from Perl.

-- 
Jeff


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

Date: 8 Nov 1999 21:52:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <807gm3$fjd$1@gellyfish.btinternet.com>

On Mon, 08 Nov 1999 19:08:06 GMT Shawn Smith wrote:
> On 8 Nov 1999 01:03:18 -0600, abigail@delanet.com (Abigail) wrote:
> 
>>Shawn Smith (SPAMshawns@unt.edu) wrote on MMCCLX September MCMXCIII in
>><URL:news:38276c36.39566868@news.unt.edu>:
>>%% 
>>%% I got it where I can do selects but I can't seem to get the insert to
>>%% work.  I dont' need help with the HTML forms; I need  help with the
>>%% Perl MYSQL insert script.
>>
>>
>>This is comp.lang.perl.misc, not comp.lang.sql.
> 
> It must have been the header that threw you.  
> 
> Let me clarify: I have no problem with sql, I have no problem with
> HTML forms.  
> 
> My problem is with perl.  My problem is using perl to interface my
> HTML form with my database.  My problem is with the syntax of perl.
> All I wanted was an example of someone using perl to interface a form
> to a db doing an insert.
> 

Dont know what your database looks like, dont know what your form looks
like and I dont have MySQL and this machine - but heres an example that
inserts into a database anyhow :


#!/usr/bin/perl -w

use strict;
use DBI;

$| = 1;

my $create =<<EO1;
CREATE TABLE woof (
                     woof1  CHAR(10),
                     woof2  INTEGER,
					 woof3  CHAR(10)
				   )
EO1

my $insert =<<EO2;
INSERT INTO woof
VALUES ("öèêäæçèê",98,"îïéèæåòôùáá")
EO2


my $select =<<EO3;
SELECT * FROM woof
EO3

my $dbh = DBI->connect("dbi:Informix:blah",'','',{ AutoCommit => 1})
                         or die $DBI::errstr;

$dbh->do($create) || die $dbh->errstr;

$dbh->do($insert) || die $dbh->errstr;
my $sth = $dbh->prepare($select);

$sth->execute;

my @data = $sth->fetchrow;

print "@data\n";

$dbh->disconnect();


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 08 Nov 1999 22:24:45 GMT
From: SPAMshawns@unt.edu (Shawn Smith)
Subject: Re: Help with HTML forms and MYSQL insert
Message-Id: <382747c3.11815549@news.unt.edu>

On 8 Nov 1999 19:52:57 GMT, Jeff Zucker <jeff@vpservices.com> wrote:

>I wrote in my last message on this thread wrote:
>> 
>>  This assumes you already have a working table called 'cars'
>> in the database called 'test' and that your mysqld is running:
>
>My example also assumes you have DBI.pm and DBD::mysql.pm properly
>installed on your computer.  Get them from CPAN or from activestate if
>you are on winblows -- they are the essential ingredients for accessing
>mysql from Perl.

Jeff,

Yes we do have DBI, thanks for the example, thanks for also telling me
about the DBI docs, and thanks for taking the time!

I did try your script and it does work.  I just need to do some
tweaking to get it to insert data from the form.  Off to read some DBI
docs.


All the best,
Shawn Smith !UNT Proud!
My freeware: http://people.unt.edu/~shawns 
ICQ: 475-8706 AOL/Netscape IM: "mrgitdown"
"Whatever you do will be insignificant, but 
it is very important that you do it."
--Mahatma Gandhi 




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

Date: Mon, 08 Nov 1999 22:37:43 GMT
From: mirranda@my-deja.com
Subject: Re: How do U parse from the end of the line?
Message-Id: <807jbn$n4b$1@nnrp1.deja.com>

In article <slrn82e7c5.rg8.chesta@lester.manchero.org>,
  chesta@brown.edu (Rob Manchester) wrote:
> In article <LPrV3.100$aq3.14560@vic.nntp.telstra.net>, Wyzelli wrote:
> :<mirranda@my-deja.com> wrote in message
news:805eki$4t7$1@nnrp1.deja.com...
> :> How do U parse from the end of the line to get the file extension
and
> :> the file name only?
> :>
> :> i.e.:
> :> /mypath/another_path/foo_diretory/myfile.ext1
> :>
> :> and you want to replace the extension and just get the file name
> :> i.e.
> :> myfile.abc
> :>
> :> I am a beginner....
> :> Thanks.
> :>

Hi Rob,

First thanks for your help.  This does print the name ok but I can't
pass it to another vairable.  I.e. when I try to assign the file only
(with the new extension) I have trouble.
My problem is this:
On NT, I get this config file which I get with the whole path
then I need to modify the extension and copy it to another directory.
help...
thanks
> how about...
>
> my $ext="abc";
> my @name = split(/[\.\/]/,"/some/path.txt");
> print STDOUT "$name[@name -2].$ext\n";
>
> see man perlfunc
> look up split
> man perlregex
>
> -rob
> --
> whoami?  Just a kid trying to get by.
> insight? Hell is a place off the highway, there's a Roy Rodgers
there.-JP
> advice?  Waltz like a couple of Papish cats doing the Aztec two-step.
-LF
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 8 Nov 1999 21:11:51 +0100
From: "cuteman" <cuteman@sensewave.com>
Subject: how to call a CGI script (written in Perl) from HTML code?
Message-Id: <807ahk$qah$1@web.ost.eltele.no>

Hmm... this might not be a Perl question, rather a CGI, but perhaps someone
is willing to help?  =)


How do I call a CGI script (written in Perl) from HTML code?
I have created a counter which prints text numbers. It works great when I
call it from the browsers adress field. But when I implement it in my HTML
it doesn't work. I've tried

<IMG SRC="[SCRIPT]">     #Would this work if I used binary graphic data for
each number?
and
<!-- #include virtual="[SCRIPT]" -->


I'm running Activestate on an Apache web server with Win98.


Sigmund...   d=O)





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

Date: Mon, 08 Nov 1999 20:38:41 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: how to call a CGI script (written in Perl) from HTML code?
Message-Id: <lxGV3.407$CT1.84725@news.shore.net>

cuteman <cuteman@sensewave.com> wrote:
: How do I call a CGI script (written in Perl) from HTML code?
: I have created a counter which prints text numbers. It works great when I
: call it from the browsers adress field. But when I implement it in my HTML
: it doesn't work. I've tried

: <IMG SRC="[SCRIPT]">     #Would this work if I used binary graphic data for
: each number?

Well, this certainly won't work if your script only returns text. It
should work if you return binary graphic data with the proper header.

: and
: <!-- #include virtual="[SCRIPT]" -->

I think you want to say "exec cgi=" instead of "include virtual" but SSI
isn't really my strong suit. Check the docs!

Hope this helps, and come back when you have some perl questions! :)

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Mon, 8 Nov 1999 13:14:19 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: localtime object y2k compliant?
Message-Id: <x3y66zcsvf0.fsf@tigre.matrox.com>


mkruse@netexpress.net writes:

> Hope that clears my name a bit :)

Too late!

:-)

--Ala



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

Date: 8 Nov 1999 20:57:45 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: localtime object y2k compliant?
Message-Id: <807dg9$nnk$1@internal-news.uu.net>

kenkhouri@my-deja.com wrote:

[snip]

Why do some people post questions and never join the discussion
they started?

Erik



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

Date: Mon, 08 Nov 1999 14:46:06 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: localtime object y2k compliant?
Message-Id: <382752AE.82284077@mail.cor.epa.gov>

Erik van Roode wrote:
> 
> kenkhouri@my-deja.com wrote:
> 
> [snip]
> 
> Why do some people post questions and never join the discussion
> they started?

Perhaps because they have retreated in shame as hundreds of
sarcastic posters point out their fundamental errors?

Or maybe someone e-mailed him the answer and so he never came
back to Usenet.  After all, this is just a big helpdesk, right?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 08 Nov 1999 21:11:52 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Looking for Perl cgi that can handle 'accounts'...hard 2 find...why?
Message-Id: <s0HV3.58304$23.2197023@typ11.nn.bcandid.com>

In article <8070l0$6lq$1@agate.berkeley.edu>,
Nick  <nickysantoro@yahoo.com> wrote:
>I've been looking around the web in various Perl resources and depositories of
>Perl scripts for a program that allows users to create accounts with their own
>passwords and user data, and that is secure, basically like what you would need
>for a website that provides a customized service like My Yahoo and allows users
>to set what they want to keep track of and make changes...can't find anything.
>Does anybody know where I can find such a script. Is there a reason that this isn't
>done in Perl? I assume you need to set cookies, and have encryptable password login,
>but that seems to be the only hard parts, right? 
>Thanks for any info.

The Slash code (see http://slashdot.org/code.shtml) is in Perl, is free
software, and supports user accounts.  It uses MySQL for its backend storage.
Unfortunately, it seems that the 0.3pre version on the site is corrupted.

AtDot (see ftp://ftp.atdot.org/pub/AtDot/) is free software, is in
Perl, and supports user accounts.

Dieresis Newsboy (see http://www.dieresis.com/content/features/newsboy/
-- yes, it really is misspelled) is not free software, but it's in
Perl, and it supports user accounts.  It probably wouldn't hurt you to
look at it.

There are probably a dozen others.  I searched freshmeat.net for 'account'.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Mon, 08 Nov 1999 21:12:18 GMT
From: Jeff Boes <jboes@qtm.net>
To: nickysantoro@yahoo.com
Subject: Re: Looking for Perl cgi that can handle 'accounts'...hard 2 find...why?
Message-Id: <807ebf$j7h$1@nnrp1.deja.com>

In article <8070l0$6lq$1@agate.berkeley.edu>,
  Nick <nickysantoro@yahoo.com> wrote:
> Hello,
> I've been looking around the web in various Perl resources and
depositories of
> Perl scripts for a program that allows users to create accounts with
their own
> passwords and user data, and that is secure, basically like what you
would need
> for a website that provides a customized service like My Yahoo and
allows users
> to set what they want to keep track of and make changes...can't find
anything.

Have you looked at http://www.cgi-resources.com/?

--
Jeff Boes//ICQ=3394914//Yahoo!=jeffboes//AOL IM=jboes
//home=jboes@qtm.net//professional=mur@consultant.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 08 Nov 1999 22:26:51 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Looking for Perl cgi that can handle 'accounts'...hard 2 find...why?
Message-Id: <L6IV3.58444$23.2207699@typ11.nn.bcandid.com>

In article <807ebf$j7h$1@nnrp1.deja.com>, Jeff Boes  <jboes@qtm.net> wrote:
>> I've been looking around the web in various Perl resources and
>depositories of
>
>Have you looked at http://www.cgi-resources.com/?

I think I did look at www.cgi-resources.com 43 days ago, and posted a
review of what I found.  Someone had posted a plug for their site, "The
Links Archive", which linked to www.cgi-resources.com.  I followed up
with the following review of www.cgi-resources.com (although there is
stuff about "The Links Archive" which doesn't necessarily reflect on
cgi-resources.)

In brief, I don't recommend looking at www.cgi-resources.com unless you
are experienced enough to not need it.

I have added comments in [].

From kragen@dnaco.net Mon Oct 18 18:24:20 EDT 1999
Article: 173281 of comp.lang.perl.misc
Path: typ11.nn.bcandid.com!cyc11.nn.bcandid.com!hub22.nn.bcandid.com!hub12.nn.bcandid.com!gw22.nn.bcandid.com!gate.bCandid.com!typ11.nn.bcandid.com.POSTED!not-for-mail
Newsgroups: comp.lang.perl.misc
Subject: Re: awesome perl/CGI sites
References: <7slij4$qq2$1@nnrp1.deja.com>
Organization: None
X-Newsreader: trn 4.0-test72 (19 April 1999)
From: kragen@dnaco.net (Kragen Sitaker)
Lines: 159
Message-ID: <wlwH3.422$J66.71592@typ11.nn.bcandid.com>
NNTP-Posting-Host: 207.238.206.3
X-Trace: typ11.nn.bcandid.com 938381788 207.238.206.3 (Sun, 26 Sep 1999 17:36:28 EDT)
NNTP-Posting-Date: Sun, 26 Sep 1999 17:36:28 EDT
Date: Sun, 26 Sep 1999 21:36:28 GMT
Xref: hub12.nn.bcandid.com comp.lang.perl.misc:173281

Capsule summary: stay away from these guys, because they don't know
what they're talking about, and will direct you to some really bad code
that will let anyone break into your machine.  Look at Randal's
WebTechniques column or something instead.

I review one of the scripts linked to and find it wanting.

In article <7slij4$qq2$1@nnrp1.deja.com>,  <akashgoel@my-deja.com> wrote:
>The Links Archive is a site created and maintained by me. It contains a
>lot of links to various sites on the web including Perl/CGI.

Here's what "The Links Archive" has to say about "Perl/CGI":
     - Cgi/Perl - CGI and Perl is a very useful language that can be
     used by webmasters in many ways.

Uh-oh.  They think "CGI and Perl" is a language.  This is a tip-off,
folks: don't trust what they say.

They have six links in this category, reviewed with little
[star.gif]'s.  (No ALT attributes.)  The ratings range from 3 star.gifs
to 4.5 star.gifs.

It turns out they give Matt's Script Archive, the third of the six
links, a 4.

All of the links go through
"http://www.bannerexchanger.com/pkewl2002/cgi-bin/LinkTo.pl".  So
evidently they're getting paid in some fashion for linking to these
other web pages.  It also packages up the other people's linked-to web
sites in a frameset, the top frame of which links back to "The Links
Archive", and conveniently hides the URL of the web page you're
visiting.

[ All of the above pertains solely to "The Links Archive". ]

The first link is to "The CGI Resource Index", rated 4.5 star.gifs, at
www.cgi-resources.com.  This is a site with apparently more than 2000
CGI scripts.  They have a nifty little rating system with which
users vote on which scripts they like best.

The #1 rated script on the site is "Lozinski's Emailer", at
http://users.erols.com/lozinski/scripts/email.html, which displays an
HTML form for sending email. Here are some excerpts:
#!/usr/bin/perl
 . . .
#http://www.domain.com/cgi-bin/email.pl?subject=Hi_there!
#
#       Note the "?subject=" part at the end of the URL. This is required
#in order for the subject to be read. Note that you cannot have any
#spaces in the subject part of the URL. So, the following will not work:
#       ?subject=Testing this script
 . . .
#The title of the web page and the text on the "submit" button
my $TITLE = "Send Lozinski Email!";
 . . . (It doesn't use strict, despite using mostly 'my' variables)
my $destination_email = "default_email\@your.domain.com";
 . . .
sub print_header {

print ("Content-type: text/html\n\n");
print ("<HTML>\n<HEAD>\n");
print ("<TITLE>$TITLE</TITLE>\n");
print ("</HEAD>\n");
print ("<BODY BGCOLOR=\"$BGCOLOR\" BACKGROUND=\"$BACKGROUND_URL\" ");
print ("TEXT=\"$TEXT_COLOR_NORMAL\">\n");

}#print_header

 . . . (note no indentation (despite the author's BS in CS), no here-
       document, and backslashed quotes  . . .  although other parts of
       the program use here-documents)

if ($request_method eq "GET") {
        $form_info = $ENV{'QUERY_STRING'};
} else {
        $size_of_form_information = $ENV{'CONTENT_LENGTH'};
        read (STDIN, $form_info, $size_of_form_information);
}

 . . . (so if someone sends a HEAD request, it will try to read the query
       string from stdin)

 . . . (get_form_data returns its results in a global variable called 
       %FORM_DATA.  Here's how it handles multiple values:)

                $FORM_DATA{$key} = join (", ", $FORM_DATA{$key}, $value);

 . . . (here's how check_form_data looks up errors:)

my      %error_codes = (
                "1"     =>      "You need to enter your email address.",
                "2"     =>      "Your message cannot be sent without a
                                subject.",
                "3"     =>      "You seemed to have forgotten to enter the
                                email message you wish to send.",
                "4"     =>    "For security reasons, you cannot have any of the
 following characters in your email or subject fields: [ ; < > & \* ` \| ] "
        );

 . . . (check_form_data returns its result in a global numeric variable 
       called $error, whose meaning is looked up in the above table.
       I'm not sure why the author does this; perhaps he doesn't know
       about return or storing strings in scalar variables.)

 . . . (Here's how the mail gets sent:)

open (MESSAGE, "|$sendmail -f $FORM_DATA{'users_email'} -t $destination_email "
);

 . . . (Note that the author forgot to include ^ in the list of forbidden 
       characters, so anyone can run arbitrary commands on your machine as you,
       or as www or nobody, depending on your setup, if you install this 
       script.  Also forgot to include space, which means they can pass
       whatever command-line arguments they want to sendmail.  Also forgot
       to include $, which means that if they want to, they can interpolate
       arbitrary environment variables into their email address, and since they
       also forgot to include (), if the script is run on a system where 
       /bin/sh supports the ksh $() syntax -- as bash does -- there's yet 
       another way to run arbitrary commands.)

***

So the top-rated script on the top-rated site of your list of links 
- is evidently written by somebody who didn't know Perl or CGI very well,
- opens a security hole that allows anybody in the world to run
  arbitrary commands on your system, a security hole apparently due to
  the fact that the author
  - did not read the manual page for sendmail to learn what the -t
    option (which he was using!) actually did,
  - didn't read the CGI security FAQ 
    (http://www.go2net.com/people/paulp/cgi-security/safe-cgi.txt), 
    which describes this exact bug, as well as how to fix it, even to
    the point of including example Perl code you can "copy-paste".
  - didn't read the WWW security FAQ by Lincoln Stein
    (http://www.w3.org/Security/Faq/wwwsf4.html), which also describes
    exactly the same bug, and also describes exactly how to avoid it.
  - may have read the Perl CGI FAQ
    (http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html), which 
    recommends just piping to sendmail without passing it addresses
    on the command line, but implies that it is a reasonable
    alternative to try to safely strip shell metacharacters
- creates non-RFC-822-compliant mail, because the author forgot the
  blank line between the header and the body.  (I didn't include this
  part of the script in the excerpts above.)

So this is the best of the best of what you have to offer?

> We have a
>listing of a the best CGI/PERL websites available. Sites such as CGI
>Resources are some of the best websites if you are looking for
>tutorials on how to write Perl or if you want to copy-paste some cool
>codes.

Your definitions of "best" and "cool" are definitely different from mine.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Sun Sep 26 1999
43 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>



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


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

Date: 8 Nov 1999 19:36:12 GMT
From: Jeff Zucker <jeff@vpservices.com>
To: Alain Coulombe <coulombe@bigfoot.com>, goya@saglac.qc.ca
Subject: Re: Mail a form
Message-Id: <382725EE.30E07E16@vpservices.com>

[posted and emailed]

Alain Coulombe wrote:
> 
> Mon probleme, c'est que je ne peut pas faire fonctioner la reponse du
> logiciel qui envoie le message 

Il faut utilizer un module comme "Mail::Sendmail" pour envoyer des
messages email dans n'importe quelle platform sans avoir autre logiciel
email.

> Laval Desbiens wrote
>>
>> Sorry for my english, I'm french canadian...

Prier de m'excuser mon Francais, je suis anglophone :-).

-- 
Jeff


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

Date: Mon, 08 Nov 1999 22:39:30 GMT
From: bh447@freenet.carleton.ca (Markus Svilans)
Subject: Need some tips with ImageMagick...
Message-Id: <382750a9.6483217@news.ncf.carleton.ca>

Hi everyone,

I just need some pointers of the usage of some components from the
ImageMagick image processing package.

Specifically, I need to know how to resize images with the mogrify
program. I know how to do this:

	mogrify -size 30 30 filename.jpg

But I never get images that are 30x30 pixels. Can someone help me out
here?

Thanks in advance!

-Markus

--
Rainy days and automatic weapons always get me down.s


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

Date: Mon, 08 Nov 1999 22:15:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: newbi: system call find, grep
Message-Id: <HXHV3.64$RV5.2013@nsw.nnrp.telstra.net>

On Mon, 8 Nov 1999 18:05:46 +0100,
	Soenke Richardsen <richardsen@zweitwerk.com> wrote:
> VGhhbmtzLCB3b3JrZWQgZmluZSENCg0KU29lbmtlDQoNCkFsZXggUmhvbWJlcmcgPHJob21iZXJn
> QGlmZS5lZS5ldGh6LmNoPiBzY2hyaWViIGluIGltIE5ld3NiZWl0cmFnOiAzODI2RDNCMi44NTI2

Maybe you didn't understand what Abigail was saying in her post, but
why are you encoding a plain text message? The noise above is what you
sent to here. Now, I can of course run it through a decoder, and find
out what it is you are trying to communicate,. but I might be too
lazy, especially since I have to do it again when replying.

You'd probably be better off posting in plain text.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Little girls, like butterflies, need
Commercial Dynamics Pty. Ltd.   | no excuse - Lazarus Long
NSW, Australia                  | 


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

Date: Mon, 08 Nov 1999 19:31:31 GMT
From: mgrabens@popd.isinet.com
Subject: Re: Perl and AIX v4.3.2
Message-Id: <8078ek$eid$1@nnrp1.deja.com>

In article <7vq2te$ab5$1@nnrp1.deja.com>,
  Shon Stephens <shon@mad.scientist.com> wrote:
>
> > In article <7vpk9f$vki$1@nnrp1.deja.com>, mgrabens@popd.isinet.com
> wrote:
> >  We have tried building Perl versions 5.004_04 and 5.005_03 on AIX
> 4.3.
> >The builds all look successful and many perl scripts run, but some
> >don't. The symptoms I am running into are:
> >1)  Perl core dumps on compile only
> >2)  Different shell environments cause Perl to dump core
> >3)  Running the program with she-bang to perl binary dumps core, but
> >running same binary on command line program runs fine (ie. "perl
> myprog"
> >works)
> >4)  Compile only will core dump, but running it is fine.
>
> Have you always been running AIX v4.3.2? Have you run same level of
Perl
> on earlier revs of AIX? If so give IBM a call. They are commited to
> making sure that anything that ran on v4.2x, v4.3.1 will run on
v4.3.2.
> Also try posting to an AIX group? (I don't know the name of one off
> hand)
>

  When we were installing 4.3.0 we had a problem compiling Perl. Turned
out one of header definitions had changed... Anyway called IBM and when
I mentioned Perl, they almost hung up on me... Have you had luck
mentioning Perl and getting IBM support, because I am not to thrilled
with calling them about it...

  One my 4.3.2 boxes I noticed when I set TERM to 'xterm-color' Perl
worked fine, but if TERM to 'xterm' it would core dump.

Later,
  Mike


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 08 Nov 1999 19:41:41 GMT
From: mgrabens@popd.isinet.com
To: Mitchell Morris <mgm@unpkhswm04.bscc.bls.com>
Subject: Re: Perl and AIX v4.3.2
Message-Id: <80791k$f17$1@nnrp1.deja.com>

  On one system I noticed that the term type was fixing the problem...
TERM='xterm-color' worked fine, but TERM='xterm', or TERM='vt100' and
Perl would core dump... This was with Perl v5.05_03

Here are my Perl versions, nothing magical I think either:

Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration:
  Platform:
    osname=aix, osvers=4.3.0.0, archname=aix
    uname='aix bluelite 3 4 000383284c00 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=8192'
    ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=8192'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=undef, doublesize=undef
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW
    libc=, so=a
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
-bE:$(BASEEXT).exp -b noentry -lc'


Characteristics of this binary (from libperl):
  Built under aix
  Compiled at Jun 11 1999 10:39:18
  @INC:
    /usr/local/lib/perl5/aix/5.00405
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/aix
    /usr/local/lib/perl5/site_perl
    .


Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=aix, osvers=4.3.2.0, archname=aix
    uname='aix bluelite 3 4 000383284c00 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=8192'
    ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=8192'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW
    libc=, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:perl.exp'
    cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
-bE:$(BASEEXT).exp -b noentry -lc -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under aix
  Compiled at Sep  1 1999 17:22:31
  @INC:
    /usr/local/perl5.005_03/lib/5.00503/aix
    /usr/local/perl5.005_03/lib/5.00503
    /usr/local/perl5.005_03/lib/site_perl/5.005/aix
    /usr/local/perl5.005_03/lib/site_perl/5.005
    .

The only common thing added to both installations is the Perl module
DBI... But I had ruled that out...

Later,
  Mike


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 08 Nov 1999 14:11:33 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl as first language?
Message-Id: <38274A95.7874C759@mail.cor.epa.gov>

Abigail wrote:
> 
> todd (thirdwaver@inxpress.net) wrote on MMCCLVIII September MCMXCIII in
> <URL:news:s2929r91hpc35@news.supernews.com>:
[snip]
> '' that perl is not a great choice for a first language. If that is that case
> '' what is a good first language. (shell scripting, sed, awk, java, M$ Visual
> '' xxx)?
> 
> Python, Eiffel, Pascal, Java, LPC, Lisp, Algol, Scheme, ML, Haskel, Ada.

Granted, you are a computing deity while I'm just a code-butcher.
But I don't agree with your list.  Exposing someone to an entire
new paradigm PLUS a computing language seems to cause cerebral
implosions and other Bad Things (tm).

Python  - yes
Eiffel  - maybe
Pascal  - yes
Java    - please, no
LPC     - don't know this one
Lisp    - maybe
Algol   - yes
Scheme  - well.. okay...
ML      - don't know this one either
Haskel  - a weak maybe
Ada     - maybe

By these standards, one could list APL and J [*not* JScript,
mind you] in here too.  And PL/1 and PL/C, and a dozen others.

And Perl too.  Andrew Johnson's "Elements of Programming
with Perl" is a good intro computing text which uses
Perl as the language of choice - and does a good job of
both.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 08 Nov 1999 22:48:21 +0100
From: Utilisateur Red Hat Linux <b.herzog@netcourrier.com>
Subject: Perl forgot 3 lines of the script
Message-Id: <38274525.E64C5814@netcourrier.com>

Hello,
I need to write to a filehandle in a CGI script.
So, i inserted, at the begining of the script:

open(FILE,">file");
print FILE "Hello !";
close(FILE);

All permissions and directories are correctly set (i did check that),
and those 3 lines perfectly work as an entire script (if i paste them in
a differetn file.pl and run it, i get Hello written to file).

But in the CGI script, that doesn't work. As if Perl forgot to read the
3 lines ...

Thank you for helping.
Ben



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

Date: 08 Nov 1999 15:54:28 -0600
From: Art Haas <arthur.haas@westgeo.com>
Subject: Re: Perl forgot 3 lines of the script
Message-Id: <lr1za0ir8r.fsf@yoda.wg.waii.com>

Utilisateur Red Hat Linux <b.herzog@netcourrier.com> writes:

> Hello,
> I need to write to a filehandle in a CGI script.
> So, i inserted, at the begining of the script:
> 
> open(FILE,">file");
> print FILE "Hello !";
> close(FILE);
> 
> All permissions and directories are correctly set (i did check that),
> and those 3 lines perfectly work as an entire script (if i paste them in
> a differetn file.pl and run it, i get Hello written to file).
> 
> But in the CGI script, that doesn't work. As if Perl forgot to read the
> 3 lines ...
> 

You need to check to see if the open() succeeds, and it doesn't
hurt to check the close(), too ...

open(FILE,">file") || die "Can't create 'file'! $!\n";
print FILE "Hello";
close(FILE) || die "Error writing 'file'! $!\n";

Add in the error checking and something may reveal itself ...

-- 
###############################
# Art Haas
# (713) 689-2417
###############################


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

Date: Mon, 08 Nov 1999 22:30:04 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Perl forgot 3 lines of the script
Message-Id: <slrn82eifv.497.*@dragons.duesouth.net>

[followups set]

And so it happened, on Mon, 08 Nov 1999 22:48:21 +0100, Utilisateur Red
Hat Linux <b.herzog@netcourrier.com> typed random characters into perl,
and ended up with the following posted to comp.lang.perl.misc: 
: Hello,
: I need to write to a filehandle in a CGI script.
: So, i inserted, at the begining of the script:
:
: open(FILE,">file");
: print FILE "Hello !";
: close(FILE);
:
: [snip "It failed"]

Try this CGI script:

#!/bin/sh
echo Content-type: text/plain
echo 
pwd  # Is my script running where I think it is?

: Thank you for helping.

HTH,

: Ben

--Matthew


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

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


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