tags:

views:

80

answers:

1

Hi

I would like rename a variable dynamically, Is there any way to do this in perl.

Thanks Praveen

+2  A: 

Do you want to use a reference? This gives you a reference to an existing object. Probably good enough.

Or, do you want to use a Type Glob? This allows you to directly modify the symbol table. There's probably no good reason for using it these days, but it does let you give a new name to an existing variable at a very fundamental level.

sarnold
There are lots of good reasons for modifying the symbol table -- exporting, aliasing, run-time dispatching, etc.
mobrule