Re: how to get two matches out

2012-04-29 Thread lina
Thanks for Lawrence's crystal clear explaination and Shawn's reply. I understand now, best regards, P.S seems we don't have the same perldoc. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to get two matches out

2012-04-29 Thread Lawrence Statton
On 04/29/2012 10:41 AM, lina wrote: On Sun, Apr 29, 2012 at 11:26 PM, Lawrence Statton wrote: On 04/29/2012 10:21 AM, lina wrote: Hi, I have a text file like: $ more sample.tex aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} bbb\cite{inhibitor}aaa sub read_tex{ open my $fh, '<

Re: how to get two matches out

2012-04-29 Thread Shawn H Corey
On 12-04-29 11:41 AM, lina wrote: if($_ =~ m/cite\{(.+?)\}/g){ Not work. while( $_ =~ m/cite\{(.+?)\}/g ){ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. [updated for today's programmers] "Show me your

Re: how to get two matches out

2012-04-29 Thread lina
On Sun, Apr 29, 2012 at 11:26 PM, Lawrence Statton wrote: > On 04/29/2012 10:21 AM, lina wrote: >> >> Hi, >> >> I have a text file like: >> >> $ more sample.tex >> >> aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} >> bbb\cite{inhibitor}aaa >> >> >> sub read_tex{ >>        open my $fh, '<', @_;

Re: how to get two matches out

2012-04-29 Thread Lawrence Statton
On 04/29/2012 10:21 AM, lina wrote: Hi, I have a text file like: $ more sample.tex aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} bbb\cite{inhibitor}aaa sub read_tex{ open my $fh, '<', @_; while(<$fh>){ if(/cite\{(.+?)\}/){ push @citeditems

how to get two matches out

2012-04-29 Thread lina
Hi, I have a text file like: $ more sample.tex aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} bbb\cite{inhibitor}aaa sub read_tex{ open my $fh, '<', @_; while(<$fh>){ if(/cite\{(.+?)\}/){ push @citeditems,split/,/,$1; }