For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > Auto hashName generator;









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Auto hashName generator;
Umesh T G

2005-08-02, 5:00 pm

Hello List,

I am finding problem in generating a hash names. for eg.

I have an array of elements. All elements should be converted into
hash name and should get intialised.

Say..

@Arr =3D qw ('one', 'two');

foreach $word (@Arr) {
$name =3D $word."hash";
Here I should intialise the hash.. like it should be %onehash =3D () ;
}
How to do it?=20
I am stuck at this point. If there is a better way to do it, that will be f=
ine.

Thanks in advance,

Cheers,
Umesh.
John W. Krahn

2005-08-02, 5:00 pm

Umesh T G wrote:
> Hello List,


Hello,

> I am finding problem in generating a hash names. for eg.
>
> I have an array of elements. All elements should be converted into
> hash name and should get intialised.
>
> Say..
>
> @Arr = qw ('one', 'two');
>
> foreach $word (@Arr) {
> $name = $word."hash";
> Here I should intialise the hash.. like it should be %onehash = () ;
> }
> How to do it?
> I am stuck at this point. If there is a better way to do it, that will be fine.
>
> Thanks in advance,


perldoc -q "How can I use a variable as a variable name"


John
--
use Perl;
program
fulfillment
Umesh T G

2005-08-02, 5:00 pm

On 8/2/05, John W. Krahn <krahnj@telus.net> wrote:
> Umesh T G wrote:
>=20
> perldoc -q "How can I use a variable as a variable name"
>=20


Much Thanks...

It is helpful.

Cheers,
Umesh.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com