[17189] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4601 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 12 21:05:35 2000

Date: Thu, 12 Oct 2000 18:05:09 -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: <971399109-v9-i4601@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 12 Oct 2000     Volume: 9 Number: 4601

Today's topics:
    Re: $] <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: $] <lr@hpl.hp.com>
        [ Wildly OT ] Re: Japanese Girl Has PERL Request. <anmcguire@ce.mediaone.net>
    Re: [ Wildly OT ] Re: Japanese Girl Has PERL Request. <jeff@vpservices.com>
    Re: Altered files sometimes go empty! <wyzelli@yahoo.com>
    Re: Downloadable reference manual? (David H. Adler)
        Help compiling DBD::ODBC <Darryl.Friesen@usask.ca>
    Re: K-Shell to PERL converter <elijah@workspot.net>
    Re: New to Perl... a question or two <ChuckChopp@rtfmcsi.com>
        perl -e shorthand? <toddg@linux46.ma.utexas.edu>
    Re: perl -e shorthand? <toddg@linux46.ma.utexas.edu>
    Re: perl -e shorthand? (Brett W. McCoy)
    Re: perl -e shorthand? <elijah@workspot.net>
    Re: perl -e shorthand? <elijah@workspot.net>
    Re: perl cgi-bin error problem - beginner abevec@my-deja.com
    Re: perl cgi-bin error problem - beginner <godzilla@stomp.stomp.tokyo>
    Re: perl variables in html? <kims@emmerce.com.au>
    Re: Perl Watching Perl? <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Perl Watching Perl? (Chris Fedde)
    Re: Perl/Windows problem <wyzelli@yahoo.com>
    Re: Perl/Windows problem <godzilla@stomp.stomp.tokyo>
    Re: Very Newbie Question - Form output to file vs mail <bfulb@bellsouth.net>
    Re: Very Newbie Question - Form output to file vs mail <bfulb@bellsouth.net>
    Re: Works on Win2000 but not on Win98!? Why? Help! <01031149@3web.net>
    Re: Works on Win2000 but not on Win98!? Why? Help! <wyzelli@yahoo.com>
    Re: Works on Win2000 but not on Win98!? Why? Help! <lr@hpl.hp.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 12 Oct 2000 15:35:28 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: $]
Message-Id: <39E63CB0.6B795490@jpl.nasa.gov>

Owen Cook wrote:
> #!/usr/bin/perl -w
> 
> print "$] \n";
> 
> exec ("perl -v");
> 
> --------------------------------------------------
> 
> [root@localhost cgi-bin]# perl t1.cgi
> 5.006
> 
> This is perl, v5.6.0 built for i686-linux
> (with 1 registered patch, see perl -V for more detail)
> 
> Copyright 1987-2000, Larry Wall
> 
> <snip>

perldelta/"Improved Perl version numbering system"

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Thu, 12 Oct 2000 16:00:54 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: $]
Message-Id: <MPG.144fe2851d23827798ae31@nntp.hpl.hp.com>

In article <tcgcuskanfh5tlphj0v2obp043binqv9ge@4ax.com> on Fri, 13 Oct 
2000 09:08:53 +1000, Owen Cook <rcook@pcug.org.au> says...
> The program below gives the results shown. The definition I have of $]
> reads "...the version string that identifies the Perl version.."
> 
> I can't reconcile the two numbers produced, other that there is a "5"
> and a "6' in each
> 
> Presumeably there is some difference in interpretation between "version
> sting" and the "Perl version"

Look for this section in perldelta:

  Improved Perl version numbering system

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 12 Oct 2000 17:27:54 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: [ Wildly OT ] Re: Japanese Girl Has PERL Request.
Message-Id: <Pine.LNX.4.21.0010121724500.20181-100000@hawk.ce.mediaone.net>

On Thu, 12 Oct 2000, Jeff Zucker quoth:

[ snip ]

JZ> PCLU are those fine folks who allowed the Java/Python march in Skokie
JZ> even though they disagreed on the poor choice of languages.  The PCLU
JZ> has its limits though, even they are unwilling to defend the rights of
JZ> VBscripters to march anywhere.

I live in Evanston Il, close to Skokie, was there really a Java/Python
march? Do you live near skokie, if so, perhaps we could grab a beer.
It is hard for me to tell if you are being sarcastic or not.

anm
-- 
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew N. McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'



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

Date: Thu, 12 Oct 2000 15:55:55 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: [ Wildly OT ] Re: Japanese Girl Has PERL Request.
Message-Id: <39E6417B.C4BF612E@vpservices.com>

"Andrew N. McGuire" wrote:
> 
> On Thu, 12 Oct 2000, Jeff Zucker quoth:
> 
> [ snip ]
> 
> JZ> PCLU are those fine folks who allowed the Java/Python march in Skokie
> JZ> even though they disagreed on the poor choice of languages.  The PCLU
> JZ> has its limits though, even they are unwilling to defend the rights of
> JZ> VBscripters to march anywhere.
> 
> I live in Evanston Il, close to Skokie, was there really a Java/Python
> march? 

I was making a reference about the time a few years back when the ACLU
defended the right of the Ku Klux Klan (a group of racist *#*holes) to
march in Skokie, Il.  It wasn't a funny event.  I know people who
supported ACLU and others who went to Skokie to heckle the Klan and some
who did both. (no smilie)

I was extending the PCLU metaphor to joke that the Perl Civil Liberties
Union would be an organization that defended freedom of expression even
when they disagreed with the things being expressed.

> Do you live near skokie, 

Nope, sorry, a couple of timezones west.

> if so, perhaps we could grab a beer.

Sure, let's do that at some Perl event or another, looking forward to
it!

> It is hard for me to tell if you are being sarcastic or not.

Sorry about that.  I'll try to use more smilies. :-)

-- 
Jeff


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

Date: Fri, 13 Oct 2000 09:46:20 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Altered files sometimes go empty!
Message-Id: <issF5.10$ME4.2897@vic.nntp.telstra.net>

"Ryan Deardorff" <ryandear@ucar.edu> wrote in message
news:39E4AA46.107DCCA3@ucar.edu...
>
> Perl makes this very easy, of course, HOWEVER, I have noticed a rather
> unpleasant side-effect, which is that occasionally, the files I'm
trying
> to update with new content suddently go missing!  While the file
itself
> still exists, it will have 0 size!  My solution has been, BEFORE my
> scripts attempt to change the file, they create a backup copy first.
> Then, I have another script run every once in a while to look at these
> files, and see if they are of 0 size--if they are, then they are
> restored from the backup copy....
>

Maybe your script fails to retrieve something from one of the other
sites and you don't check the success or failure of the 'get' and so
carry on printing 'nothing' to the file?

Just a wild guess.  Not really enough information to go on.

Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: 12 Oct 2000 22:13:50 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Downloadable reference manual?
Message-Id: <slrn8ucdsu.l5q.dha@panix6.panix.com>

On 10 Oct 2000 09:31:34 +0100, nobull@mail.com <nobull@mail.com>
wrote:

>If you have Perl you already have an abbridged version of the Camel
>book available via the perldoc mechanism.

Abridged??  Less verbose, I suppose, but not less complete I hope.
The docs that come with perl are (or at least are *supposed* to be)
the definitive reference.  The camel just has more words.  :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"I go where I will and I do what I can" - Henry Fool


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

Date: Thu, 12 Oct 2000 16:17:36 -0600
From: "Darryl Friesen" <Darryl.Friesen@usask.ca>
Subject: Help compiling DBD::ODBC
Message-Id: <8s5d92$bs5$1@tribune.usask.ca>


I've asked this question in the OpenLink newsgroups as well, but I'm
thinking there's probably more people here that help.

I've got the libiodbc-2.50.3 and OpenLink ODBC client stuff (for Digital
Unix 4.0) installed, working, and (after countless days) talking to our SQL
7 Server.

I'm trying now to compile the DBD::ODBC module for Perl (5.6.0).  I've tried
both cc (which generates a large number of warnings, but does compile) and
gcc (no warnings) with about the same amount of luck.  "make" succeeds, but
"make test" barely works -- 20% of the tests pass; lots of "test program
seems to have generated a core" messages.  I've included the results of make
test below, in case that is of any use to anyone.

I decided to ignore the test errors and do the make install.  However, I
then see errors like this when running my Perl script:

install_driver(ODBC) failed: Can't load
'/usr/local/perl5.6/lib/site_perl/5.6.0/alpha-dec_osf/auto/DBD/ODBC/ODBC.so'
for module DBD::ODBC: dlopen: cannot load
/usr/local/perl5.6/lib/site_perl/5.6.0/alpha-dec_osf/auto/DBD/ODBC/ODBC.so
at /usr/local/perl5.6/lib/5.6.0/alpha-dec_osf/DynaLoader.pm line 200.

and

Perhaps a required shared library or dll isn't installed where expected



I'd appreciate any help at all.

Thanx,

 Darryl



#make test
PERL_DL_NONLAZY=1
/usr/local/bin/perl5.6.0 -Iblib/arch -Iblib/lib -I/usr/local/perl5.6/lib/5.6
 .0/alpha-dec_osf -I/usr/local/perl5.6/lib/5.6.0
-e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
t/*.t
t/01base............ok
t/02simple..........ok 5/14DBD::ODBC::st fetchrow failed:
[OpenLink][ODBC][Driver]Data was truncated (SQL-S1004)(DBD:
st_fetch/SQLFetch (long truncated) err=1) at t/02simple.t line 144.
t/02simple..........ok 12/14Out of memory during ridiculously large request
at /usr/local/perl5.6/lib/site_perl/5.6.0/alpha-dec_osf/DBI.pm line 591.
nxm upcall: can't grow stack, pid 24238, proc perl5.6.0
t/02simple..........dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
DIED. FAILED tests 13-14
        Failed 2/14 tests, 85.71% okay
t/03dbatt...........ok 6/6nxm upcall: can't grow stack, pid 24408, proc
perl5.6.0
t/03dbatt...........dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
        after all the subtests completed successfully
t/05meth............ok 6/6nxm upcall: can't grow stack, pid 25179, proc
perl5.6.0
t/05meth............dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
        after all the subtests completed successfully
t/09bind............ok 6/9DBD::ODBC::st fetchrow failed:
[OpenLink][ODBC][Driver]Data was truncated (SQL-S1004)(DBD:
st_fetch/SQLFetch (long truncated) err=1) at t/09bind.t line 98.
DBD::ODBC::st execute failed: [iODBC][Driver Manager]Invalid cursor state
(SQL-24000)(DBD: st_execute/SQLExecute err=-1) at t/09bind.t line 97.
t/09bind............ok 6/9DBD::ODBC::st fetchrow failed:
[OpenLink][ODBC][Driver]Data was truncated (SQL-S1004)(DBD:
st_fetch/SQLFetch (long truncated) err=1) at t/09bind.t line 98.
DBD::ODBC::st execute failed: [iODBC][Driver Manager]Invalid cursor state
(SQL-24000)(DBD: st_execute/SQLExecute err=-1) at t/09bind.t line 97.
t/09bind............ok 8/9DBD::ODBC::st fetchrow failed:
[OpenLink][ODBC][Driver]Data was truncated (SQL-S1004)(DBD:
st_fetch/SQLFetch (long truncated) err=1) at t/09bind.t line 98.
DBD::ODBC::st execute failed: [iODBC][Driver Manager]Invalid cursor state
(SQL-24000)(DBD: st_execute/SQLExecute err=-1) at t/09bind.t line 97.
t/09bind............ok 9/9nxm upcall: can't grow stack, pid 9671, proc
perl5.6.0
t/09bind............dubious
        Test returned status 0 (wstat 139, 0x8b)
        test program seems to have generated a core
        after all the subtests completed successfully
Failed Test  Status Wstat Total Fail  Failed  List of failed
----------------------------------------------------------------------------
---
t/02simple.t      0   139    14    2  14.29%  13-14
t/03dbatt.t       0   139     6    0   0.00%  ??
t/05meth.t        0   139     6    0   0.00%  ??
t/09bind.t        0   139     9    0   0.00%  ??
Failed 4/5 test scripts, 20.00% okay. 2/40 subtests failed, 95.00% okay.
*** Exit 2
Stop.





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

Date: 13 Oct 2000 00:15:27 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: K-Shell to PERL converter
Message-Id: <eli$0010121951@qz.little-neck.ny.us>

In comp.lang.perl.misc, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "nandagopalj" == nandagopalj  <nandagopalj@hotmail.com> writes:
> nandagopalj> Does anyone know of a freeware to convert k-shell
> nandagopalj> scripts into PERL?
> nandagopalj> Your help is appreciated.
> About the best you're gonna do is at
>         http://www.cpan.org/authors/id/MERLYN/sh2perl-0.03.tar.gz

And it doesn't even work!

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.0/i686-linux-thread-multi -I/usr/lib/perl5/5.6.0 test.pl
tests/00_hello......ok 1/3sh: -c: line 2: syntax error: unexpected end of file
tests/00_hello......ok 3/3FAILED test 2                                      
	Failed 1/3 tests, 66.67% okay
tests/01_args.......ok 1/3sh: -: command not found                           
tests/01_args.......ok 3/3FAILED test 2                                      
	Failed 1/3 tests, 66.67% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
-------------------------------------------------------------------------------
tests/00_hello.               3    1  33.33%  2
tests/01_args.t               3    1  33.33%  2
Failed 2/2 test scripts, 0.00% okay. 2/6 subtests failed, 66.67% okay.
make: *** [test_dynamic] Error 29
$

And if you look at the two test scripts you see that 'tests' 1 and 3
in each of those scripts is bogus, making a 100% failure on the
sh2perl bit.

Elijah
------
actually $Config{'perl'} is set to '' for some reason for me



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

Date: Thu, 12 Oct 2000 18:28:25 -0400
From: Chuck Chopp <ChuckChopp@rtfmcsi.com>
Subject: Re: New to Perl... a question or two
Message-Id: <39E63B09.2AFAB12F@rtfmcsi.com>

"Brett W. McCoy" wrote:

> On Thu, 12 Oct 2000 17:45:01 -0400, Chuck Chopp <ChuckChopp@rtfmcsi.com> wrote:
>
> > I looked at ActiveState's Perl implementation and downloaded it to test
> > with, but I wanted to know if I should be looking at any other
> > implementations, too.
>
> That's probably your best place to start.  It's the most complete Win32
> implementation, AFAIK.  The Perl implementation that is included with
> every distribution I have ever used under Linux is the 'official' stock
> Perl distribution you can get through CPAN or from www.perl.com, so you
> should stick with that if you are doing Linux Perl development.
>
> Brett W. McCoy
>                                               http://www.chapelperilous.net
> ---------------------------------------------------------------------------
> One organism, one vote.

Thanks for the info.


--
Chuck Chopp

ChuckChopp@rtfmcsi.com            http://www.rtfmcsi.com
                                  ICQ # 22321532
RTFM Consulting Services Inc.     864 801 2795 voice & voicemail
103 Autumn Hill Road              864 801 2774 fax
Greer, SC  29651                  800 400 4935 pager
                                  8004004935@alphapage.airtouch.com




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

Date: 12 Oct 2000 23:35:26 GMT
From: Todd Gillespie <toddg@linux46.ma.utexas.edu>
Subject: perl -e shorthand?
Message-Id: <8s5hru$gdq$1@geraldo.cc.utexas.edu>

I've typed something like:
perl -e 'while(<>) {blahblahlblah;print}'
a number of times this week.  I recall seeing in the Perl Cookbook that
there is a shorthand for this; does anyone remember what exactly it is?
Looking in perldoc in the meantime..


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

Date: 12 Oct 2000 23:45:14 GMT
From: Todd Gillespie <toddg@linux46.ma.utexas.edu>
Subject: Re: perl -e shorthand?
Message-Id: <8s5iea$gnn$1@geraldo.cc.utexas.edu>

Todd Gillespie <toddg@linux46.ma.utexas.edu> wrote:
: perl -e 'while(<>) {blahblahlblah;print}'
: there is a shorthand for this; does anyone remember what exactly it is?

My bad, perl -ep, right there in the FAQ.  I should learn to read the
perlfaq&perldocs like an evangelical reads the bible.


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

Date: Thu, 12 Oct 2000 23:59:42 GMT
From: bmccoy@chapelperilous.net (Brett W. McCoy)
Subject: Re: perl -e shorthand?
Message-Id: <slrn8ucka0.i5g.bmccoy@chapelperilous.net>

On 12 Oct 2000 23:35:26 GMT, Todd Gillespie <toddg@linux46.ma.utexas.edu> wrote:

> I've typed something like:
> perl -e 'while(<>) {blahblahlblah;print}'
> a number of times this week.  I recall seeing in the Perl Cookbook that
> there is a shorthand for this; does anyone remember what exactly it is?
> Looking in perldoc in the meantime..

perl -pi 'blah blah blah' <filename>

-- 
Brett W. McCoy
                                              http://www.chapelperilous.net
---------------------------------------------------------------------------
Never eat anything bigger than your head.


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

Date: 13 Oct 2000 00:21:21 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: perl -e shorthand?
Message-Id: <eli$0010122017@qz.little-neck.ny.us>

In comp.lang.perl.misc, Todd Gillespie  <toddg@linux46.ma.utexas.edu> wrote:
> Todd Gillespie <toddg@linux46.ma.utexas.edu> wrote:
> : perl -e 'while(<>) {blahblahlblah;print}'
> : there is a shorthand for this; does anyone remember what exactly it is?
> My bad, perl -ep, right there in the FAQ.

You need 'perl -pe' or else not much is going to happen. (With an
-w in there too, you'd get a warning.)

Elijah
------
see also -n (loops but doesn't print) and -l (adds a \n for you)


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

Date: 13 Oct 2000 00:27:00 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: perl -e shorthand?
Message-Id: <eli$0010122021@qz.little-neck.ny.us>

In comp.lang.perl.misc, Brett W. McCoy <bmccoy@chapelperilous.net> wrote:
> > perl -e 'while(<>) {blahblahlblah;print}'
> > there is a shorthand for this; does anyone remember what exactly it is?
> perl -pi 'blah blah blah' <filename>

That does not do anything like the same thing. -i is for 'in-place
edit' (a misnomer, since it uses a temp file behind your back and
then breaks your hard links). -e is for 'run this expression'.
No filename is needed for -e (or -i, actually).

Elijah
------
admits that the temp file aspect of -i is well documented


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

Date: Fri, 13 Oct 2000 00:08:12 GMT
From: abevec@my-deja.com
Subject: Re: perl cgi-bin error problem - beginner
Message-Id: <8s5jp9$e4m$1@nnrp1.deja.com>

In article <8s54ek$p7$1@nnrp1.deja.com>,
  micah26@netscape.net wrote:
> Do you need use CGI to access the ENV hash?
> Micah
>
> In article <8s53tj$8k$1@nnrp1.deja.com>,
>   abevec@my-deja.com wrote:
> > In article <8s5333$vi2$1@nnrp1.deja.com>,
> >   micah26@my-deja.com wrote:
> >
> > Yes all permissions on files/directories are 755.
> >
> > > Are the permissions for the file set to 0755?
> > > Micah
> > >
> > > In article <8s52dv$uve$1@nnrp1.deja.com>,
> > >   abevec@my-deja.com wrote:
> > > > I'm running Apache/Linux server and when my Perl cgi script
tries
> to
> > > > execute I get the following error from Apache error log any
> pointers
> > > to
> > > > a begginer?
> > > >
> > > > from error log:
> > > >
> > > > [Thu Oct 12 15:00:12 2000] [error] (8)Exec format error: exec of
> > > > /home/httpd/cgi-bin/guestbook1.pl failed
> > > > [Thu Oct 12 15:00:12 2000] [error] [client 128.63.62.181]
> Premature
> > > end
> > > > of script headers: /home/httpd/cgi-bin/guestbook1.pl
> > > >
> > > > Perl Script guestbook1.pl
> > > >
> > > >  #!/usr/bin/perl
> > > >        $temp=$ENV{'QUERY_STRING'};
> > > >        @pairs=split(/&/,$temp);
> > > >        foreach $item(@pairs) {
> > > >                ($key,$content)=split (/=/,$item,2);
> > > >                $content=~tr/+/ /;
> > > >                $content=~ s/%(..)/pack("c",hex($1))/ge;
> > > >                $fields{$key}=$content;
> > > >        }
> > > >
> > > >        print "Content-type: text/html\n\n";
> > > >        print "<body bgcolor=\"#FFFFFF\">\n";
> > > >        print "<h2>$fields{'name'}</h2>\n";
> > > >        print "<pre>$fields{'comment'}</pre>\n";
> > > >
> > > > thanks for any help -abevec
> > > >
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> > >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


I think the problem may be in my html file "get" operation, take a look
at this code:

<!doctype html public "-//w3c//dtd html 3.2//en">
       <html>
       <body bgcolor="#FFFFFF">

       <title>Guestbook</title>

       <h2>Please Sign My Guestbook</h2>

       <form method=get action="/cgi-bin/guestbook1.pl">

       <dt>Name:<br>

       <dd><input type=text name=name size=30>

       <dt>Comment:<br>

       <dd><textarea name=comment rows=5 cols=50></textarea><p>

       <input type=submit value="Sign In">


       </html>



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


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

Date: Thu, 12 Oct 2000 17:51:32 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: perl cgi-bin error problem - beginner
Message-Id: <39E65C94.77DE115@stomp.stomp.tokyo>

abevec@my-deja.com wrote:
 
> I'm running Apache/Linux server and when my Perl cgi script tries to
> execute I get the following error from Apache error log any pointers to
> a begginer?
 
> from error log:
 
> [Thu Oct 12 15:00:12 2000] [error] (8)Exec format error: exec of
> /home/httpd/cgi-bin/guestbook1.pl failed
> [Thu Oct 12 15:00:12 2000] [error] [client 128.63.62.181] Premature end
> of script headers: /home/httpd/cgi-bin/guestbook1.pl
 
> Perl Script guestbook1.pl


This test script I am providing will test four
functions of your server. This will also give
you a basic introduction to script security.

--

Change your form action to post method rather
than a get method:

<FORM ACTION="guestbook.pl" METHOD="POST">

Change your 'name' textfield to:

<... NAME="Name" ... etc...>

Change your 'comments' textfield to:

<... NAME="Comments" ... etc...>

You will address input variables with this format:

$in{Name Of Your Input Variable}

It is critical to have these input variable
names absolutely correct, for your html form
action and for your script; same name in both.

This helps to safeguard against multiple values
for a single input variable. Give each input
variable a unique name $in{Name} and you won't
inadvertently make a mistake in trying to deal
with a hash of values under one variable name.
This method is easy and very logical; it keeps
all 'things' sorted out for you. It also lends
ease in pulling all kinds of slick tricks, each
very unique and uniquely named so you don't have
to worry about your personal memory while writing
or modifying a script.

Copy out the following script precisely and exactly
as shown and do not modify this script until you
are finished testing.

If this fails, there are four common problems to 
look at and correct as needed:

Permissions are set wrong.
Post method not allowed for your directory.
Server is not configured for ".pl" try ".cgi"
Server is not configured to support cgi scripts.

This script will afford you a minimum degree of
security as well. Your current script has none.
Other security should be added, such as hostile
html tags and the such. Reseach security before
you make your guestbook accessible to the public.

http://www.eekim.com/pubs/cgibook/ch09/0902.html


Godzilla!
--


#!/usr/bin/perl

&Akostininchi_Ithana;

sub Akostininchi_Ithana
 {
  if ($ENV{'CONTENT_LENGTH'} > 131072)
   {  
    print "Content-type: text/html\n\n
           <HTML><BODY><FONT COLOR=\"red\">
           <BR><BR><CENTER><BLINK>
           <H1>YOU ARE AN IDIOT!</H1>
           </BLINK></CENTER></BODY></HTML>";
    exit;
   }
  else
   {
    local (*in) = @_ if @_;
    local ($i, $key, $value);
    read (STDIN,$in,$ENV{'CONTENT_LENGTH'});
    @in = split (/&/,$in);
    foreach $i (0 .. $#in)
     {
      $in[$i] =~ s/\+/ /g;
      ($key, $value) = split (/=/,$in[$i],2);
      ($value eq "") && next;
      $key =~ s/%(..)/pack ("c",hex($1))/ge;
      $value =~ s/%(..)/pack ("c",hex($1))/ge;
      $value =~ s/\(/&#40;/g;
      $value =~ s/\)/&#41;/g;
      $value =~ s/\*/&#42;/g;
      $value =~ s/\[/&#91;/g;
      $value =~ s/\\/&#92;/g;
      $value =~ s/\]/&#93;/g;
      $value =~ s/\^/&#94;/g;
      $value =~ s/`/&#96;/g;
      $value =~ s/{/&#123;/g;
      $value =~ s/\|/&#124;/g;
      $value =~ s/}/&#125;/g;
      $in{$key} .= "\0" if (defined($in{$key})); 
      $in{$key} .= $value;
     }
    return 1;
   }
 }
 
print "Content-type: text/html\n\n",
"<HTML>\n<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n",
"<h2>$in{Name}</h2>\n",
"<pre>$in{Comments}</pre>\n</HTML>";

exit;


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

Date: Fri, 13 Oct 2000 11:46:19 +1000
From: "Kim Saunders" <kims@emmerce.com.au>
Subject: Re: perl variables in html?
Message-Id: <8s5m0v$4r3$1@thebe.syd.dav.net.au>

In article <suc4nfha4jt0d9
> print ("Content-type: text/html\n\n");
> 
> open (PAGE, "<$file");
>  while (<PAGE>)
>   { 
     print ($_);
     }
> close (PAGE);

Since no-one else has directly answere your question, I say this. Don't
bother telling me off if it's broken.

try putting s/\$([\w\d]+)/${$1}/g; just before your print statement. Not
tested, it might work, no guarantees...

KimS



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

Date: Thu, 12 Oct 2000 15:31:31 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Perl Watching Perl?
Message-Id: <39E63BC3.7EFAC791@jpl.nasa.gov>

rathmore@tierceron.com wrote:
> Is it possible to have a Perl program, fork another Perl program whose
> purpose is to monitor the first program and restart it if it takes too
> long to complete?

Yes.
perldoc -f fork
perlipc

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Thu, 12 Oct 2000 22:59:04 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: Perl Watching Perl?
Message-Id: <YmrF5.55$T3.170870784@news.frii.net>

In article <8s5b42$75j$1@nnrp1.deja.com>,  <rathmore@tierceron.com> wrote:
>
>Is it possible to have a Perl program, fork another Perl program whose
>purpose is to monitor the first program and restart it if it takes too
>long to complete?
>
>About 1 out of every 5 times that I do this, the program hangs within
>the block that downloads the files and deletes them. 
>

The doc for Net::FTP indicates a timeout option to the 'new' method.
Does that not work?  I'd also look at turning on the debug method and
watching what is going on when the program hangs. 

ymmv
chris
-- 
    This space intentionally left blank


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

Date: Fri, 13 Oct 2000 09:40:33 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Perl/Windows problem
Message-Id: <WmsF5.9$ME4.2931@vic.nntp.telstra.net>


"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:39E611BC.127C51A1@stomp.stomp.tokyo...
> John Clifford Williams wrote:
>

<completely incorrect garbage snipped>

We don't want to associate an .ATT with Perl, we want to associate an
 .ATT with a Perl SCRIPT which is an entirely different kettle of fish.
I am not even sure that it can be done, certainly not easily.

This would be a matter of creating a Windows association for the .ATT
file which calls Perl AND the appropriate script.  You may be able to
achieve something by editing the default actions of a new association
you create, but I have never done this and can not really offer any good
advice.

Wyzelli

--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: Thu, 12 Oct 2000 17:27:35 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Perl/Windows problem
Message-Id: <39E656F7.FFC937FA@stomp.stomp.tokyo>

Wyzelli wrote:
 
> "Godzilla! wrote:
> > John Clifford Williams wrote:

> <completely incorrect garbage snipped>
 
> We

What do you mean "We" White Eyes?

> don't want to associate an .ATT with Perl, 
> we want to associate an....

Why have you reworded what I stated then post
my thoughts as your own "something new"?

Polly want a cracker?

I would think you would have learned a lesson
from copying my AM-PM time to 24 hour time script
a while back, rewording it, changing its syntax,
then claiming it as your own method. 

Really burnt you on that one, yes Frank?


Godzilla!


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

Date: Thu, 12 Oct 2000 19:10:41 -0000
From: "Bill Fulbright" <bfulb@bellsouth.net>
Subject: Re: Very Newbie Question - Form output to file vs mail
Message-Id: <4urF5.9307$Nk.47558@news1.mia>

Thanks for your observations, and pointers.

I am able to work with ODBC and VB, I am just not that familiar with Perl,
and CGI.  I am very familiar with HTML and Javascript.

My question is:  can I just change the word in the HTML from "mail" to
"file" to get the form output to go to a file instead of an email.

Bill

"Anders Lund" <anders@wall.alweb.dk> wrote in message
news:yQjF5.11775$UW.322057@news010.worldonline.dk...
> Bill Fulbright wrote:
> > <FORM ACTION="/bin/script_library/form_handler_file" METHOD=POST>
> >
> > and
> >
> > <FORM ACTION="/bin/script_library/form_handler_mail" METHOD=POST>
> >
> > These are statements I got from Tripod's "Form Handler" script.
> >
> > 1.  Are these standard and compatible with Perl 5?
>
> This is HTML, HTTP, CGI standards, but of cause perl handles them - perl
> handles anything...
>
> > 2.  what do I need to do to use this in my own server?
>
> perl
> If you mean use the specific files, you need those, and knowledge of how
> the works and what they do.
>
> > I have been asked by my company to build a simple form with output to a
> > file, which we will import to Access, etc.
>
> You'd want to look into DBI and DBD::ODBC, and put your data directly into
> your database, or you could use DBI and DBD::CVS to store your data in a
> cvs file which can be imported.
>
> If oyu installed perl5, most of theese will be present, missing modules
can
> be found at www.cpan.org fo cause.
>
> > I am using Perl Builder Software with the CGI Wizard, and have looked
> > through the help for how to output to file, and have not been able to
find
> > anything.
> >
> > Any help understanding this will be very much appreciated.
>
> Personally, I'll recommend the core perl installation (from cpan), and a
> nice text editor, and I guess it wouldnt hurt you to start a DOS window
and
> read through the perl documentation using the perldoc program. Start by
> typing >perldoc perl
>
> -anders
> --
> [ the word wall - and the trailing dot - in my email address
> is my _fire_wall - protecting me from the criminals abusing usenet]




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

Date: Thu, 12 Oct 2000 19:12:53 -0000
From: "Bill Fulbright" <bfulb@bellsouth.net>
Subject: Re: Very Newbie Question - Form output to file vs mail
Message-Id: <8wrF5.9310$Nk.47618@news1.mia>

I am familiar with webserver configuration, HTML, Javascript, VB, ODBC and
everthing else I need to do this project, but would just like to know if by
installing Perl on the server directory I can use the HTML code shown and
just change the word "mail" to "file" in order to have the form output sent
to a file instead of an email.

Thank you for your input.

Regards,

Bill

<nobull@mail.com> wrote in message news:u94s2i0y1i.fsf@wcl-l.bham.ac.uk...
> "Bill Fulbright" <bfulb@bellsouth.net> writes:
>
> > I am very new to Perl and CGI, altho I have used modules on various free
> > wesite hosts.  I am familiar with using:
> >
> > <FORM ACTION="/bin/script_library/form_handler_file" METHOD=POST>
> >
> > and
> >
> > <FORM ACTION="/bin/script_library/form_handler_mail" METHOD=POST>
> >
> > These are statements I got from Tripod's "Form Handler" script.
> >
> > 1.  Are these standard and compatible with Perl 5?
>
> This is HTML.  Nothing to do with Perl.
> /bin/script_library/form_handler_mail could be a script written in
> Perl5 being called by the HTTP server using CGI API.  It could
> also be a program written in any other language and using any of a
> fairly wide range of APIs between the HTTP server and the program.
>
> > 2.  what do I need to do to use this in my own server?
>
> Learn about webserver configuration, HTML, CGI and at least one
> programming language (Perl, for instance).  Alternatively employ
> someone who understands this stuff.
>
> > I have been asked by my company to build a simple form with output to a
> > file, which we will import to Access, etc.
> >
> > I am using Perl Builder Software with the CGI Wizard, and have looked
> > through the help for how to output to file, and have not been able to
find
> > anything.
>
> Fancy "builder" programs and "wizards" don't generally do a complete
> job for you, you still need to fill in the spaces with real code.  In
> this case Perl code.  There is no alternative to learning to program.
> The help pages for the builder program is unlikely to cover every
> detail of Perl programming as that would be pointless duplication of
> documentation.
>
> --
>      \\   ( )
>   .  _\\__[oo
>  .__/  \\ /\@
>  .  l___\\
>   # ll  l\\
>  ###LL  LL\\




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

Date: Thu, 12 Oct 2000 08:03:26 -0600
From: "Duke Normandin" <01031149@3web.net>
Subject: Re: Works on Win2000 but not on Win98!? Why? Help!
Message-Id: <bprF5.3646$Jd4.47400@jekyl.ab.tac.net>

Wyzelli wrote in message ...
>"mark" <idk@teleport.com> wrote in message
>news:%LbF5.33136$F65.1953513@nntp2.onemain.com...
>> The following script works fine on my Windows2000 box, but prints
>nothing on
>> my Windows98 box.  (Yes the file is in the right place on both boxes.)
>I'm
>> running version 5.6.0 build 613 on W2K and 5.6.0 build 618 on the 98
>box.
>>
>> @lines = `"type c:\\testfile.txt"`;
>> print @lines;
>>
>
>Beware of reading all lines into an array if your file can be
>large...you can gobble memory real quickly.  It is perfectly OK for


[snip]

So how do you do large files?

-duke



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

Date: Fri, 13 Oct 2000 09:33:24 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Works on Win2000 but not on Win98!? Why? Help!
Message-Id: <ggsF5.8$ME4.2870@vic.nntp.telstra.net>

"Duke Normandin" <01031149@3web.net> wrote in message
news:bprF5.3646$Jd4.47400@jekyl.ab.tac.net...
> Wyzelli wrote in message ...

<snip>

> >Beware of reading all lines into an array if your file can be
> >large...you can gobble memory real quickly.  It is perfectly OK for
> [snip]
>
> So how do you do large files?
>

Line at a time:-

open (IN, "$filename") or die "caint do it captain $!";
while (<IN>){
    #do stuff to line at a time
    #each line (up to "\n" or whatever $/ is set to) is in $_
}

or

while (my $line = <IN>){
    print $line;
}

or even

while (chomp(my $line = <IN>)){
print "$line\n";
}

This allows chomp and assignment all in one simple line of code.
Naturally it is silly to chomp and then put the "\n" straight back in
but that was done here for illustrative purposes only.

Wyzelli

--
@x='07411711511603209711011111610410111403208010111410803210409709910710
1114'=~/(...)/g;
print chr for @x;








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

Date: Thu, 12 Oct 2000 17:14:58 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Works on Win2000 but not on Win98!? Why? Help!
Message-Id: <MPG.144ff3e0997bccfd98ae32@nntp.hpl.hp.com>

In article <ggsF5.8$ME4.2870@vic.nntp.telstra.net> on Fri, 13 Oct 2000 
09:33:24 +0930, Wyzelli <wyzelli@yahoo.com> says...

 ...

> or even
> 
> while (chomp(my $line = <IN>)){
> print "$line\n";
> }
> 
> This allows chomp and assignment all in one simple line of code.
> Naturally it is silly to chomp and then put the "\n" straight back in
> but that was done here for illustrative purposes only.

That produces a warning when you try to chomp the undef that comes back 
at end-of-file.  So drop it from your bag of tricks.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

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


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