$var = "(this is a good idea!), No it's not";
####
if ( $var =~ m/^\((.*)\),(.*)$/ )
{ @args = ($1, $2); }
##
##
if ( $var =~ m/^[(](.*)[)],(.*)$/ )
{ @args = ($1, $2); }
##
##
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my $data = "U|(Memory is incorrectly balanced between the NUMA ";
$data .= "nodes of this system, which will lead to poor performance. ";
$data .= "See),_NUMA_CRIT_,;(/proc/vmware/NUMA/hardware),_NUMA_CRIT_";
$data .= ",__REFERAL__file:__SELF__;( for details on your current ";
$data .= "memory configuration),_NUMA_CRIT_,;";
(my $m_type = $data) =~ s/^((?:U|M))\|.*$/$1/;
(my $p_list = $data) =~ s/^(?:U|M)\|(.*)$/$1/;
my @sub_p_tmp = split(';',$p_list);
my @args;
for ( my $i = 0; $i <= $#sub_p_tmp; $i++ )
{
if ( $sub_p_tmp[$i] =~ m/^\((.*)\),(.*),(.*)[,;]$/ )
{ @args = ($1, $2, $3); }
}
#print "$m_type\n\n$p_list\n\n".Dumper(@sub_p_tmp)."\n";
print "\nArgs:\n";
print Dumper(@args)."\n";
##
##
Args:
$VAR1 = 'Memory is incorrectly balanced between the NUMA nodes of this system, which will lead to poor performance. See';
$VAR2 = '_NUMA_CRIT_';