On Thu, 17 Apr 2008 12:00:12 -0700, you wrote:

>I have a basic project in which I need to break a larger file down into
>35 separate files.  I was under the impression that use FileHandle would
>store the object in $fh.  I could then create a a copy of my file, save
>the associated object in a hash array and print some header information
>for the files all in a simple loop.  So, joyfully, I wrote the
>following:
>
>use FileHandle;
> 
>foreach my $key (0 .. 34) {
> 
> $fh = new FileHandle "> VTOL$key";
> $flist{$key} = $fh;
> print $flist{$key} "Header info\n";

Since FileHandle gives you object-oriented access to the filehandle, you
can use

$flist{$key}->print("Header info\n");

as well as the

print {$flist{$key}} "Header info\n";

already suggested.
-- 
Eric Amick
Columbia, MD
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to