From: David Marec Date: Mon, 8 May 2023 11:20:07 +0000 (+0200) Subject: use builtin say X-Git-Url: http://popeye.lapinbilly.eu/git/?a=commitdiff_plain;ds=sidebyside;h=refs%2Fheads%2Fmaster;hp=2ef0c434f70b42cfb04f0619f12384dc5ac68e43;p=vrac.git use builtin say --- 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); }