Another perlish solution:
my %teams = do { local $/; <DATA> =~ /^([A-Z\s]+?):\s*(.+)$/mg; };The do block is most helpful here to override $/ in the block and leave it unchanged elsewhere. local $/; turns on file slurping. A match in list context returns a list of all our submatches in parenthesis, which go to our hash.
In reply to Re: Please fix my writing style
by juster
in thread Please fix my writing style
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |