Codebase list libcapture-tiny-perl / 213f10e
improve docs about limitations David Golden 12 years ago
1 changed file(s) with 13 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
455455 return scalar @list; # $count will be 3
456456 };
457457
458 Captures are normally done internally to an anonymous filehandle. To
458 Captures are normally done to an anonymous temporary filehandle. To
459459 capture via a named file (e.g. to externally monitor a long-running capture),
460460 provide custom filehandles as a trailing list of option pairs:
461461
543543 == PerlIO layers
544544
545545 Capture::Tiny does it's best to preserve PerlIO layers such as ':utf8' or
546 ':crlf' when capturing. Layers should be applied to STDOUT or STDERR ~before~
547 the call to {capture} or {tee}. This may not work for tied filehandles (see below).
546 ':crlf' when capturing (only for Perl 5.8.1+) . Layers should be applied to
547 STDOUT or STDERR ~before~ the call to {capture} or {tee}. This may not work
548 for tied filehandles (see below).
548549
549550 == Modifying filehandles before capturing
550551
602603
603604 *Tied input filehandle*
604605
605 Capture::Tiny attempts to preserve the semantics of tied STDIN, but this is not
606 entirely stable or portable. For example:
607
608 * Trying does not affect how external processes read data
609 * Capturing or teeing with STDIN tied has been reported broken on Windows
606 Capture::Tiny attempts to preserve the semantics of tied STDIN, but this
607 requires Perl 5.8 and is not entirely predictable. External processes
608 will not be able to read from such a handle.
610609
611610 Unless having STDIN tied is crucial, it may be safest to localize STDIN when
612611 capturing:
620619
621620 == No support for Perl 5.8.0
622621
623 It's just too buggy when it comes to layers and UTF-8.
622 It's just too buggy when it comes to layers and UTF-8. Perl 5.8.1 or later
623 is recommended.
624
625 == Limited support for Perl 5.6
626
627 Perl 5.6 predates PerlIO. UTF-8 data may not be captured correctly.
624628
625629 = ENVIRONMENT
626630