Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Converting code to use DATA filehandle instead of external templates

by haoess (Curate)
on Nov 20, 2007 at 08:39 UTC ( #651882=note: print w/replies, xml ) Need Help??


in reply to Re: Converting code to use DATA filehandle instead of external templates
in thread resolved: Converting code to use DATA filehandle instead of external templates

First of all, the DATA filehandle begins after the __DATA__ token, not __END__
That's not always correct. perldoc perldata says:
__END__ behaves like __DATA__ in the toplevel script (but not in files loaded with "require" or "do") and leaves the remaining contents of the file accessible via "main::DATA".
$ cat data_eq_end.pl #!/usr/bin/perl use warnings; use strict; print for <DATA>; __END__ 1 2 3 $ perl data_eq_end.pl 1 2 3

-- Frank

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://651882]
help
Chatterbox?
[Discipulus]: for sure they had to be in armaic, many reverse-eng errors where spot
[Discipulus]: do you know the google like translation: a rich.. as a camel through the needle hole?
[choroba]: yes, I've read about it and its probable original form
[Discipulus]: Tomas in greek ~140Ad

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2017-11-23 20:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (338 votes). Check out past polls.

    Notices?