in reply to Reading multiple files at the same time

You could try using a data structure like the following:
%monitored_files = ( "messages" => { FILE => "/var/log/messages", HANDLE => undef, } );
Then use it like:
foreach $key (keys (%monitored_files)) { open ($monitored_files{$key}{HANDLE}, $monitored_files{$key}{FILE} +) or die "Could not open $key: $!"; print(" * $key opened\n"); }

Replies are listed 'Best First'.
Re: Re: Reading multiple files at the same time
by waswas-fng (Curate) on Dec 08, 2003 at 22:38 UTC
    Also if you are going to allow any number of files to be opened this way it may be worthwhile setting a limit that is below the normal proccess/user max file descriptor number for your system.


    -Waswas