RFC 39 (v1) print operator
[email protected] (Perl6 RFC Librarian) 5 Aug 2000 20:25:06 -0000
| Newsgroups | perl.perl6.language.io |
|---|---|
| Message-ID | <[email protected]> |
This and other RFCs are available on the web at http://tmtowtdi.perl.org/rfc/ =head1 TITLE print operator =head1 VERSION Maintainer: Jon Ericson <[email protected]> Date: 5 August 2000 Version: 1 Mailing List: [email protected] Number: 39 =head1 ABSTRACT Perl supplies a operator for line input - angle brackets. This is no analogous operator for output. I propose "inverse angle brackets": >"Print this line.\n"<; =head1 DESCRIPTION =head2 Easy things should be easy Output is already easy in Perl, but it could be easier. =head2 Symmetry readline is to angle brackets as print is to inverse angle brackets. C++ uses >> for input and << for output. Perl uses <> for input and >< is for output. I sometimes see C<< print ">$x<\n"; >> used as a debugging tool. =head2 Perl Golf and JAPHs perl -e 'print "Just Another Perl5 Hacker"' perl -e '>"Just Another Perl6 Hacker"<' perl -e '><><' # cat(1) perl -e 'while(<>){>< if /^=head1/)' # Find the section titles in a pod file =head1 IMPLEMENTATION Let: >LIST< be equivalent to: print(LIST) Output always goes to stdout. (print is still there if you want it.) Note the ambiguous cat(1) example above. Are there other potential problems parsing this print operator? =head1 REFERENCES RFC 2 - Request For New Pragma: Implicit RFC 34 - Angle brackets should not be used for file globbing. perlfunc/print perlop/"I/O Operators"