Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

How do i get EOF to work?

by dswimboy (Initiate)
on Mar 28, 2002 at 16:15 UTC ( #155019=perlquestion: print w/replies, xml ) Need Help??

dswimboy has asked for the wisdom of the Perl Monks concerning the following question:

i have the following script:
#!/usr/local/bin/perl # print <<END; Content-Type: text/html\n\n <html> <body bgcolor="#000000" text="#ffffff"> <h2>Results</h2> END
and i come up with the follwoing error:
Can't find string terminator "END" anywhere before EOF at ./eof.p +l line 4.
can someone please tell me what is up? i have tried to replace END with EOF as well, same error

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How do i get EOF to work?
by particle (Vicar) on Mar 28, 2002 at 16:27 UTC
Re: How do i get EOF to work?
by vxp (Pilgrim) on Aug 16, 2002 at 16:19 UTC
    #!/usr/bin/perl use strict; my $file = "/etc/passwd"; open(PASSWD, $file) or die "Couldn't open $file: $!\n"; unless(eof(PASSWD)) { print $_; }
    Hope this helps.
      I'm sure it's just a minor overlook, but the above code
      gives me an error: "Uninitialized value in print....". 
      #!/usr/bin/perl use warnings; use strict; my $file = "/etc/passwd"; open(PASSWD,"<$file") or die "Couldn't open $file: $!\n"; while (<PASSWD>){ print $_ unless eof PASSWD; }

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://155019]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-06-28 00:54 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (89 votes). Check out past polls.