in reply to Appending characters to an existing string
Please make sure that every script that you write starts with
or if you are on a pre 5.6 version of perl (you may need to alter the path after the #! mark as required by your local setup)use strict; use warnings;
You will find that you learn much faster when the compiler is constantly pointing out ambiguous structures, errors, and other forms of strangeness.#!perl -w use strict;
Incidentally if you wish to append chars to a string contained within a scalar the normal approach is
Just about anytime you have a construct that goes like$foo.='some string';
you can rewrite it as$foo=$foo (operator) (value)
Note that there is NO space in between the operator and the equals. Common examples of this are$foo (operator)= (value)
HTH$foo+=10; $foo*=2; $foo.='bar'; $foo||='default';
--- demerphq
my friends call me, usually because I'm late....
|
|---|