in reply to Re^4: Enlarging scalars
in thread Enlarging scalars

Yes - huck solved one of your problems, but there are many problems in your code.

See {choroba]s advice, or alternatively think about when Perl interpolates $z (and the other variables) into your string.

Printing your string $a at the various steps might help you understand when interpolation happens.

Perl interpolates strings at the time of mention, so by first calculating $z and then assigning to $a you should be able to solve the other problem.