Does this look ok? - a simple scirpt I did

They have: 850 posts

Joined: Jul 1999

$addin="the-file-here-.txt";
open(addin,"$addin") ¦¦ print "An Error Occurred";
print "Content-type: text/html\n\n";
while ($line=<addin>)
{
print $line;
}

close(addin);

It is a simple footer executed by
<!--#exec cgi="addin.cgi"-->

I tried it on hypermart before and couldn't get it to work? does it look ok?

----------
[Rob P]
[Email:[email protected]]-[ICQ:16560402]-[Voice Mail:1-877-309-2286]

They have: 5,633 posts

Joined: Jan 1970

also change:

while ($line=<addin>)

to:

while (<addin>)

and use $_ instead of $line.

Assigning a variable to a FILEHANDLE will return only the first line of the file.

They have: 5,633 posts

Joined: Jan 1970

The script seems to be pretty useless. Why dont you just include the textfile in the first place?

Later,

Malte

----------
Malte Ubl - [red]Germany[/red] - http://goKewl.com/
[red]The beats of 1000 hearts inside...[/red] the merciless pulsation... [red]and all I know is I'll be back...[/red] back to trance nation!

They have: 453 posts

Joined: Jan 1999

Hi,

almost all said.

But where is the
use strict;
??

After all it runs on the webserver !!

That will show some additional "flaws" ...

ciao
Anti

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.