#!perl use strict; use warnings; my $string = "add vdisk \"\\vdisks\\type 1\\vdname\" ". "disk_group=\"\\d gs\\diskgrp1\" size=500"; # split on quotes my @quotes = split(/\"/, $string); print "\@quotes:\n\t" . join("\n\t", @quotes) ."\n";; # @quotes should be 'add vdisk'. # '\\vdisks\\type 1\\vdname', # 'disk_group=', # '\\d gs\\diskgrp1\\', # 'size=500' # split the second element on backslashes... my @back = split(/\\/, $quotes[1]); print "\@back:\n\t" . join("\n\t",@back)."\n"; # and popout the last element... my $is_this_it = pop(@back); print $is_this_it,"\n"; #### vdname