#!/perl/bin/perl # # test.pl -- IO:: test code... use strict; use warnings; use diagnostics; use IO::ScalarArray; use IO::File; use IO::Scalar; my @list = qw(one.tmp two.tmp three.tmp); my @handles; foreach (@list) { push @handles,new IO::File ">$_"; } for (my $i = 0;$i < $#handles ;$i++) { print $handles[$i] ,"Hi how the hell are ya!"; close $handles[$i]; } #### String found where operator expected at test.pl line 31, near "] "Hi how the hell are ya!"" (#1) (S) The Perl lexer knows whether to expect a term or an operator. If it sees what it knows to be a term when it was expecting to see an operator, it gives you this warning. Usually it indicates that an operator or delimiter was omitted, such as a semicolon. (Missing operator before "Hi how the hell are ya!"?) syntax error at test.pl line 31, near "] "Hi how the hell are ya!"" Execution of test.pl aborted due to compilation errors (#2) Uncaught exception from user code: syntax error at test.pl line 31, near "] "Hi how the hell are ya!"" Execution of test.pl aborted due to compilation errors. C:\Perl\Perl_Dev\regex>perl test.pl Undefined subroutine &main::mprint called at test.pl line 31 (#1) (F) The subroutine indicated hasn't been defined, or if it was, it has since been undefined. Uncaught exception from user code: Undefined subroutine &main::mprint called at test.pl line 31. #### open ONE, ">one.tmp"; push @handles, *ONE; open TWO, ">two.tmp"; push @handles, *TWO; open THREE, ">three.tmp"; push @handles, *THREE;