in reply to Re^2: To create a custom log
in thread To create a custom log
No, don't use the echo command from the shell. It's nearly always a bad idea. Just go ahead and do it with a logger package or with print statements.
Anyway, I'd suggest that you go ahead and write your script to just print your logging information to the standard output. Then you can redirect the output to a file after you have it debugged. You can redirect it either by:
#!/usr/bin/perl use strict; use warnings; print "before IO redirection\n"; close STDOUT; open STDOUT, ">", "/log/foo" or die $!; print "after IO redirection\n";
perl the_script.pl >/log/foo
...roboticus
|
|---|