$text =~ s/__([-_\.a-zA-Z]+?(?:\(.+?\))*)__/$Self->_analyse_ph($1)/gme;
1
2
3
__article.reldate.dayofmonth.html_selectscalar(0,1,31,article_reldate_dayofmonth)__
__article.reldate.month.html_selectscalar(0,1,12,article_reldate_month)__
__article.reldate.year.html_inputline(6,4,article_reldate_year)__
1 2
my $test = '__article.reldate.dayofmonth.html_selectscalar(0,1,31,article_reldate_dayofmonth)__'; if ($test =~ /__([-_\.a-zA-Z]+?(?:\(.+?\))*)__/) {say $1}
Quotearticle.reldate.dayofmonth.html_selectscalar(0,1,31,article_reldate_dayofmonth)
$text =~ s/__([-_\.a-zA-Z]+?)(?:\((.+?)\))*__/$Self->_analyse_ph($1,$2)/gme;
QuoteJa, sofern die Klammer vorhanden ist.bei deinem Regex steht wirklich immer in $2 was drin?
1
2
_analyse_ph(placeholder::'article.autor'||parameter::'');
_analyse_ph(placeholder::'article.titel.html_inputline'||parameter::'80,120,article_titel');
1
2
Use of uninitialized value in substitution iterator at
/Users/f/htdocs/_MM_root_/roode/cgi-bin/devel/Sitescriptor/..//Sitescriptor/Core/Meta/Metatemplate.pm line 148 (#1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
package Mooooo; use Modern::Perl; sub _analyse_ph { my $self = shift; my ($arg) = shift; chomp $arg; return "<!-- ### $arg ### -->"; }; sub new { my $this = shift; my $class = ref($this) || $this; my $self = {}; bless $self, $class; return $self; } my $Self = Mooooo->new; my $text; while ($text = <DATA>) { $text =~ s/__([-_\.a-zA-Z]+?(?:\(.+?\))*)__/$Self->_analyse_ph($1)/gme; say $text; } 1; __DATA__ __article.reldate.dayofmonth.html_selectscalar(0,1,31,article_reldate_dayofmonth)__ __article.reldate.month.html_selectscalar(0,1,12,article_reldate_month)__ __article.reldate.year.html_inputline(6,4,article_reldate_year)__ __article.id__ __article.autor__