From e9bb9ef34c9f91d891b50524cb9b26fe69854ca8 Mon Sep 17 00:00:00 2001 From: Duncan Ferguson Date: Sat, 20 Apr 2013 09:17:20 +0100 Subject: [PATCH] Fixed macros (%u,%s,%h,%n) multiple replacements --- Changes | 3 +++ lib/App/ClusterSSH.pm | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 9e18ba0..c0a823f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +????-??-?? Duncan Ferguson - v4.02_02 +- Fixed macros (%u, %s, %h, %n) not doing multiple replacements + 2013-04-16 Duncan Ferguson - v4.02_01 - Refactured file loading code - Add in 'tags' file handling diff --git a/lib/App/ClusterSSH.pm b/lib/App/ClusterSSH.pm index 5ce9401..e3c63db 100644 --- a/lib/App/ClusterSSH.pm +++ b/lib/App/ClusterSSH.pm @@ -3,7 +3,7 @@ package App::ClusterSSH; use 5.008.004; use warnings; use strict; -use version; our $VERSION = version->new('4.02_01'); +use version; our $VERSION = version->new('4.02_02'); use Carp; @@ -538,17 +538,17 @@ sub send_text($@) { { my $servername = $svr; $servername =~ s/\s+//; - $text =~ s/%s/$servername/xsm; + $text =~ s/%s/$servername/xsmg; } - $text =~ s/%h/hostname()/xsme; + $text =~ s/%h/hostname()/xsmeg; # use connection username, else default to current username { my $username = $servers{$svr}{username}; $username ||= getpwuid($UID); - $text =~ s/%u/$username/xsm; + $text =~ s/%u/$username/xsmg; } - $text =~ s/%n/\n/xsm; + $text =~ s/%n/\n/xsmg; foreach my $char ( split( //, $text ) ) { next if ( !defined($char) );