You can always just do a

foreach(@files){
  open(INFILE,$_) || die "Could not open file $_!  $!";
  

and then do the rest, or you can use the while(<>) magic.

-----Original Message-----
From: $Bill Luebkert [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 2:00 PM
To: Mike Singleton
Cc: [EMAIL PROTECTED]
Subject: Re: progress!


Mike Singleton wrote:
> Using the following code, how would I write it's output to a single csv
file??
> 
> === Start===
> use strict;
> my @files = glob('3*.log');

open OUT, ">outfile" or die $!;

> while (<@files>) {

Not sure if the above works.  You can use a file glob inside <>, but
not sure about an array.

>       my @f = split /\s+/, $_, 9;
>       print join ',', @f;

        print OUT join ',', @f;

> }

close OUT;

> __END__
> 
> ==== End Code ====

Just open an output file and put the filehandle between the print and join.


-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic
http://www.todbe.com/

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to