in reply to Filehandle/array naming
try enclosing the filehandle in <>,
Edit: The above won't work because the inside to the diamond operator must be a simple scalar variable and ${fh.$FILE} is not (why?). See choroba's answer
while ( ${line.$FILE} = <${fh.$FILE}> ) {
I must note that yours is definetely uncommon coding style! I usually use arrays rather than creating unqiue variables, one for each array item, whose name contains the array index. If I deciphered your code correctly that is.
EDIT: I forgot the tail -f, perhaps you want to replace that with a Perl module: File::Tail
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Filehandle/array naming
by choroba (Cardinal) on Nov 20, 2020 at 11:38 UTC | |
by bliako (Abbot) on Nov 20, 2020 at 12:57 UTC | |
by choroba (Cardinal) on Nov 20, 2020 at 13:48 UTC | |
by bliako (Abbot) on Nov 20, 2020 at 16:55 UTC | |
by AnomalousMonk (Archbishop) on Nov 20, 2020 at 17:26 UTC | |
| |
by JSAWS (Novice) on Nov 20, 2020 at 11:58 UTC | |
|
Re^2: Filehandle/array naming
by JSAWS (Novice) on Nov 20, 2020 at 12:00 UTC |