S
Scott Bass
Hi,
my $var = "TESTID: A\nB\nOBJECTIVE: C\nD\nPROCEDURE: E\nF\nRESULTS: G\nH\n";
my %hash = $var =~ /(TESTID|OBJECTIVE|PROCEDURE|RESULTS).+)/mg;
print $hash{"TESTID"};
print $hash{"OBJECTIVE"};
print $hash{"PROCEDURE"};
print $hash{"RESULTS"};
1. How can I get $hash{"TESTID"} = "A\nB", etc.?
2. (Minor) How can I make the hash keys lowercase? The search needs to be
case-sensitive, and the text must be in upper case?
Sorry if this is in the docs (just point me to it). I searched the doc,
Googled, and skimmed a couple O'Reilly books before posting.
Thanks,
Scott
my $var = "TESTID: A\nB\nOBJECTIVE: C\nD\nPROCEDURE: E\nF\nRESULTS: G\nH\n";
my %hash = $var =~ /(TESTID|OBJECTIVE|PROCEDURE|RESULTS).+)/mg;
print $hash{"TESTID"};
print $hash{"OBJECTIVE"};
print $hash{"PROCEDURE"};
print $hash{"RESULTS"};
1. How can I get $hash{"TESTID"} = "A\nB", etc.?
2. (Minor) How can I make the hash keys lowercase? The search needs to be
case-sensitive, and the text must be in upper case?
Sorry if this is in the docs (just point me to it). I searched the doc,
Googled, and skimmed a couple O'Reilly books before posting.
Thanks,
Scott