I have many subroutines in my perl script. I want to create log for each subroutine i.e. log will write whether subroutine worked fine or if failed then where it is failed. As per my logic flag should be maintained & if based on flag value subroutine log is created. I am new to perl so can anyone give me an example for the same.