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->(); }