in reply to Re^2: Use of uninitialized value in concatenation
in thread Use of uninitialized value in concatenation

Yes, it does. Why don't you try GrandFather's or targetsmart's or my suggestions?
  • Comment on Re^3: Use of uninitialized value in concatenation

Replies are listed 'Best First'.
Re^4: Use of uninitialized value in concatenation
by gem555 (Acolyte) on Jun 11, 2009 at 06:18 UTC
    The "$testing" is replaced with "dollar" with the below code
    #!/usr/bin/perl -w use strict; use warnings; my %words = map { $_ => 1 } qw($Word $name $test); my $line = '$Word $ $ $ $test $testing'; $line =~ s/(\$\w*)/exists $words{$1} ? $1 : " dollar "/eg; print "$line\n\n"
    The output which i need is if the values are not present in array, then $Word dollar dollar dollar $test dollartesting
      >perl -wMstrict -le "my %words = map { $_ => 1 } qw($Word $name $test); my $line = '$Word $ $ $ $test $testing'; $line =~ s/(\$(\w*))/exists $words{$1} ? $1 : qq{dollar$2}/eg; print $line; " $Word dollar dollar dollar $test dollartesting