From f8030e8ff0138c165e9edba544fb57317ffccbf8 Mon Sep 17 00:00:00 2001 From: David Marec Date: Mon, 8 May 2023 13:20:07 +0200 Subject: [PATCH] use builtin say --- vmstat.pl | 7 ++++--- vmstatm.pl | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vmstat.pl b/vmstat.pl index 37ca6bf..9a4c21e 100755 --- a/vmstat.pl +++ b/vmstat.pl @@ -5,6 +5,7 @@ use warnings; use strict; +use feature 'say'; use XML::LibXML; my ($offset) = @ARGV; @@ -21,8 +22,8 @@ my %dict; while (1) { - print scalar localtime() . "\n"; - print "------------------------\n"; + say scalar localtime(); + say "------------------------"; system("/usr/bin/vmstat -z --libxo xml >$filename"); my $doc = XML::LibXML->load_xml(location => $filename); my $c = 0; @@ -54,7 +55,7 @@ format DIFF_V0V1 = } } - print "\n"; + say ''; sleep(5); } diff --git a/vmstatm.pl b/vmstatm.pl index 6fb34e9..1a4ea9c 100755 --- a/vmstatm.pl +++ b/vmstatm.pl @@ -4,6 +4,7 @@ # use warnings; use strict; +use feature 'say'; use XML::LibXML; @@ -17,7 +18,8 @@ if (not defined $offset) { } while (1) { - print scalar localtime() . "\n"; + say scalar localtime(); + say "------------------------"; system("/usr/bin/vmstat -m --libxo xml >$filename"); my $doc = XML::LibXML->load_xml(location => $filename); foreach my $id ( $doc->findnodes('//memory')) { @@ -39,8 +41,8 @@ format DIFF_V0V1 = $dict{$name}=$used; } } - print "------------------------\n" ; + say ''; sleep(5); } -- 2.47.0