[9792] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3385 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 7 02:07:00 1998

Date: Thu, 6 Aug 98 23:00:17 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 6 Aug 1998     Volume: 8 Number: 3385

Today's topics:
        ' (quote) characters making problems vanja@siamrelay.com
    Re: ' (quote) characters making problems <rootbeer@teleport.com>
    Re: ' (quote) characters making problems (Nem W Schlecht)
    Re: ' (quote) characters making problems (Larry Rosler)
    Re: 500 Server error (Martien Verbruggen)
    Re: 500 Server error (Martien Verbruggen)
    Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in <cjdpcssd@ims-1.com>
        Autoincrement with hashes <maryesme@mail.localaccess.com>
    Re: c.l.p.moderated: not much traffic? <mpersico@erols.com>
    Re: c.l.p.moderated: not much traffic? (Gabor)
        cgi <dean@connect.com.au>
    Re: cgi <rootbeer@teleport.com>
    Re: database.pl/.cgi <REPLY_TO_lastronin@earthlink.net>
    Re: File Upload with Perl (Martien Verbruggen)
        HELP -- GD for images <dales@enhanced-performance.com>
    Re: IPC semaphores in Perl under FreeBSD <lutz@muc.de>
        ODBC, Perl, Unix and Macs (William Burrow)
    Re: perlfaq - frequently asked questions about Perl (pa <cjdpcssd@ims-1.com>
    Re: perlfaq - frequently asked questions about Perl (pa <rootbeer@teleport.com>
    Re: Premature end of script headers & Exec format error <REPLY_TO_lastronin@earthlink.net>
    Re: Premature end of script headers & Exec format error <fairbrothers@smart.net>
        Regarding autosplit.ix b_pillai@hotmail.com
        Server or Programmer problems? <mcross@mics.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 07 Aug 1998 02:58:25 GMT
From: vanja@siamrelay.com
Subject: ' (quote) characters making problems
Message-Id: <6qdqgh$j33$1@nnrp1.dejanews.com>

I have a small problem. Here is the problematic line:

-----------------------------------------------------------------------
print "<input type='text' name='something' value='$message'>";
-----------------------------------------------------------------------

$message is a long string. However, sometimes it contains quote ('), and only
part of the message (before appearance of ') will fill the textbox. I presume
that apperance of ' "substitutes" the 2nd quote in perl code, and the rest of
the message is lost.

(in example, message can be: "Mike's car". And only "Mike" will appear in
textbox).

Is there any way to solve this?

Thanks in advance,

Vanja

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 07 Aug 1998 03:36:03 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: ' (quote) characters making problems
Message-Id: <Pine.GSO.4.02.9808062031560.74-100000@user2.teleport.com>

On Fri, 7 Aug 1998 vanja@siamrelay.com wrote:

> I have a small problem. Here is the problematic line:
> 
> -----------------------------------------------------------------------
> print "<input type='text' name='something' value='$message'>";
> -----------------------------------------------------------------------

Nothing wrong with that.

> $message is a long string. However, sometimes it contains quote ('),
> and only part of the message (before appearance of ') will fill the
> textbox. I presume that apperance of ' "substitutes" the 2nd quote in
> perl code, and the rest of the message is lost.

Nope, perl can handle quote characters in strings just fine. But maybe the
result isn't valid HTML. (Or, at least, it's not the HTML that's doing
what you want.) If that's your problem, maybe you need to find out how to
re-write the HTML to do what you want. The docs, FAQs, and newsgroups
about HTML and related topics should be able to help you. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 6 Aug 1998 22:26:47 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: ' (quote) characters making problems
Message-Id: <6qds5n$dj3@abattoir.cc.ndsu.nodak.edu>

[courtesy copy e-mailed to author(s)]

In comp.lang.perl.misc,  <vanja@siamrelay.com> wrote:
>I have a small problem. Here is the problematic line:
>
>-----------------------------------------------------------------------
>print "<input type='text' name='something' value='$message'>";
>-----------------------------------------------------------------------
>
>$message is a long string. However, sometimes it contains quote ('), and only
>part of the message (before appearance of ') will fill the textbox. I presume
>that apperance of ' "substitutes" the 2nd quote in perl code, and the rest of
>the message is lost.

Well.. this is actually more of a CGI question.  Convert the single quotes
in your string over to HTML single quote character entities (put this line
before your print statement):

$message =~ s/\'/&#39;/go;

-- 
Nem W Schlecht                  nem@plains.nodak.edu
NDUS UNIX SysAdmin        http://www.nodak.edu/~nem/
"Perl did the magic.  I just waved the wand."


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

Date: Thu, 6 Aug 1998 20:34:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: ' (quote) characters making problems
Message-Id: <MPG.103415b47e0d31fc9897bc@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6qdqgh$j33$1@nnrp1.dejanews.com> on Fri, 07 Aug 1998 02:58:25 
GMT, vanja@siamrelay.com <vanja@siamrelay.com> says...
 ...
> print "<input type='text' name='something' value='$message'>";
 ... 
> (in example, message can be: "Mike's car". And only "Mike" will appear in
> textbox).

This is an HTML problem, not a Perl problem.  The apostrophe in "Mike's 
car" is terminating the 'value' parameter.

You should be using double-quotes to delimit HTML parameters.  Try the 
following (note the use of qq quoting so all the double-quotes don't have 
to be escaped:

  print qq|<input type="text" name="something" value="$message">|;

Now, as long as you don't have double-quotes (or '>'s) in $message, you 
will be OK.  Consult HTML documentation for how to include such 
characters.  There are functions in CGI.pm that would help also.

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


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

Date: 7 Aug 1998 03:07:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 500 Server error
Message-Id: <6qdr0n$g7o$1@nswpull.telstra.net>

In article <MPG.103256fa4923c0e0989683@news.techno-link.com>,
	plamendp@techno-link.com (Plamen Petkov) writes:

> Do you have this line (as your very first CGI-output):
> 
> print "Content-type: text/html\n\n";

If that line wasn't there, then it wouldn't work anywhere. Besides,
the output might not even be html.

> === PLEASE REMOVE ## FROM MY EMAIL ADDRESS! GUESS WHY :-) ===

Do you realise that your From: line actually has your correct email
address in it? Email harvesters will certainly look there first. No
use in garbling your email address in the body if you don't also
garble your From and Reply-To addresses.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 7 Aug 1998 03:09:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: 500 Server error
Message-Id: <6qdr5g$g7o$2@nswpull.telstra.net>

In article <6q7ire$db3$1@heliodor.xara.net>,
	"Martin" <minich@globalnet.co.uk> writes:
> Hi!
> 
> I have a CGI that is working fine on an NT server but won't do
> anything on a Unix one. I just get this message. What would
> generally cause this sort of message?

Added to what others already have pointed out: What are the versions
of the two perls? If they are very different, it might be that your
script just doesn't compile. Try running it from the command line on
both machines, and see what happens. Find out what the version of perl
are. read perlfaq section 9 (# perldoc perlfaq9).

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Thu, 6 Aug 1998 23:39:03 -0500
From: "Curtis Jewell / Dennis Whalen" <cjdpcssd@ims-1.com>
Subject: Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in text version archive?
Message-Id: <6qe0dm$975@enews1.newsguy.com>


Tom Christiansen wrote in message <6qdkpd$6iv$1@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc,
>    cicho@polbox.com (Marek Jedlinski) writes:
>:Suggested solution: since gzip is unix-centric anyway, please provide a
>:.zip archive version as well.
>
>No, sir.  CPAN is in .tar.gz format.  You're talking about four thousand,
>one hundred and ninety-two files to duplicate.  If the Windows folks
>want to play on the net, then they need to cope with the norms here.


Personally, I agree with you... .tar.gz is perfectly fine with me, and I
run Windoze. But nicely just tell them to please avoid .txt.gz in the
future and all will be well with them and us.

Even if they do .txt.tar.gz!

I'm forced into Windows... (I'd use Linux if I had the HD room!)

--Curtis



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

Date: Thu, 06 Aug 1998 21:11:27 -0700
From: Mark Lybrand <maryesme@mail.localaccess.com>
Subject: Autoincrement with hashes
Message-Id: <35CA7E6F.5CE6@mail.localaccess.com>

Hello,

I am afraid that I am at a loss to say EXACTLY what the following line
is 
saying:

grep($ALL_FIELDS{$_}++,@$_);

This is from Lincoln Stein's book on CGI.pm.

I saw similar constructs in the PERL FAQ.  My best guess is that it is
saying:

1. Construct an array using the $_ variable.
2. Make $ALL_FIELDS{'next element in the @$_ array'}.
3. Repeat.

But what does the ++ do for us with hashes???  

TIA.

Mark Lybrand


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

Date: Fri, 07 Aug 1998 00:04:31 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: c.l.p.moderated: not much traffic?
Message-Id: <35CA7CCF.A44741BD@erols.com>

Um, wasn't the whole point of clp.mod6 supposed to be that all of the
FAQ questions get dropped into the bit bucket? Seems to me that:

1) It's working
2) It highlights the very LOW signal to noise ratio on clp.misc

-- 
#!/usr/bin/perl -- Matthew O. Persico, Just Another Perl Neophyte
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're supportin this stuff
## at 2AM


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

Date: 7 Aug 1998 04:19:32 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: c.l.p.moderated: not much traffic?
Message-Id: <slrn6sl05v.165.gabor@guava.vmunix.com>

In comp.lang.perl.misc, John Klassa <klassa@aur.alcatel.com> wrote :
# Is it me, or is the traffic on c.l.p.moderated pretty much a
# trickle?

Actually, I thought that traffic was quite high for a brand new
moderated group.  Most moderated groups see low traffic and all new
groups see low traffic.  The combination of the two may seem like a
'trickle' to you.  I think it's great to be able to read carefully all
the posts, though I have noticed a flame war already brewing between the
old guard in the group. :(


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

Date: 7 Aug 1998 03:27:36 GMT
From: Dean McDonald <dean@connect.com.au>
Subject: cgi
Message-Id: <6qds78$d00$1@perki.connect.com.au>

hi,
im learning perl/cgi at the moment and im tryign to write a simply cgi
interface script that basically is a plain page, with a "username" field..
and when a username is entered it "fingers" that usename on the local machine.
Finger just being the unix "finger" command. Below is the code i've written,
so far.. however it doesnt do _exactly_ what i want. The page seems to load
up okay, but doesnt execute the finger commmand and/or output the results.
Could someone maybe have a look, and maybe test it and see where im going
wrong?. I'd appreciate it..

===============================>

ccount administration 

$tmpfile = "/tmp/uuser";
require "cgi-lib.pl" || die "cannot open cgi-lib.pl!";

if ($username ne 0){
 &input;
 } else {
 &input;
 &output;
 }

 #####
 sub input{
 print <<EOF;
 Content-type: text/html

 <TITLE>Username Search</TITLE>
 <BODY BGCOLOR="#F3F3F3">
 <CENTER>
 <H2>Username Search</H2> 
 <HR WIDTH=60%>
 <BR>
 Please enter a username to search for. This is a *very* simple search!
 <br>
 <form action="check.cgi" method=POST>
 <P>Enter Username:
 <input type=text name=username>(eg blah)
 <br>
 <input type=submit name=username value="Check">
 </form>
 <br>
 <hr width=60%>
 </CENTER>
 </BODY>
 EOF
 }
 ###########
 sub output{
 open (FINGER,"finger $username|")||die "finger died\n"; while
 (<FINGER>){print;}
 }

======================================>


Thanks,

Dean.


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

Date: Fri, 07 Aug 1998 03:48:42 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: cgi
Message-Id: <Pine.GSO.4.02.9808062039580.74-100000@user2.teleport.com>

On 7 Aug 1998, Dean McDonald wrote:

> Subject: cgi

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> im learning perl/cgi 

There's no such thing as perl/cgi. Sure, you can use Perl to do CGI
programming, but that's like saying that you're learning how to eat
soup/dinner or that you're learning to drive a Toyota/to-work. :-)

It sounds as if you're learning Perl, and you're trying to also learn how
to use it for CGI scripting. Okay...

> im tryign to write a simply cgi interface script that basically is a
> plain page, with a "username" field.. and when a username is entered
> it "fingers" that usename on the local machine.

Okay, but be sure that you don't put in any security holes! (I'm not
kidding; it's not unreasonable that somebody could break into your system
if your script isn't well written.) See the various web and CGI security
FAQs, and the perlsec manpage; and use 'use strict' and taint checking.

> require "cgi-lib.pl" || die "cannot open cgi-lib.pl!";

That's not doing what you want. Check the docs for 'require' and for the
'||' operator's precedence. Also, if you use CGI.pm instead of cgi-lib.pl,
you'll be able to debug your program from the command line - a BIG plus.

> if ($username ne 0){

You never set $username, and you either want to change the 'ne' or the
zero. You should develop your script with -w warnings turned on, to help
you catch errors like this.

>  open (FINGER,"finger $username|")||die "finger died\n"; while

Security hole! Better fix that; with code like this, it's not hard for a
remote user to, for example, get a copy of your password file. Fortunately
for you, your program seems to be too messed up to allow that. :-)

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/





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

Date: Thu, 6 Aug 1998 22:38:10 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: database.pl/.cgi
Message-Id: <6qdomf$fo2$1@fir.prod.itd.earthlink.net>

the best way to go about what you're thinking is to use SSI:

<!--#exec cgi="/cgi-bin/dirname/display.cgi" -->

it's a good idea to break up your suite of scripts into a display, admin
add/edit/delete, and a user add/edit/delete (3 scripts minimum), wherein ALL
the display script would do is to pop up the featured software on your
homepage.

write your display script to display features in a logical manner, e.g. by
date or most popular, etc. (maybe a good idea to incorporate this option
into your admin script, heehee :-)

#!/usr/bin/perl -w
&ReadQueryString;
[blah blah] ....

print "Content-type: text/html\n\n";
open (DAT, "<$path")
    || print "Error reading file: $path";
while (<DAT>)
{
   [ do something here and display the results ...]
}
close(DAT);
exit;

other than that tidbit, you'll have to be more specific with your request
for help before we can help further. send me the code or something.

cheers,
ha quach
mailto:info@r-go.com





Walter Hargrave wrote in message <35C9CFAC.45233262@clubknowledge.com>...
>How does one retrieve from a database in a hidden form without having
>to press a submit button.
>
> I have a database of author submited software and want to have a
>featured piece come from that database from a flagged field automaticly
>on my home page.
>
> Thanks,
>   Walter Hargrave
>http://clubknowledge.com/




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

Date: 7 Aug 1998 03:16:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: File Upload with Perl
Message-Id: <6qdri4$g7o$3@nswpull.telstra.net>

In article <35c825ce.2131839@news.demon.co.uk>,
	Darren@introdesign.com (Darren Ferguson) writes:
> On Tue, 4 Aug 1998 15:39:33 GMT, Brent Michalski <perlguy@inlink.com>
> wrote:
> 
>>Try CGI.pm
> 
> Unfortunately.... I can't.... I really do need a Perl only
> solution.... I've used CGI.pm before but simply can't install it on
> the system i'm using due to tight administrators.....

Euhm.. CGI.pm is a perl only solution. CGI.pm comes with recent
versions of perl. If you are working with a version of perl that
doesn't include CGI.pm, you should probably warn your admins that
older versions contain bugs, some of which are security related. If
they're tight, that should get them into action.

If they're not really tight, but just plain lazy: You can install
CGI.pm in your own directory somewhere.

# perldoc perlfaq8
     How do I install a CPAN module?
     How do I keep my own module/library directory?
     How do I add the directory my program lives in to the
     module/library search path?
	
If you don't want to install this module, you can always just look at
the relevant parts of the code, and copy only that.

Alternatively you can try to find cgi-lib.pl which should also be able
to do that. Alternatively you can reinvent the wheel and do it
yourself, but I am not going to break my head over how to do it :)

I think I'm out of alternatives now.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Fri, 07 Aug 1998 04:23:21 GMT
From: Dale Sutcliffe <dales@enhanced-performance.com>
Subject: HELP -- GD for images
Message-Id: <35CA812B.8BAD40F2@enhanced-performance.com>

    I am using Microsoft PWS, and perl 5.004 on windows 98 and am having

trouble with some of the perl code for use with GD.  Specifically, the
code for gd_example works fine (attached at the end), but the following
code never returns anything:

------------------------
#!/usr/local/bin/perl

use GD;

$im = new GD::Image(300,300);
# allocate white
$white = $im->colorAllocate(255, 255, 255);
# allocate black
$black = $im->colorAllocate(0, 0, 0);
# allocate red
$red = $im->colorAllocate(255, 0, 0);
# allocate green
$green = $im->colorAllocate(0,255,0);
# allocate yellow
$yellow = $im->colorAllocate(255,250,205);

open (GIF,"tile.gif") || die;
$myImage = newFromGif GD::Image(GIF) || die;
close GIF;
___________________
#!/usr/local/bin/perl

use GD;

print "Content-type: image/gif\n\n";


# create a new image
$im = new GD::Image(100,100);

# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);

# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');

# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);

# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);

# And fill it with red
$im->fill(50,50,$red);

binmode STDOUT;

# Convert the image to GIF and print it on standard output
 print $im->gif;

___________________
Any suggestions?
    Thanks a lot!!
        Dale










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

Date: Thu, 06 Aug 1998 09:32:56 +0000
From: Lutz Albers <lutz@muc.de>
To: kulakov@kulakov.msk.ru
Subject: Re: IPC semaphores in Perl under FreeBSD
Message-Id: <35C97848.AFE97D81@muc.de>

Vladimir I. Kulakov wrote:
> 
> Hi All!
> 
> Trying to use 'semget', 'semctl' and the like syscalls in Perl 5 for
> FreeBSD 2.2.5 I've got the message "IPC system V is not supported
> on this mashine" ;(
> So, I've rebuilded the kernel, turning the "SEMAPHORES" option on,
> but the problem is still the same ;(
> Is there any way to make semaphores work right with Perl under FreeBSD?

You have SysV IPC support build in the kernel, or ? AFAIK it's not in
the kernel by default. 

Please post only to ONE newsgroup at a time !

ciao
  lutz
--
Lutz Albers, lutz@muc.de, pgp key available from <http://www.pgp.net>
Do not take life too seriously, you will never get out of it alive.


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

Date: 7 Aug 1998 02:25:07 GMT
From: aa126@NOSPAM.fan.nb.ca (William Burrow)
Subject: ODBC, Perl, Unix and Macs
Message-Id: <slrn6skpc2.4ii.aa126@fan1.fan.nb.ca>

I'm trying to get a grasp on how Perl and ODBC can work for me.  First off,
where in Perl can I get ODBC support for other than Win32?  Is it in the DBI
module?  Second, can I use this Perl ODBC support as a means to access any
database that supports ODBC?  

I see that Filemaker is going to support ODBC in its next release, and
I am in a position for possibly developing Perl code targeted for a Mac
using Filemaker.  My design work is done on a Unix box.  So it would be
convenient to me to able to develop and test on the Unix box before 
deploying on the Mac, if you get the gist of the situation.

Hope that is specific enough for an answer. :)

-- 
William Burrow, VE9WIL  --  New Brunswick, Canada     o
Copyright 1998 William Burrow                     ~  /\
                                                ~  ()>()


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

Date: Thu, 6 Aug 1998 23:28:46 -0500
From: "Curtis Jewell / Dennis Whalen" <cjdpcssd@ims-1.com>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <6qdvqf$91j@enews1.newsguy.com>


Peter A Fein wrote in message ...
>I guess it's ok (like I'm some authority or something? Sheesh).  I
>would have thought a pointer to those docs (in the form of see 'man
>perlfaq') would have been sufficient. But hey if it works, whatever.


What about those unlucky ones who do not have a man (Win32, Mac)? I've been
looking for a man variant at all (much less that RUNS) on Win95 for a YEAR.

Maybe someone should send me the markup language used and I'll write a
graphical one!

(No sick minds, please!)

--Curtis



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

Date: Fri, 07 Aug 1998 05:34:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <Pine.GSO.4.02.9808062232110.74-100000@user2.teleport.com>

On Thu, 6 Aug 1998, Curtis Jewell / Dennis Whalen wrote:

> What about those unlucky ones who do not have a man (Win32, Mac)? 

The docs still come with Perl. I don't remember what the command is on
Windows, but MacPerl comes with Shuck, a handy utility for browsing POD
files.

> Maybe someone should send me the markup language used and I'll write a
> graphical one!

See the perlpod docs which came with Perl. :-)  Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 6 Aug 1998 22:27:35 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: Premature end of script headers & Exec format error
Message-Id: <6qdo2j$ea9$1@fir.prod.itd.earthlink.net>

um, first thing is to save yourself a lot of trouble by using print qq, ie.

print qq|
<html>
<body bgcolor="white">
    |;

otherwise, the way you have it now, you would have to escape every double
quote you use in the HTML since you're using double quotes to contain your
print expressions. print qq|| nicely interpolates like double quotes. i'd
have to see more of the code to figure out all the other error messages
except the premature end of script stuff.

cheers,
ha quach
mailto:info@r-go.com


>sub html_header {
>   $document_title = $_[0];
>   print "Content-type: text/html\n\n";
>   print "<HTML>\n";
>   print "<HEAD>\n";
>   print "<TITLE>$document_title</TITLE>\n";
>   print "</HEAD>\n";
>   print "<BODY>\n";
>   print "<HR>\n";
>   print "<IMG ALIGN=middle SRC="thankyou.gif">\n";
>   print "<HR>\n";
>   print "<H1>$document_title</H1>\n";
>   print "<P>\n";
>}
>
> I have tried every combination of  ",' and no " or ', but they seem to
>still give the same
>error. I set the permissions to 777 on the gif file and if I change the
>location, it gives me
>a "can't find" error, so I think I have the directory/location okay.
>
>The errors in the error log are:
>
>Can't call method "mailto" in empty package "fairbrothers@smart.net"
>at /home/fairbrothers/www/cgi-bin/verify.pl line 52.
>
>exec of /home/fairbrothers/www/cgi-bin/thankyou.gif failed,
>reason: Exec format error (errno = 8)
>
>[Wed Aug  5 22:57:37 1998] access to
>/home/fairbrothers/www/cgi-bin/thankyou.gif failed
>for fairbrothers.smart.net, reason: Premature end of script headers
>
>
>




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

Date: Fri, 07 Aug 1998 10:45:58 -0400
From: Jim Fairbrother <fairbrothers@smart.net>
Subject: Re: Premature end of script headers & Exec format error
Message-Id: <35CB1325.ACA0DD15@smart.net>

Okay, I found what the error was. I want to thank everyone who helped me.
The error was that the GIF file shouldn't have been in the cgi-bin
directory.
For some reason, you aren't supposed to put anything in the cgi-bin
directory
except for Perl programs, etc. I changed this line:

print "<IMG ALIGN=middle SRC="thankyou.gif">\n";

to

print "<IMG ALIGN=middle SRC=\"/thankyou.gif\">\n";

and moved the GIF file up a  level in the directory tree,
and it is fetched and displayed properly now. And I
also changed the inner "s to \", thanks to a suggestion.

Thanks again to everyone.

Jim Fairbrother

Jim Fairbrother wrote:

> Can anyone help me - I am getting errors on this code trying to put a
> picture
> in the HTML output from a Perl program on a Linux machine:
>
> # Notify FairBrothers
> $fairmail = 'fairbrothers@smart.net';
> mailto $fairmail -s 'You have a new Order $TotalCost';
>
> sub html_header {
>    $document_title = $_[0];
>    print "Content-type: text/html\n\n";
>    print "<HTML>\n";
>    print "<HEAD>\n";
>    print "<TITLE>$document_title</TITLE>\n";
>    print "</HEAD>\n";
>    print "<BODY>\n";
>    print "<HR>\n";
>    print "<IMG ALIGN=middle SRC="thankyou.gif">\n";
>    print "<HR>\n";
>    print "<H1>$document_title</H1>\n";
>    print "<P>\n";
> }
>
>  I have tried every combination of  ",' and no " or ', but they seem to
> still give the same
> error. I set the permissions to 777 on the gif file and if I change the
> location, it gives me
> a "can't find" error, so I think I have the directory/location okay.
>
> The errors in the error log are:
>
> Can't call method "mailto" in empty package "fairbrothers@smart.net"
> at /home/fairbrothers/www/cgi-bin/verify.pl line 52.
>
> exec of /home/fairbrothers/www/cgi-bin/thankyou.gif failed,
> reason: Exec format error (errno = 8)
>
> [Wed Aug  5 22:57:37 1998] access to
> /home/fairbrothers/www/cgi-bin/thankyou.gif failed
> for fairbrothers.smart.net, reason: Premature end of script headers





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

Date: Fri, 07 Aug 1998 05:31:39 GMT
From: b_pillai@hotmail.com
Subject: Regarding autosplit.ix
Message-Id: <6qe3fr$tsg$1@nnrp1.dejanews.com>

 Hi,

 Where can find autosplit.ix? I have searched my perl directory
 but i could find only 2.
  i.e one in ..\perl\lib\auto\Test\ParseWords
  and other in ..\perl\lib\auto\Dynaloader

 But i am looking for the one in
    ..\perl\auto\POSIX\autosplit.ix

 I am porting some perl scripts written in Unix to NT. I have
 5.004_02 version of perl. The script is giving the error of not
 able to find the above file.

 Can somebody please help me out for the same.

 Thanks in advance

 Bilio
 (b_pillai@hotmail.com)

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 6 Aug 1998 23:35:36 -0400
From: "Cross" <mcross@mics.net>
Subject: Server or Programmer problems?
Message-Id: <902461215.192207@brain.mics.net>

I am having problems getting my perl scripts to work. They are very short
test programs and I have tested them with Active Perl for Win 32 on my
machine at home but they never work on the server. I have tried everything I
know (which isn't much). Here's an example of one of my test scripts:
-------------
#! /usr/local/bin/perl -w

use strict;
use CGI qw(:standard);

print header();
print start_html(-title=>'Printer Calculation
Results',-BGCOLOR=>'#ffff00'),"\n";
print end_html(),"\n";
-------------
I have been able to alter scripts that are on the server and make the work.
If the problem is with the Programmer (me) please help me.


M. Chris Cross




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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3385
**************************************

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