[wplug] novice question on perl assignment operator
Christopher DeMarco
cmd at alephant.net
Mon Jan 29 15:51:23 EST 2007
On Mon, Jan 29, 2007 at 12:45:42PM -0800, Juan Zuluaga wrote:
> #!/usr/bin/perl -w
> use strict;
>
> my $a = "a";
> my $b = "b";
> my $concat = $a . $b;
> print "$concat\n";
> $b = "newb";
> print "$concat\n"; # prints ab instead of anewb !
>
> how should i define $concat to make it respond to
> changes in its constituents? (what would be technical
> terms for this ?)
Make "concat" a subroutine which returns the concatenation.
--
Christopher DeMarco <cmd at alephant.net>
Alephant Systems (http://alephant.net)
PGP public key at http://pgp.alephant.net
+1-412-708-9660
More information about the wplug
mailing list