#!/usr/bin/perl use strict; use warnings; no warnings qw /syntax/; my $program = 'open STDERRIN, "<&STDERR" or die $!; my $line = <STDERRIN>; print "YAY!!! $line";'; foreach my $version (qw /5.005 5.6.0 5.6.1 5.8.0 5.8.1/) { print "Version $version\n"; system "/opt/perl/$version/bin/perl -we '$program'"; } __END__ Version 5.005 foo YAY!!! foo Version 5.6.0 bar YAY!!! bar Version 5.6.1 Filehandle STDERRIN opened only for output at -e line 2. baz YAY!!! baz Version 5.8.0 Filehandle STDERRIN opened only for output at -e line 2. Use of uninitialized value in concatenation (.) or string at -e line 2 +. YAY!!! Version 5.8.1 Filehandle STDERRIN opened only for output at -e line 2. Use of uninitialized value in concatenation (.) or string at -e line 2 +. YAY!!!
It runs on 5.005, 5.6.0 and 5.6.1, although it gives a warning under 5.6.1. It won't read from STDERRIN in 5.8.0 or 5.8.1.
Abigail
In reply to Re: STDIN schizofrenia
by Abigail-II
in thread STDIN schizofrenia
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |