TT#29620 Clean TAP test warning: RequireInitializationForLocalVars = local variable not initialized

Change-Id: I413c8ab924bb996b5b1ab3031be7155bfb92ab1f
changes/71/21271/5
Alexander Lutay 7 years ago
parent ad059c32df
commit 8cba6b5d10

@ -40,7 +40,7 @@ sub root :Chained('/') :PathPart('grafana') :Args() {
my $req = HTTP::Request->new($c->req->method => $url);
$req->header('Content-Type' => $c->req->header('Content-Type'));
$req->header('X-WEBAUTH-USER' => $grafana_user);
my $body = $c->request->body ? (do { local $/; $c->request->body->getline }) : '';
my $body = $c->request->body ? (do { local $/ = undef; $c->request->body->getline }) : '';
$req->content($body);
my $res = $ua->request($req);
$c->res->content_type($res->header('Content-Type') // 'text/plain');

@ -856,7 +856,7 @@ sub apply_patch {
sub set_body {
my ($self, $c) = @_;
$c->stash->{body} = $c->request->body ? (do { local $/; $c->request->body->getline }) : '';
$c->stash->{body} = $c->request->body ? (do { local $/ = undef; $c->request->body->getline }) : '';
}
sub log_request {

@ -6,7 +6,7 @@ use XML::Mini::Document;
use Data::Printer;
my $f = 'banlist.xml';
my $data = do { local $/; open my $fh, $f or die $!; <$fh> };
my $data = do { local $/ = undef; open my $fh, $f or die $!; <$fh> };
my $xmlDoc = XML::Mini::Document->new();
$xmlDoc->parse($data);
my $xmlHash = $xmlDoc->toHash();

Loading…
Cancel
Save