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

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

Replies are listed 'Best First'.
Re^3: Standard way for displaying a script's output.
by JavaFan (Canon) on Feb 11, 2012 at 08:43 UTC
    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.

        Sure you can, that is why each code tags section gets its own download link

        my $data = <<'<<DATA'; Dont you put me after __DATA__ you human <<DATA open my($fh), '<', \$data; while(<$fh>){ print length, "\n"; } __END__
        42

        besides, when human copy/paste, human edit :)