Re: How to put the match in an array

2012-03-14 Thread lina
Hi Tim, On Wed, Mar 14, 2012 at 6:03 PM, timothy adigun <2teezp...@gmail.com> wrote: > Hi lina, > > On Wed, Mar 14, 2012 at 10:50 AM, lina wrote: >> >> Hi, >> >> I have problem putting the match into an array, >> >> $ more sample.tex >> aaa\cite{dehydron,dehydron1},ddd >> bbb\cite{inhibitorAromat

Re: How to put the match in an array

2012-03-14 Thread timothy adigun
Hi lina, On Wed, Mar 14, 2012 at 10:50 AM, lina wrote: > Hi, > > I have problem putting the match into an array, > > $ more sample.tex > aaa\cite{dehydron,dehydron1},ddd > bbb\cite{inhibitorAromaticDirect}aaa > > > my @items; > open my $fh, '<', "sample.tex"; > while(<$fh>){ >if(/cite

How to put the match in an array

2012-03-14 Thread lina
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/