my $text; if (($text) = $line =~ m!^\s*\((.*)\)[\r\n]+$!) { # keyed value my ($key, $val) = split( /\s+/, $text, 2 ); $val =~ s!(^[\'\"]|[\'\"]$)!!g; $info->{$key} = $val; } elsif (($text) = $line =~ m!^\s*\'(.*)\'[\r\n]+$!) { # quoted value $text =~ s!(^[\'\"]|[\'\"]$)!!g; return $text; } elsif (my ($key) = $line =~ m!^\s*\((\S+)[\r\n]+$!) { # sub-level push @{$info->{$key} ||= []}, $self->_parse_vm_info( $lines ); }