Ing. Branislav Gerzo wrote:

Hi pals,

Hello,

use strict;
use warnings;

my $foo = 'test';
my @bar = ( 'foo', '[%foo%]', 'bar' );
my @list = ();

foreach my $x (@bar) {
        $x =~ s/^\[%([^%]+)%\]$/${$1}/g;

its esentially doing ${foo} since the string foo is in @bar. that is a soft reference and not allowed under no strict;

The question would be why you're doing ${$1} since nothing in @bar is a reference.

I think you want:
 $x =~ s/^\[%([^%]+)%\]$/$1/g;

HTH - Lee.M - JupiterHost.Net

        print $x . " ";
}


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to