Ravi Malghan wrote:
> Hi:

Hello,

> I have a variable called $agent_id and want to create a string with the
> value of $agent_id followed by "-str". The following does not seem to work. 
> The following example I want to create a variable called $35-str.

Numerical variable names are reserved for regular expressions.


> $agent_id = 25;
> $agent_id."-str" = "This is test\n";

You want to use a hash:

my %agent_id;

$agent_id{ 25 } = "This is test\n";




John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to