http://www.perlmonks.org?node_id=199449

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to parse this information in a more sane way, it seems that there should be a better way.
#!/usr/bin/perl -w use strict; my $var = "xxx:12345 yyy:54321 zzz:13245"; my @items = split("\:",$var); @items = split(" ",$items[1]); print "$items[0]\n";

xxx, yyy, zzz are basically completely random.

What I am looking for is a way to grab the value of xxx without having to use multiple split's.

Thanks in advance.