#!/usr/bin/perl use strict; use warnings; my ( $name, $status ) = `./retrieve 2301` =~ /(?=CID:\s*(.+))(?=STATUS:+\s*(.+))/; my $newstatus $status; //Just be able to access the variable with data print $newstatus;