What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use the subroutine when writing to the filehandle, it works fine. What am I doing wrong?
Thank you in advance for any help you can provide. Joshua Scott Security Architect, CISSP Jacobs Engineering EXAMPLE CODE ######################################### $logfile = "/var/log/logfile"; Open(FILE,">>$logfile"); While(1) { &event_log("Logging some data"); sleep 60; }; Sub event_log { print FILE "LOG MESSAGE: $_[0]\n"; }; ######################################### ============================================================================== NOTICE - This communication may contain confidential and privileged information that is for the sole use of the intended recipient. Any viewing, copying or distribution of, or reliance on this message by unintended recipients is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. ==============================================================================