8
8
9
9
This class has been available in Rakudo since version 2017.06.
10
10
11
- The C < IO::CatHandle > class provides a means to create an L < IO::Handle > that
12
- seamlessly gathers input from multiple L < IO::Handle > and L < IO::Pipe > sources.
11
+ The C < IO::CatHandle|/type/IO::CatHandle > class provides a means to create an L < IO::Handle|/type/ IO::Handle> that
12
+ seamlessly gathers input from multiple L < IO::Handle|/type/IO::Handle > and L < IO::Pipe|/type/ IO::Pipe> sources.
13
13
14
- All of the L < IO::Handle > 's methods are implemented, and while attempt to use
15
- write methods will (currently) throw and exception, an L < IO::CatHandle > is
16
- usable anywhere a read-only L < IO::Handle > can be used.
14
+ All of the L < IO::Handle|/type/IO::Handle > 's methods are implemented, and while attempt to use
15
+ write methods will (currently) throw and exception, an L < IO::CatHandle|/type/IO::CatHandle > is
16
+ usable anywhere a read-only L < IO::Handle|/type/IO::Handle > can be used.
17
17
18
18
= head1 Methods
19
19
@@ -25,32 +25,32 @@ Defined as:
25
25
method new(*@handles, :&on-switch, :$chomp = True,
26
26
:$nl-in = ["\n", "\r\n"], Str :$encoding, Bool :$bin)
27
27
28
- Creates a new L < IO::CatHandle > object.
28
+ Creates a new L < IO::CatHandle|/type/IO::CatHandle > object.
29
29
30
30
The C < @handles > positional argument indicates a source of handles for the
31
31
C < IO::CatHandle > to read from and can deal with a mixed collection of
32
- L < Cool|/type/Cool > , L < IO::Path > , and L < IO::Handle > (including L < IO::Pipe > )
33
- objects. As input from L < IO::CatHandle > is processed (so operations won't happen
32
+ L < Cool|/type/Cool > , L < IO::Path|/type/IO::Path > , and L < IO::Handle|/type/IO::Handle > (including L < IO::Pipe|/type/ IO::Pipe> )
33
+ objects. As input from L < IO::CatHandle|/type/IO::CatHandle > is processed (so operations won't happen
34
34
during C < .new > call, but only when C < @handles > ' data is needed), it will walk
35
35
through the C < @handles > list, processing each argument as follows:
36
36
37
37
= item the
38
- L < Cool|/type/Cool > objects will be coerced to L < IO::Path > ;
38
+ L < Cool|/type/Cool > objects will be coerced to L < IO::Path|/type/IO::Path > ;
39
39
40
- = item L < IO::Path > objects
41
- will be opened for reading using the L < IO::CatHandle > 's (invocant's) attributes
40
+ = item L < IO::Path|/type/IO::Path > objects
41
+ will be opened for reading using the L < IO::CatHandle|/type/IO::CatHandle > 's (invocant's) attributes
42
42
for L « C < open > |/routine/open» calls;
43
43
44
- = item un-opened L < IO::Handle > objects will be
45
- opened in the same fashion as L < IO::Path > objects;
44
+ = item un-opened L < IO::Handle|/type/IO::Handle > objects will be
45
+ opened in the same fashion as L < IO::Path|/type/IO::Path > objects;
46
46
47
47
= item and already opened
48
- L < IO::Handle > objects will have all of their attributes set to the attributes of
49
- the invocant L < IO::CatHandle > .
48
+ L < IO::Handle|/type/IO::Handle > objects will have all of their attributes set to the attributes of
49
+ the invocant L < IO::CatHandle|/type/IO::CatHandle > .
50
50
51
51
In short, all the C < @handles > end up as
52
- L < IO::Handle > objects opened in the same mode and with the same attributes as
53
- the invocant L < IO::CatHandle > .
52
+ L < IO::Handle|/type/IO::Handle > objects opened in the same mode and with the same attributes as
53
+ the invocant L < IO::CatHandle|/type/IO::CatHandle > .
54
54
55
55
See L « C < .on-switch > method|/type/IO::CatHandle#method_on-switch» for details
56
56
on the C < :&on-switch > named argument, which by default is not set.
@@ -122,7 +122,7 @@ Defined as:
122
122
123
123
Closes the currently active source handle, as well as any already-open source
124
124
handles, and empties the source handle queue. Unlike a regular
125
- L < IO::Handle > , an explicit call to C < .close > is often not necessary on a
125
+ L < IO::Handle|/type/IO::Handle > , an explicit call to C < .close > is often not necessary on a
126
126
CatHandle, as merely exhausting all the input closes all the handles that
127
127
need to be closed.
128
128
@@ -265,10 +265,10 @@ Defines as:
265
265
method handles(IO::CatHandle:D: --> Seq:D)
266
266
267
267
Returns a L < Seq|/type/Seq > containing the currently-active handle, as well as all the
268
- remaining source handles produced by calling L < next-handle > . If the invocant
268
+ remaining source handles produced by calling L < next-handle|/routine/next-handle > . If the invocant
269
269
has already been fully-consumed, returns an empty L < Seq|/type/Seq > .
270
270
271
- This method is especially handy when working with L < IO::ArgFiles > , where you
271
+ This method is especially handy when working with L < IO::ArgFiles|/type/IO::ArgFiles > , where you
272
272
want to treat each filehandle separately:
273
273
274
274
# print at most the first 2 lines of each file in $*ARGFILES:
@@ -350,7 +350,7 @@ been exhausted|/type/IO::CatHandle#method_next-handle>.
350
350
Since the C < CatHandle > closes a source handle, once it's done with it, it's
351
351
possible for successive source handles to have the same native descriptor, if
352
352
they were passed to L < .new|/type/IO::CatHandle#method_new > as L < Cool|/type/Cool >
353
- or L < IO::Path > objects.
353
+ or L < IO::Path|/type/IO::Path > objects.
354
354
355
355
= begin code
356
356
(my $f1 = 'foo'.IO).spurt: 'foo';
@@ -372,12 +372,12 @@ queue, which is the sources given in C<@handles> attribute to
372
372
L « C < .new > |/type/IO::CatHandle#method_new» . The return value is the currently
373
373
active source handle or C < Nil > if the source handle queue has been exhausted.
374
374
375
- Coerces L < Cool|/type/Cool > source "handles" to L < IO::Path > ; opens L < IO::Path > and unopened
376
- L < IO::Handle > source handles for reading using the invocant's
375
+ Coerces L < Cool|/type/Cool > source "handles" to L < IO::Path|/type/IO::Path > ; opens L < IO::Path|/type/ IO::Path> and unopened
376
+ L < IO::Handle|/type/IO::Handle > source handles for reading using the invocant's
377
377
L « C < $.nl-in > |/type/IO::CatHandle#method_nl-in» ,
378
378
L « C < $.chomp > |/type/IO::CatHandle#method_chomp» , and
379
379
L « C < $.encoding > |/type/IO::CatHandle#method_encoding» attributes;
380
- those same attributes of already-opened L < IO::Handle > objects will be changed to
380
+ those same attributes of already-opened L < IO::Handle|/type/IO::Handle > objects will be changed to
381
381
the values of the invocant's attributes.
382
382
383
383
This method is called automatically whenever CatHandle's methods require
@@ -475,7 +475,7 @@ Defined as:
475
475
method open(IO::CatHandle:D: --> IO::CatHandle:D)
476
476
477
477
Returns the invocant. The intent of this method is to merely make CatHandle
478
- workable with things that open L < IO::Handle > . You never have to call this method
478
+ workable with things that open L < IO::Handle|/type/IO::Handle > . You never have to call this method
479
479
intentionally.
480
480
481
481
= head2 method opened
@@ -758,7 +758,7 @@ to be closed.
758
758
759
759
= head1 NYI Methods
760
760
761
- The L < IO::CatHandle > type overrides these methods to throw a C < X::NYI >
761
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides these methods to throw a C < X::NYI >
762
762
exception.
763
763
764
764
= head2 method flush
@@ -767,7 +767,7 @@ Defined as:
767
767
768
768
multi method flush(|)
769
769
770
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
770
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
771
771
exception. If you have a good idea for how this method should behave,
772
772
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
773
773
@@ -777,7 +777,7 @@ Defined as:
777
777
778
778
multi method nl-out(|)
779
779
780
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
780
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
781
781
exception. If you have a good idea for how this method should behave,
782
782
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
783
783
@@ -787,7 +787,7 @@ Defined as:
787
787
788
788
multi method out-buffer(|)
789
789
790
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
790
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
791
791
exception. If you have a good idea for how this method should behave,
792
792
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
793
793
@@ -797,7 +797,7 @@ Defined as:
797
797
798
798
multi method print(|)
799
799
800
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
800
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
801
801
exception. If you have a good idea for how this method should behave,
802
802
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
803
803
@@ -807,7 +807,7 @@ Defined as:
807
807
808
808
multi method printf(|)
809
809
810
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
810
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
811
811
exception. If you have a good idea for how this method should behave,
812
812
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
813
813
@@ -817,7 +817,7 @@ Defined as:
817
817
818
818
multi method print-nl(|)
819
819
820
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
820
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
821
821
exception. If you have a good idea for how this method should behave,
822
822
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
823
823
@@ -827,7 +827,7 @@ Defined as:
827
827
828
828
multi method put(|)
829
829
830
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
830
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
831
831
exception. If you have a good idea for how this method should behave,
832
832
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
833
833
@@ -837,7 +837,7 @@ Defined as:
837
837
838
838
multi method say(|)
839
839
840
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
840
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
841
841
exception. If you have a good idea for how this method should behave,
842
842
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
843
843
@@ -847,7 +847,7 @@ Defined as:
847
847
848
848
multi method write(|)
849
849
850
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
850
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
851
851
exception. If you have a good idea for how this method should behave,
852
852
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
853
853
@@ -857,7 +857,7 @@ Defined as:
857
857
858
858
multi method WRITE(|)
859
859
860
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
860
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
861
861
exception. If you have a good idea for how this method should behave,
862
862
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
863
863
@@ -867,7 +867,7 @@ Defined as:
867
867
868
868
multi method EOF(|)
869
869
870
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
870
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
871
871
exception. If you have a good idea for how this method should behave,
872
872
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
873
873
@@ -877,7 +877,7 @@ Defined as:
877
877
878
878
multi method EOF(|)
879
879
880
- The L < IO::CatHandle > type overrides this method to throw a C < X::NYI >
880
+ The L < IO::CatHandle|/type/IO::CatHandle > type overrides this method to throw a C < X::NYI >
881
881
exception. If you have a good idea for how this method should behave,
882
882
L < tell Rakudo developers about it|https://webchat.freenode.net/?channels=#perl6-dev > !
883
883
0 commit comments