open my $awspipe, '-|', qw/aws cloudformation describe-stack-drift­-detection-status --stack-drift-detect­ion-id/, $ID or die "open aws pipe: $!"; while (<$awspipe>) { chomp; my @f = split /"/; $DETECTION = $f[3] if /DetectionStatus/; $SYNC = $f[3] if /StackDriftStatus/; } close $awspipe or die "close aws pipe: $!";