Hi lina,

On Wed, Mar 14, 2012 at 10:50 AM, lina <lina.lastn...@gmail.com> 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\{(\S+)\}/){

              push @items,split/,/,$1;

>        }
> }
> close($fh);
>
>
> print $items[-1];
>
print $_,"\n" for @items;

    **OUTPUT**
dehydron
dehydron1
inhibitorAromaticDirect


>
> 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/
>
>
>


-- 
Tim

Reply via email to