Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Standard way for displaying a script's output.

by JavaFan (Canon)
on Feb 10, 2012 at 21:05 UTC ( [id://953131]=note: print w/replies, xml ) Need Help??


in reply to Standard way for displaying a script's output.

I just separate code from output with a __END__ token. I don't see much added value in using different colours or fonts. We aren't writing vegetables in green, verbs in boldface either, do we?

Replies are listed 'Best First'.
Re^2: Standard way for displaying a script's output.
by tobyink (Canon) on Feb 10, 2012 at 22:46 UTC

    A problem with that is that __DATA__ sections are often used to supply sample input for the script, and those can't really be combined in the same file.

Re^2: Standard way for displaying a script's output.
by Xiong (Hermit) on Feb 10, 2012 at 23:05 UTC

    Except that it's legitimate to store data after any __DATA__; even after __END__ in main.

    use strict; use warnings; use SelfLoader; sub daily { sleep int rand }; # work work work print plimsoll() if shift; daily; __END__ sub plimsoll { "http://en.wikipedia.org/wiki/Samuel_Plimsoll\n" };
    I'm not the guy you kill, I'm the guy you buy. —Michael Clayton
      Except that it's legitimate to store data after any __DATA__; even after __END__ in main.
      So what? Don't forget the audience isn't brainless computers, but humans. I believe that most readers of Perlmonks are smarter than the average houseplant, and don't have trouble spotting the difference between a program that tries to be Miss Smartypants by reading data after an __END__ token, and a program that has its output after an __END__.
        Yes, but the point might have been you cannot mix both input and output in this way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2026-02-13 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.