> On Sep 16, KYu said:
>
> >I was confront with a such question: how to define the strings, which
> >should be interpolated every time when it met?
> >
> >For example, this code
> >
> >$var1 = "one";
> >$str = "number $var1, ";
> >print $str;
> >
> >$var1 = "two";
> >print $str;
> >
> >produce "n
On Sep 16, KYu said:
>I was confront with a such question: how to define the strings, which
>should be interpolated every time when it met?
>
>For example, this code
>
>$var1 = "one";
>$str = "number $var1, ";
>print $str;
>
>$var1 = "two";
>print $str;
>
>produce "number one, number one" to the
KYu wrote:
Hello,
I was confront with a such question: how to define the strings, which
should be interpolated every time when it met?
For example, this code
always
use strict;
use warnings;
$var1 = "one";
$str = "number $var1, ";
print $str;
$var1 = "two";
print $str;
You never changed the value
Hello. Thanks for your answer!
> In general you have to continually modify $str, for instance,
Yes, I know about such method, but redefining a systring - isn't good way.
> Obviously you could set your constant value into a separate variable so
> that you could change them all quickly if you want.
> Hello,
> I was confront with a such question: how to define the strings, which
> should be interpolated every time when it met?
>
> For example, this code
>
> $var1 = "one";
> $str = "number $var1, ";
Right here Perl interpolates $var1 and stores the complete value into
$str, which is set. E