Mike Singleton wrote at Tue, 10 Sep 2002 17:16:18 +0200:

> What am I fumbling here??
> Errror: Bareword 'OUTFILE' not allowed while "strict subs" in use.
> == Start ==
> #! perl -w
> use strict;
> my @files = glob('3D21*.log');
> fopen(OUTFILE,">>myfile.csv");
  ^

I could imagine you mean 
open OUTFILE, ">>myfile.csv" or die "Can't open myfile.csv for appending: $!";

> while(<@files>){
>    my @f = split /s+/,$_,9;
>    print OUTFILE join(',',@f)."\n";
> }
> === End ==


I'm afraid your code won't still work.

while (<@array>) {

  ... 

}
 
loops through all elements of the array,
in your case through all file names, but not the file contents.

I believe, you meant:

local @ARGV = glob('3D21*.log');
open OUTFILE, ">>myfile.csv" or die "Can't open myfile.csv for appending: $!";
while (<>) {
    split /\s+/,$_,9;
    print OUTFILE join(",", @_), "\n";
}
close OUTFILE;


Best Wishes,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to