Hi,

I have problem putting the match into an array,

$ more sample.tex
aaa\cite{dehydron,dehydron1},ddd
bbb\cite{inhibitorAromaticDirect}aaa


open my $fh, '<', "sample.tex";
while(<$fh>){
        if(/cite\{(\S+)\}/){
                $cited = sprintf "%s\n",$1;
                #$cited =~ tr/\,/\n/;
                @citeditems = split(/\,/,$cited);
                push(@items,@citeditems);
                @items = join " ", @items;
                }
}
close($fh);


print $items[-1];

shows:
dehydron dehydron1
 inhibitorAromaticDirect

I wish

dehydron
dehydron1
inhibitorAromaticDirect

to be independent item of the array.

sorry for last postings, I really stuck here.

Thanks with best regards,

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to