Vyacheslav Nadvorny wrote:
> I tried to run perlopentut example for STDOUT processing
> but got just this:
>
> =========Beginning of the citation==============
> '-' is not recognized as an internal or external command,
> operable program or batch file.
>
> =========The end of the citation================
>
> I use windows xp, activestate perl build 804.
>
> Can anyone explain why I'm getting this error?
>
> I know that windows version of perl supports forking,
> but does that error mean it does not support forking
> with open?
>
> How can I alternatively intersept STDOUT?
>
>
> =========Beginning of the citation==============
> #! c:/perl/bin/perl.exe -w
>
> head(100);
>
> while (<>) {
> print;
> }
>
> sub head {
> my $lines = shift || 20;
> return unless $pid = open(STDOUT, "|-");
> die "cannot fork: $!" unless defined $pid;
> while (<STDIN>) {
> print;
> last if --$lines < 0;
> }
> exit;
> }
> =========The end of the citation================
>
this's a known issue on the windos platform. solution is at:
http://www.perldoc.com/perl5.8.0/pod/perlfork.html
and then goes down to the section:
Forking pipe open() not yet implemented
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]