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

How do i get EOF to work?

by dswimboy (Initiate)
on Mar 28, 2002 at 16:15 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-28 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found