Not exactly sure what you want the results to look like, next time, please post that as well. How about something like this:
Which prints out:while (<DATA>) { my ($name,$type,$value) = $_ =~ /^blah::(\w+)\s+(\w+):(\d+)/; print "blah::$name=$value\n" if $name and $value; } __DATA__ blah::status integer:22 blah::max integer:5
blah::status=22 blah::max=5Is this what you wanted?
UPDATE: no, it isn't. Just do what Roy Johnson suggested or try:
I prefer to pick out the parts in case i need them later, instead of substituting out what i don't need.my %table; while (<DATA>) { my ($name,$type,$value) = $_ =~ /^blah::(\w+)\s+(\w+):(\d+)/; $table{$name} = $value if $name and $value; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Array problem
by jeffa
in thread Array problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |