thanks a lot david
did exactly whjat i wanted!
allan
> Not sure exactly what you mean here, because variables *really are* variable
> in a regex.
well sometimes you just know that a particular variable arent gonna
change but for easy maintainance one might use a variable instead of hardcoding.
> #/usr/bin/perl -w
>
> %hash = ("<xml1>", 33, "<xml2>", 44);
>
> my $string = "first value: <xml1> sec value: <xml2>";
>
> print perlFunction($string, \%hash);
>
> #should output first value: 33 sec value: 44
>
> sub perlFunction() {
> my($str, $hashref) = @_;
> while(my($key, $val) = each %$hashref) {
> $str =~ s/$key/$val/gi;
> }
> return $str;
> }