From b346324cf273f8e41872f055e1382133627f7059 Mon Sep 17 00:00:00 2001 From: bustico Date: Wed, 13 Feb 2008 13:45:36 +0000 Subject: verify validity of data structure before using it --- example/ivyprobe.pl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'example') diff --git a/example/ivyprobe.pl b/example/ivyprobe.pl index 41efe78..ba095df 100755 --- a/example/ivyprobe.pl +++ b/example/ivyprobe.pl @@ -34,6 +34,8 @@ my $timestamp = 0; my $noReadLineMode ; my $regexpFile; my $classes; +my $messCount=0; + my @classes = (); # for each application gives the number of running instances @@ -125,6 +127,12 @@ $Ivyobj->fileEvent(*STDIN, \&cb); $Ivyobj->mainLoop(); +sub printtime_mess { + return if (!$timestamp); + my ($sec,$min,$hour) = localtime(); + printf "[%02d:%02d:%02d>>%d] ", $hour, $min, $sec, $messCount++; +} + sub printtime { return if (!$timestamp); my ($sec,$min,$hour) = localtime(); @@ -277,6 +285,7 @@ sub callback { my $paramString = ""; if (scalar @param) { $paramString = join ("' '", @param); } + printtime_mess(); print "$appname sent '", $paramString, "'\n"; } -- cgit v1.1