##
#set some local variables
local ($name,$toys);
open ( INPUT , ")
{
@name=split(" ",$_) if /^-- NAME:\s(\w+)/;
@toys=split(" ",$_) if /^-- TOYS:\s(\w+)/;
}
close(INPUT);
foreach $name (@name)
{
print "the name $name\n";
}
foreach $toys (@toys)
{
print "the toys $toys\n";
}
####
the name --
the name NAME:
the name Menu
the neme
the toys --
the toys TOYS:
the toys CAR