http://qs1969.pair.com?node_id=155019

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; }