Perl Script Problem
Anton Hofmann
doomrunner.lists at gmail.com
Thu Nov 15 12:13:07 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Felipe Figueiredo schrieb:
> A Thursday 15 November 2007 08:47:28, Anton Hofmann escreveu:
>
> Try using parenthesis in each test
> ( ($error >= "0") and ($error <= "999") )
>
> also, why are you using string comparison operators (gt, le, eq...) for
> integers? using <=, == and >= is more indicated (and prevents warnings when
> you use -w, warnings and strict).
Hi Felipe,
my way was a litle bit stupid, as you say i used string comparison for
integer values, i changed it to:
if ($error == 0) {
system ("/vmbackup/send.sh -u Backup complete.");
}
if ($error > 0 and $error >= 999) {
system ("/vmbackup/send.sh -u Backup error");
}
if ($error > 1000) {
system ("/vmbackup/send.sh -u Backup error, snapshot available");
now it works perfect.
thank you.
Anton
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
iD8DBQFHPDfTUhOOK1n0VVkRAqNSAKCAfFuGIXE0ZH95EqmHAJQ3nbh7KACfZLPA
YLWFMt2SmnCGmPRDlg2QVIE=
=Xakc
-----END PGP SIGNATURE-----
More information about the ubuntu-users
mailing list