in reply to Odd Hashed Filehandle behavior
From the print documentation:printf {$uHHash{uHANDLE}} "Output is here (%s) !\n","HJGKJGJHJLHL";
Note that if you're storing FILEHANDLEs in an array, or if you're using any other expression more complex than a scalar variable to retrieve it, you will have to use a block returning the filehandle value instead:print { $files[$i] } "stuff\n"; print { $OK ? STDOUT : STDERR } "stuff\n";
Also, if reading from a filehandle stored in a hash you cannot use @x = <$hash{key}>;, you need to use @x = readline($hash{key});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Odd Hashed Filehandle behavior
by godfetish (Novice) on Feb 26, 2010 at 16:11 UTC |