It wasn't uploaded as a dos file, I've scrapped all references to the
offending piece of code now, but thanks for the suggestion

-----Original Message-----
From: Roger C Haslock [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 15:23
To: Sally; perlcgi
Subject: Re: mystery


Sally

Possibly you uploaded it as a DOS file. Delete what you have uploaded, and
upload it again, in binary. If that makes no difference, possibly you got it
as a DOS file, in which case it will have to be cleaned of <CR><LF> pairs.

Something else you might try is editing the first line from

#!/.../perl
to
#!/.../perl --

That is, put two minus signs on the end.

Regards
- Roger -


----- Original Message -----
From: "Sally" <[EMAIL PROTECTED]>
To: "perlcgi" <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 9:54 AM
Subject: FW: mystery


>
>
> -----Original Message-----
> From: Sally [mailto:[EMAIL PROTECTED]]
> Sent: 14 June 2001 09:54
> To: perl
> Subject: mystery
>
>
> I got the following code from a tutorial. When I uploaded (FTP) it as a
perl
> file I got more errors than you could shake a stick at. When I uploaded it
> as an html file it sort of worked, ie it printed out the "Hello world" but
> it printed out everything else too. I think I understand why it worked as
> html, but I don't understand why it didn't work as perl. Any suggestions
> would be appreciated, and if you were the one who wrote this code on the
> tutorial, please can you offer suggestions as to why code may fail.
>
> #!/usr/bin/perl -wT
>
> use strict;
>
> &error;
>
> #hellocgi
>
> print "Content-type: text/html\n\n";
>
> &error;
>
> <HTML>
>
> &error;
>
> <HEAD>
> <TITLE>Hello, world!</TITLE>
> </HEAD>
>
> &error;
>
> <BODY>
> <H1>Hello, world!</H1>
> </BODY>
>
> &error;
>
> </HTML>
>
>
> sub error {
>     my( $q, $error_message ) = @_;
>
>     print $q->header( "text/html" ),
>           $q->start_html( "Error" ),
>           $q->h1( "Error" ),
>           $q->p( "Sorry, the following error has occurred: " );
>           $q->p( $q->i( $error_message ) ),
>           $q->end_html;
>     exit;
> }
>
>
>
>

Reply via email to