http://qs321.pair.com?node_id=274657


in reply to Extract info from a list

An easy way is to split on '/' which ordinarily needs to be escaped. The resulting array has nothing in the first two slots,

my %count; $count{(split /\//)[2]}++ while <DATA>; printf "%s = %d\n", $_, $count{$_} for keys %count; __DATA__ //word.one.team/other.stuff/Info.info //this.sentence/other.inforation/moreInfo //first.part.here/set.list //this.sentence/data/processing

Update: ++tos for the correction. Repaired.

After Compline,
Zaxo