in reply to Re^3: Multiline variables
in thread Multiline variables
sub initrooms { my (@ta, %things, $b, @ar, $t, $de, $ex, $th, @a); open (RF, "rooms.txt") or die "could not open datafile: $!"; $/ = undef; $b = (<RF>); $/ = "\n"; @ar = split /0/, $b; foreach (@ar) { ($t, $de, $ex, $th) = split ":", $_; if ($th eq "") { next; } @ta = split "-", $th; %things = @ta; push @a, { TITLE => $t, TEXT => $de, EXITS => $ex, TH +INGS => {%things} }; }; return \@a; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Multiline variables
by theantler (Beadle) on Mar 10, 2010 at 17:44 UTC |