Perl how to search a pattern in a string

ambuli
ambuli used Ask the Experts™
on
I need to parse a line in the following form:

ABCDx=20,y=3,z=4;

I want to get the values of x, y, z
How to do this?
Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2014
Top Expert 2015
Commented:
$_='ABCDx=20,y=3,z=4;';
my($x,$y,$z)=/=(\w*)/g;
print "$x,$y,$z\n";

Author

Commented:
Thanks Ozo.  Can you please explain what is this line is doing?

my($x,$y,$z)=/=(\w*)/g;
ozo
Most Valuable Expert 2014
Top Expert 2015

Commented:
it is looking for any string of alphanumeric characters following an =

Author

Commented:
Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial