#!/usr/bin/perl use warnings; use strict; # First, build the data structure. # I took the liberty of making this a standalone test-case so I can run it. our $shows_str = shows_str(); our @showtab; for (split /^/, $shows_str) { /\S/ or next; /\A\s*(\S.*?)\s*\(([^()]+)\)/ or die "error parseing input line ($_)"; my %s = ( name => $1, user => $2, ); push @showtab, \%s; }