my $new_str = ( grep { /makefile$/ } split /\s+/, $old_str )[0];