Skip to content

Commit 0dbd4b4

Browse files
committed
extend IO::print example
1 parent 488dd28 commit 0dbd4b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/Type/IO.pod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ languages) append a newline character to the text. Thus the following code
2222
2323
print "Hi there!";
2424
print "How are you?";
25+
print (0..101).list;
2526
2627
displays
2728
28-
Hi there!How are you?
29+
Hi there!How are you?0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
2930
3031
To print text implicitly including the trailing newline character, use
3132
L<say|/type/IO#sub_say>.
@@ -38,19 +39,20 @@ Print the given text on C<$*OUT> (standard output) with appended C<$*OUT.nl-out>
3839
3940
=head2 sub say
4041
41-
Print the given text, followed by a newline C<"\n"> on C<$*OUT> (standard
42-
output).
42+
Print the given text in human readable form, followed by a C<$*OUT.nl-out> (platform dependent newline) on C<$*OUT> (standard output). Long output may be truncted. For machine readable output use C<put>.
4343
4444
With C<say>, the example code as mentioned in the C<print> section will be
4545
displayed as the user likely intended:
4646
4747
say "Hi there!";
4848
say "How are you?";
49+
say (0..101).list;
4950
5051
displays
5152
5253
Hi there!
5354
How are you?
55+
(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...)
5456
5557
C<say> prints non-C<Str> objects by calling their C<.gist> method before
5658
printing. Hence the following C<say> statements for the respective

0 commit comments

Comments
 (0)