[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

RE: [PERL] Regexp substitution med variable?



Tak for det hurtige svar. :-)

/e flaget havde jeg ikke lige prøvet før...

For at eksemplet virker, skal der forøvrigt stå:

$var =~ s/spiser vi ([a-zæøå]+)/"æder vi " . $a->{$1}/e;

M.v.h.
~Morten


> -----Original Message-----
> From: Peter Makholm [mailto:sslug@sslug
> Sent: Wednesday, June 11, 2003 12:10
> To: sslug@sslug
> Subject: Re: [PERL] Regexp substitution med variable?
> 
> "Morten Egelund Rasmussen" <sslug@sslug> writes:
> 
> > $var =~ s/spiser vi ([a-z]*)/æder vi $a->{$1}/;
> 
> Du kan få den til at evaluerer højresiden af substitutionen med
> e-flaget:
> 
> $var =~ s/spiser vi ([a-z]*)/"æder vi " . $a->{$1}/e;
> 
> --
>  Peter Makholm     |         Perhaps that late-night surfing is not such a
>  sslug@sslug |           waste of time after all: it is just the web
>  http://hacking.dk |                                              dreaming
>                    |                                    -- Tim Berners-Lee
> 





 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:55 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *