in reply to FOREACH Variables
Although not related to your question, you are over-using printf, which is (allegedly) slower than print. Perl, and several other languages, has interpolation - when a scalar or array variable is enclosed inside double-quotes it translates to its value. This is one of the advantages of the $ and @ prefixes. So:use strict; use warnings;
is better written as:printf("%s : %s\n", $alarmd, $alarms );
and error messages should really be routed to stderr:print "$alarmd : $alarms\n";
print STDERR "ERROR: $error.\n";
|
|---|