in reply to Could you suggest improvements to my Cisco network device audit script?
I notice a good few variations of:
if (condition) { print "Some string\n"; print LOG "Some string\n"; return; }
It's frequent enough that I'd do something about it to simplify things a bit. I think I'd first create a subroutine like:
sub LOGIT { my @args = @_; print @args, "\n"; print LOG @args, "\n"; }
Then I'd probably use it like so:
condition or return LOGIT("some string");
Some variation of that might help you make the code a little easier on the eyes.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|