################################################## #This is my first craft post and a very simple # #one - so be nice, please - but it can help when # #you start to bang your head to the wall because # #your script is not working... # # # #It's a simple sub to print out var's values. # # # #Include it on your script and call it like this # #Debug_aid(var,output_type) # # # # output_type: # # w - creates a new file from scratch # # a - append to the file, if it already exists # ################################################## sub Debug_aid { @t=(localtime)[0..5]; $dt=sprintf "%02u/%02u/%02u %02u:%02u:%02u",$t[3], $t[4]+1,$t[5]+1900,$t[2],$t[1],$t[0]; $out = $_[0]; $type = $_[1]; if ($type eq "w") { open (DEB, ">debug.log"); } elsif ($type eq "a") { open (DEB, ">>debug.log"); } print DEB "[$dt] -> $out\n\n"; close (DEB); }