in reply to Re^3: printing to filehandles
in thread printing to filehandles

Also, I'm getting:
syntax error at forex.pl line 37, near ")}" Unmatched right curly bracket at forex.pl line 62, at end of line syntax error at forex.pl line 62, near "}" Execution of forex.pl aborted due to compilation errors.
with your code.