in reply to eval function

Rather than find an alternative with s/, it seems more appropriate to address the actual mistake, which was to use single quotes (causing the contents to be interpreted literally) where double quotes were required i.e.
$data{value} = "abcd.$digit.xyz";
in which perl will indeed apply the required substitution.

One world, one people

Replies are listed 'Best First'.
Re^2: eval function
by swaroop (Beadle) on Aug 18, 2005 at 09:51 UTC
    Hi,

    If we give double quotes , The output will be "abcd..xyz".
    Its because of perl assignes the value of $digit to $data{value} in the begining itself.
    Anyways , thanks for the reply.

    - swaroop
      Perhaps so, but there's no quick fix then, because $data{ value } is trying to do too many jobs -- it seems to contain a formula for setting itself which then destroys the formula if needed for subsequent iterations. I think at this point a functional description of the requirement is needed before diving into any solution.

      One world, one people