[25745] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7985 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 17 18:05:25 2005

Date: Sun, 17 Apr 2005 15:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 17 Apr 2005     Volume: 10 Number: 7985

Today's topics:
        CPAN and DBD::mysql install failure newsgroups@raincode.net
    Re: CPAN and DBD::mysql install failure <spamtrap@dot-app.org>
    Re: DBI update <youdontknowme@stranger.com>
    Re: DBI update <tadmc@augustmail.com>
    Re: DBI update <matternc@comcast.net>
    Re: Do You Want To Know For Sure That You Are Going To  <wmech@bellsouth.net>
        Do You Want To Know For Sure That You Are Going To Heav RonGrossi382658@yahoo.com
    Re: outputting the results of something.pl <backhaul14@sbcglobal.net>
    Re: outputting the results of something.pl <someone@example.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 17 Apr 2005 13:25:28 -0700
From: newsgroups@raincode.net
Subject: CPAN and DBD::mysql install failure
Message-Id: <1113769528.587292.76870@f14g2000cwb.googlegroups.com>

I am having trouble getting CPAN to install DBD::mysql.  Unfortunately
I am not certain what the error means.  From looking in previous posts
I saw that mysql_config may have the wrong paths stated.  So I fixed
those.  But I am still getting the error below.  Can anyone point me
towards the solution?

It seems it can't find dbdimp.o and mysql.o.  This is true...they don't
exist on the system.  But what are they and what program is responsible
for generating them?

gcc3.3.2
perl 5.8.6
solaris 9
mysql 5.0.3 (beta)
"make" is available as I just previously installed CGI and DBI without
issue


ERROR:
<snip>
Checking if your kit is complete...
Looks good
Using DBI 1.48 (for perl 5.008006 on sun4-solaris) installed in
/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris/auto/DBI/
Writing Makefile for DBD::mysql
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris/auto/DBI/
-I/usr/local/mysql5/include -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"2.9006\"  -DXS_VERSION=\"2.9006\" -fPIC
"-I/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE"   dbdimp.c
gcc: unrecognized option `-Xa'
gcc: language arch=v9 not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g"
/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris/auto/DBI//Driver.xst
> mysql.xsi
/usr/bin/perl /usr/local/lib/perl5/5.8.6/ExtUtils/xsubpp  -typemap
/usr/local/lib/perl5/5.8.6/ExtUtils/typemap  mysql.xs > mysql.xsc && mv
mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line
196
Warning: duplicate function definition 'rows' detected in mysql.xs,
line 294
gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris/auto/DBI/
-I/usr/local/mysql5/include -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
-DVERSION=\"2.9006\"  -DXS_VERSION=\"2.9006\" -fPIC
"-I/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE"   mysql.c
gcc: unrecognized option `-Xa'
gcc: language arch=v9 not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/lib" /usr/bin/perl myld gcc  -G -L/usr/local/lib
dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so
-L/usr/local/mysql5/lib -lmysqlclient -lz -lposix4 -lcrypt -lgen
-lsocket -lnsl -lm
gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target
`blib/arch/auto/DBD/mysql/mysql.so'
  /usr/ccs/bin/make  -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible

cpan>



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

Date: Sun, 17 Apr 2005 17:05:19 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: CPAN and DBD::mysql install failure
Message-Id: <tZadnZhUV6wNUv_fRVn-jw@adelphia.com>

newsgroups@raincode.net wrote:

> It seems it can't find dbdimp.o and mysql.o.  This is true...they don't
> exist on the system.  But what are they and what program is responsible
> for generating them?

You're looking too far down. Errors like that tend to cascade - quite 
often, later errors are triggered by earlier ones. With that in mind...

> gcc -c  -I/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris/auto/DBI/
> -I/usr/local/mysql5/include -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9
> -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-strict-aliasing -pipe
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O
> -DVERSION=\"2.9006\"  -DXS_VERSION=\"2.9006\" -fPIC
> "-I/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE"   dbdimp.c
> gcc: unrecognized option `-Xa'
> gcc: language arch=v9 not recognized

This is the first error to appear. The fact that the "-Xa" option 
appears immediately after the -I that adds the search path for MySQL 
headers leads me to think that it might have been part of the output of 
mysql_config.

If that's the case, the the additional definition of -D_FORTEC leads me 
to believe that MySQL wasn't built with GCC, but with Sun's Forte C 
compiler. So, mysql_config is providing compiler flags that work with 
that compiler, but not with GCC.

Try using the CPAN shell to "look DBD::mysql"; that will download and 
unpack the module, and open up a subshell in the build directory. From 
there, run "mysql_config" by hand to see what its notion of the proper 
include and library flags is, and adjust those as needed to build with 
GCC instead of Forte.

You can manually provide the adjusted options to Makefile.PL when you 
run that. Details can be found in the INSTALL.html file that's included 
with DBD::mysql, but in a nutshell it's:

     perl Makefile.PL --cflags='-I/foo/bar' --libs='-L/foo/baz'

Another possibility - although I consider it less likely - is that the 
problem compiler flags are being produced by Perl itself. To see what 
flags Perl is producing, run this:

     perl -MConfig -e 'print $Config{ccflags}, "\n"'

If that's where they're coming from, that's a sign that Perl itself was 
built with Forte. You might have some luck either hacking Config.pm, or 
the generated Makefile to fix the flags to work with GCC.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 17 Apr 2005 19:23:43 +0100
From: "Bigus" <youdontknowme@stranger.com>
Subject: Re: DBI update
Message-Id: <Jp-dnfJZiMmBN__fRVnyug@giganews.com>


"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnd64sqt.uje.tadmc@magna.augustmail.com...
> Bigus <youdontknowme@stranger.com> wrote:
> > "Tad McClellan" <tadmc@augustmail.com> wrote in message
> > news:slrnd62hkt.h2e.tadmc@magna.augustmail.com...
>
>
> >> Are you properly untainting it?
> >
> > Not 100% what you mean by 'untaint',
>
>
> I think a more accurate assessment would be that you are 0% sure
> what I meant by untaint?

:-) well, actually, I was thinking along the lines that you meant parsing
the form content properly, but it was all a bit vague

> You will learn more if you are up-front about what it is you don't know,
> because then someone can help you learn it.
>
> *All* CGI programs that take form input should use Perl's "taint checking"
> mechanism to help protect against getting hacked.
>
>    perldoc perlsec
>
>
> > but I use these lines to process the
> > form data into the hash:
> >
> > use CGI;
> > $query = new CGI;
>
>
> Surely you don't _really_ do it that way.
>
> You probably meant this instead:
>
>    my $query = new CGI;
>
> since you should have "use strict;" in all of your Perl programs.

normally do, but not in this case.. corrected now!

> See the docs mentioned above for how to untaint your tainted data.

thanks.. although, I've just had a skim through and I'm not 100% sure... I
mean I'm 0% sure what I'm supposed to do! Actually, in this case, though, if
anything other than an integer was returned in that form field, then the
program simply wouldn't find the database row and therefore not load the
item... or is there something more sinister that could happen?

Bigus






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

Date: Sun, 17 Apr 2005 13:49:11 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: DBI update
Message-Id: <slrnd65bt7.vof.tadmc@magna.augustmail.com>

Bigus <youdontknowme@stranger.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnd64sqt.uje.tadmc@magna.augustmail.com...
>> Bigus <youdontknowme@stranger.com> wrote:
>> > "Tad McClellan" <tadmc@augustmail.com> wrote in message
>> > news:slrnd62hkt.h2e.tadmc@magna.augustmail.com...
>>
>>
>> >> Are you properly untainting it?
>> >
>> > Not 100% what you mean by 'untaint',
>>
>>
>> I think a more accurate assessment would be that you are 0% sure
>> what I meant by untaint?


>> *All* CGI programs that take form input should use Perl's "taint checking"
>> mechanism to help protect against getting hacked.
>>
>>    perldoc perlsec


>> See the docs mentioned above for how to untaint your tainted data.
> 
> thanks.. although, I've just had a skim through and I'm not 100% sure... I
> mean I'm 0% sure what I'm supposed to do! 


heh.

Start with the code from the docs:

    if ($data =~ /^([-\@\w.]+)$/) {
        $data = $1;                     # $data now untainted
    } else {
        die "Bad data in $data";        # log this somewhere
    }

and modify it for your situation.


> Actually, in this case, though, if
> anything other than an integer 


    if ($form{number} =~ /^(\d+)$/) {
        $form{number} = $1;
    } else {
        die "Bad data in '$form{number}'";        # log this somewhere
    }


Now $form{number} is untainted.


> was returned in that form field, then the
> program simply wouldn't find the database 
                                   ^^^^^^^^

You are likely open to an "SQL injection" attack then.


> row and therefore not load the
> item... or is there something more sinister that could happen?


There is something more sinister that could happen (which is why
*All* CGI programs that take form input should use Perl's "taint checking"
mechanism to help protect against getting hacked).



-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 17 Apr 2005 14:53:14 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: DBI update
Message-Id: <w_ednZMlMowHLf_fRVn-hA@comcast.com>

Bigus wrote:

> 
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnd64sqt.uje.tadmc@magna.augustmail.com...
>> Bigus <youdontknowme@stranger.com> wrote:
>> > "Tad McClellan" <tadmc@augustmail.com> wrote in message
>> > news:slrnd62hkt.h2e.tadmc@magna.augustmail.com...
>>
>>
>> >> Are you properly untainting it?
>> >
>> > Not 100% what you mean by 'untaint',
>>
>>
>> I think a more accurate assessment would be that you are 0% sure
>> what I meant by untaint?
> 
> :-) well, actually, I was thinking along the lines that you meant parsing
> the form content properly, 

No, it doesn't mean anything like that.

> but it was all a bit vague 

No, it wasn't vague at all.  "untainting" means something very specific
in Perl, and something you really need to understand before you start
parsing web forms you're presenting to the public.  Take Tad's advice
and read perldoc perlsec.

<snip>

>> See the docs mentioned above for how to untaint your tainted data.
> 
> thanks.. although, I've just had a skim through and I'm not 100% sure... I
> mean I'm 0% sure what I'm supposed to do! Actually, in this case, though,
> if anything other than an integer was returned in that form field, then
> the program simply wouldn't find the database row and therefore not load
> the item... or is there something more sinister that could happen?
> 
Difficult to say; the vulnerabilities will likely depend on exactly what
database backend you're using.  As a general rule, passing data you don't
control to *anything* is risky unless you scrub it first.  Better safe 
than finding out first-hand about that buffer overrun exploit.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Sun, 17 Apr 2005 17:30:12 -0400
From: "wmech" <wmech@bellsouth.net>
Subject: Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven wh
Message-Id: <avA8e.94147$vK6.26530@bignews3.bellsouth.net>

You have one little problem. There is NO objective evidence that your God or
heaven actually exist.

The Bibles are just a mixture of folklore, legends, and mythology.

The Bibles are copies of copies of copies. NO original documents exist. They
are jus wild stories created by people dependent on their religious beliefs
for sustenance.

The objective evidence is that God did not create man but that man created
Gods!

-- 
Bill
<RonGrossi382658@yahoo.com> wrote in message
news:1113762024.374509.230040@z14g2000cwz.googlegroups.com...
>
> The reason some people don't know for sure
> if they are going to Heaven when they die
> is because they just don't know.
>
> The good news is that you can know for
> sure that you are going to Heaven which is
> described in the Holy Bible as a beautiful
> place with no death, sorrow, sickness or
> pain.
>
> God tells us in the Holy Bible how simple
> it is to be saved so that we can live
> forever with Him in Heaven.
>
> "For if you confess with your mouth Jesus
> is Lord and believe in your heart that God
> raised Him from the dead, you
> WILL BE SAVED." (Romans 10:9)
>
> Over 2000 years ago God came from Heaven
> to earth in the person of Jesus Christ to
> shed His blood and die on a cross to pay
> our sin debt in full.
>
> Jesus Christ was born in Israel
> supernaturally to a virgin Jewish woman
> named Mary and lived a sinless life for
> thirty-three years.
>
> At the age of thirty-three Jesus was
> scourged and had a crown of thorns pressed
> onto His head then Jesus was crucified.
>
> Three days after Jesus died on a cross and
> was placed in a grave Jesus rose from the
> dead as Jesus said would happen before
> Jesus died.
>
> If someone tells you that they are going
> to die and in three days come back to life
> again and it happens then this person must
> be the real deal.
>
> Jesus Christ is the only person that ever
> lived a perfect sinless life.
>
> This is why Jesus is able to cover our
> sins(misdeeds) with His own blood because
> Jesus is sinless.
>
> The Holy Bible says, "In Him(Jesus) we
> have redemption through His blood, the
> forgiveness of sins..." (Ephesians 1:7)
>
> If you would like God to forgive you of
> your past, present and future sins just
> ask Jesus Christ to be your Lord and
> Saviour.
>
> It doesn't matter how old you are or how
> many bad things that you have done in
> your life including lying and stealing
> all the way up to murder.
>
> Just pray the prayer below with your
> mouth and mean it from your heart and
> God will hear you and save you.
>
> Dear Jesus Christ, I want to be saved so
> that I can have a home in Heaven with You
> when I die. I agree with You that I am a
> sinner. I believe that You love me and want
> to save me. I believe that You bled and
> died on the cross to pay the penalty for my
> sins and that You rose from the dead.
> Please forgive my sins and come into my
> heart and be my Lord and Saviour. Thanks
> Lord Jesus Christ for forgiving me and
> saving me through Your merciful grace.
> Amen.
>
> Welcome to the family of God if you just
> allowed God to save you. Now you are a real
> Christian and you can know for sure that
> you will live in Heaven forever when this
> life comes to an end.
>
> As a child of God we are to avoid
> sin(wrongdoing), but if you do sin the
> Holy Bible says, "My dear children, I
> write this to you so that you will not sin.
> But if anybody does sin, we have one who
> speaks to the Father in our defense Jesus
> Christ, the Righteous One."
>
> Those of you that have not yet decided to
> place your trust in the Lord Jesus Christ
> may never get another chance to do so
> because you do not know when you will die.
>
> Jesus said "I am the way, the truth and
> the life: no one can come to the
> Father(in Heaven), but by me."
> (John 14:6)
>
> This means that if you die without
> trusting in Jesus Christ as your Lord and
> Saviour you will be forever separated from
> the love of God in a place called Hell.
>
> The Holy Bible descibes Hell as a place of
> eternal torment, suffering, pain and agony
> for all those who have rejected Jesus Christ.
>
> The good news is that you can avoid Hell by
> allowing Jesus Christ to save you today.
> Only then will you have true peace in your
> life knowing that no matter what happens you
> are on your way to Heaven.
>
>
> Praise the Lord!
> Servant of the Lord Jesus Christ
> Ronald L. Grossi
>
> *Show this to your family and friends so
> they can know that they have a choice
> where they will spend eternity. Thanks!
>
> ____________________________________________________
>
>
>
> Got Questions?
> http://www.gotquestions.org/archive.html
>
> Other Languages
> http://www.godssimpleplan.org/gsps.html
>
> Free Movie: To Hell and Back
> http://www.tbn.org/index.php/8/1.html
>
> Animation
> http://www.browser.to/jesus-animation
>
> The Passion Of The Christ
> http://www.thepassionofthechrist.com
>
> Beware Of Cults
> http://www.carm.org/cults/cultlist.htm
>
> About Hell
> http://www.equip.org/free/DH198.htm
>
> Is Jesus God?
> http://www.powertochange.com/questions/qna2.html
>
> Free Online Bible
> http://www.bibledatabase.net
>
>
> ____________________________________________________
>




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

Date: 17 Apr 2005 11:20:24 -0700
From: RonGrossi382658@yahoo.com
Subject: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven which is described in the Holy Bible as a beautiful place with no death, sorrow, sickness or pain. (newsgroup-post 141)
Message-Id: <1113762024.374509.230040@z14g2000cwz.googlegroups.com>


The reason some people don't know for sure
if they are going to Heaven when they die
is because they just don't know.

The good news is that you can know for
sure that you are going to Heaven which is
described in the Holy Bible as a beautiful
place with no death, sorrow, sickness or
pain.

God tells us in the Holy Bible how simple
it is to be saved so that we can live
forever with Him in Heaven.

"For if you confess with your mouth Jesus
is Lord and believe in your heart that God
raised Him from the dead, you
WILL BE SAVED." (Romans 10:9)

Over 2000 years ago God came from Heaven
to earth in the person of Jesus Christ to
shed His blood and die on a cross to pay
our sin debt in full.

Jesus Christ was born in Israel
supernaturally to a virgin Jewish woman
named Mary and lived a sinless life for
thirty-three years.

At the age of thirty-three Jesus was
scourged and had a crown of thorns pressed
onto His head then Jesus was crucified.

Three days after Jesus died on a cross and
was placed in a grave Jesus rose from the
dead as Jesus said would happen before
Jesus died.

If someone tells you that they are going
to die and in three days come back to life
again and it happens then this person must
be the real deal.

Jesus Christ is the only person that ever
lived a perfect sinless life.

This is why Jesus is able to cover our
sins(misdeeds) with His own blood because
Jesus is sinless.

The Holy Bible says, "In Him(Jesus) we
have redemption through His blood, the
forgiveness of sins..." (Ephesians 1:7)

If you would like God to forgive you of
your past, present and future sins just
ask Jesus Christ to be your Lord and
Saviour.

It doesn't matter how old you are or how
many bad things that you have done in
your life including lying and stealing
all the way up to murder.

Just pray the prayer below with your
mouth and mean it from your heart and
God will hear you and save you.

Dear Jesus Christ, I want to be saved so
that I can have a home in Heaven with You
when I die. I agree with You that I am a
sinner. I believe that You love me and want
to save me. I believe that You bled and
died on the cross to pay the penalty for my
sins and that You rose from the dead.
Please forgive my sins and come into my
heart and be my Lord and Saviour. Thanks
Lord Jesus Christ for forgiving me and
saving me through Your merciful grace.
Amen.

Welcome to the family of God if you just
allowed God to save you. Now you are a real
Christian and you can know for sure that
you will live in Heaven forever when this
life comes to an end.

As a child of God we are to avoid
sin(wrongdoing), but if you do sin the
Holy Bible says, "My dear children, I
write this to you so that you will not sin.
But if anybody does sin, we have one who
speaks to the Father in our defense Jesus
Christ, the Righteous One."

Those of you that have not yet decided to
place your trust in the Lord Jesus Christ
may never get another chance to do so
because you do not know when you will die.

Jesus said "I am the way, the truth and
the life: no one can come to the
Father(in Heaven), but by me."
(John 14:6)

This means that if you die without
trusting in Jesus Christ as your Lord and
Saviour you will be forever separated from
the love of God in a place called Hell.

The Holy Bible descibes Hell as a place of
eternal torment, suffering, pain and agony
for all those who have rejected Jesus Christ.

The good news is that you can avoid Hell by
allowing Jesus Christ to save you today.
Only then will you have true peace in your
life knowing that no matter what happens you
are on your way to Heaven.


Praise the Lord!
Servant of the Lord Jesus Christ
Ronald L. Grossi

*Show this to your family and friends so
they can know that they have a choice
where they will spend eternity. Thanks!

____________________________________________________



Got Questions?
http://www.gotquestions.org/archive.html

Other Languages
http://www.godssimpleplan.org/gsps.html

Free Movie: To Hell and Back
http://www.tbn.org/index.php/8/1.html

Animation
http://www.browser.to/jesus-animation

The Passion Of The Christ
http://www.thepassionofthechrist.com

Beware Of Cults
http://www.carm.org/cults/cultlist.htm

About Hell
http://www.equip.org/free/DH198.htm

Is Jesus God?
http://www.powertochange.com/questions/qna2.html

Free Online Bible
http://www.bibledatabase.net


____________________________________________________



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

Date: Sun, 17 Apr 2005 19:55:30 GMT
From: jim jowski <backhaul14@sbcglobal.net>
Subject: Re: outputting the results of something.pl
Message-Id: <Saz8e.2631$J12.2416@newssvr14.news.prodigy.com>

jim jowski wrote:
> I've written an html form that will pass three values to a script called 
> 'something.pl' which lives in my cgi-bin directory.  When something.pl 
> is executed; I get the following error message:
> 
> [Sun Apr 17 08:24:37 2005] [error] [client 127.0.0.1] malformed header 
> from script. Bad header=<html><head><title>the title</: 
> /var/www/cgi-bin/something.pl
> 
> 'something.pl' is nothing more than:
> 
> #!/usr/bin/perl
> 
> $dollar0 = @ARGV[0];
> $dollar1 = @ARGV[1];
> $dollar2 = @ARGV[2];
> 
> print "<html><head><title>the title</title></head>";
> print "<body><p>dollar0 = $dollar0\n";
> print "<p>\tdollar1 = $dollar1\n";
> print "<p>\t\tdollar2 = $dollar2\n";
> print "</body></html>";
> 
> and the html form that calls 'something.pl' is:
> 
> <html><head><title>input</title></head>
> <body><form method="post" action="/cgi-bin/something.pl">
> <P>value 0: <input type="text" name="v0" size=10></p>
> <P>value 1: <input type="text" name="v1" size=10></p>
> <P>value 2: <input type="text" name="v2" size=10></p>
> <P><input type="submit" name="submit" value="calculate"></P>
> </form>
> </body>
> </html>
> 
> I know that I can do all this with PHP but I have too much time invested 
> in perl code that I can clone to migrate.  Once I have this simple 
> output problem solved, I can hopefully do the rest of the project this 
> week.
> 
> Thanks,
> Jim

I was able to get the output of 'something.pl' to display by changing it to:

#!/usr/bin/perl

use CGI;
$query = new CGI;
@names = $query->param; #the names of the passed parameters
$dollar0 = $query->param('v0');
$dollar1 = $query->param('v1');
$dollar2 = $query->param('v2');

print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>the TITLE</TITLE></HEAD>\n\n<BODY>";
print "<p>dollar0 = $dollar0\n";
print "<p>\tdollar1 = $dollar1\n";
print "<p>\t\tdollar2 = $dollar2\n";
print "</BODY></HTML>";

This brought in the passed parameter values by using $query-> and the 
"Content-..." line with two newlines made the header legal.  (Good thing 
too because the programming police were on their way...)

Thanks again to all, especially Tad McClellan, for the gentle guidance 
in the right direction.  Maybe these snippets will be useful to others 
"when" the same question arises.

Jim


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

Date: Sun, 17 Apr 2005 20:47:12 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: outputting the results of something.pl
Message-Id: <kXz8e.36456$VF5.7141@edtnps89>

John wrote:
> Maybe you need to backquote or escape-out the slashes in your literal
> 
> instead of:
> 
> <title>the title</title>
> 
> maybe:
> 
> <title>the title<\/title>

He would if he was doing:

print qq/<title>the title<\/title>/;

Instead of:

print "<title>the title</title>";

Slashes are not special in double quoted strings.



John
-- 
use Perl;
program
fulfillment


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

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


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

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

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

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

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


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


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