From d92c85733e23a8974a473d4c99e664d072fbf4fd Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 15 Aug 2012 17:28:52 -0300 Subject: [PATCH] CleanupTasks: Older Perl compat --- bin/pt-online-schema-change | 4 ++-- lib/CleanupTask.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 2747aff1..c03b7ce0 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -5650,9 +5650,9 @@ sub DESTROY { my $task = $self->{task}; if ( ref $task ) { PTDEBUG && _d('Calling cleanup task', $task); - open local *STDOUT, ">&=", $self->{stdout_copy} + open local(*STDOUT), ">&=", $self->{stdout_copy} if $self->{stdout_copy}; - open local *STDERR, ">&=", $self->{stderr_copy} + open local(*STDERR), ">&=", $self->{stderr_copy} if $self->{stderr_copy}; $task->(); } diff --git a/lib/CleanupTask.pm b/lib/CleanupTask.pm index f6ab0489..5401360b 100644 --- a/lib/CleanupTask.pm +++ b/lib/CleanupTask.pm @@ -57,9 +57,9 @@ sub DESTROY { PTDEBUG && _d('Calling cleanup task', $task); # Temporarily restore STDOUT and STDERR to what they were # when the object was created - open local *STDOUT, ">&=", $self->{stdout_copy} + open local(*STDOUT), ">&=", $self->{stdout_copy} if $self->{stdout_copy}; - open local *STDERR, ">&=", $self->{stderr_copy} + open local(*STDERR), ">&=", $self->{stderr_copy} if $self->{stderr_copy}; $task->(); }