Roy Peters wrote:
> 
> I have a string of the following
> 
> $str = "X1=1,Y1=2,Z1=3";
> 
> I want to assign the values to the right hand side of the "=" to 3 new
> variables so the final result is
> 
> $a=1
> $b=2
> $c=3
> 
> How do I get those values assigned to $a, $b, $c

$ perl -le'
$str = "X1=1,Y1=2,Z1=3";
( $a, $b, $c ) = $str =~ /=(\d+)/g;
print "$a  $b  $c"
'
1  2  3


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to