in reply to problem with array
The main issues with your code were:
use strict; #open(IN, '<', "test.in") || die "\nCan't open test.in\n $!\n"; my @values; while(<DATA>) { if(/<ref id="(.*?)">/){ push @values ,$1; next; } if(m|</end>|){ print "New Group: @values \n"; @values=(); # Empty it } } #close(IN); __DATA__ <ref id="ref1"> <ref id="ref2"> <ref id="ref3"> </end> <ref id="ref4"> <ref id="ref5"> </end> <ref id="ref6"> <ref id="ref7"> <ref id="ref8"> </end>
Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax
|
|---|