On Nov 7, Tim Yohn said:
>Is there an easy way to have variables in the value of a hash that are
>not populated until the value of the hash is used... for example:
You could use my DynScalar module (found on CPAN):
use DynScalar;
my $domain;
my %hash = (
offline => dynamic { "$domain
ECTED]
Subject: Re: Population of variables in hash values...
Tim Yohn wrote:
> On Thu, 7 Nov 2002 11:04:26 -0800
> Timothy Johnson <[EMAIL PROTECTED]> wrote:
>
>
>>It sounds like the eval solution proposed earlier is exactly what
>>you're looking for then. Yo
Tim Yohn wrote:
On Thu, 7 Nov 2002 11:04:26 -0800
Timothy Johnson <[EMAIL PROTECTED]> wrote:
It sounds like the eval solution proposed earlier is exactly what
you're looking for then. You can just store the string in your hash
and eval it when you need to print.
Yup! With a little rework
On Thu, 7 Nov 2002 11:04:26 -0800
Timothy Johnson <[EMAIL PROTECTED]> wrote:
>
> It sounds like the eval solution proposed earlier is exactly what
> you're looking for then. You can just store the string in your hash
> and eval it when you need to print.
Yup! With a little reworking of how I'
mothy Johnson
Cc: [EMAIL PROTECTED]
Subject: Re: Population of variables in hash values...
On Thu, 7 Nov 2002 10:35:22 -0800
Timothy Johnson <[EMAIL PROTECTED]> wrote:
>
> Then I guess the real question is why you are declaring two variables
> that you want to be concurrently
Tim Yohn wrote:
>
> Hey All,
Hello,
> Is there an easy way to have variables in the value of a hash that are
> not populated until the value of the hash is used... for example:
>
> my($domain);
> my(%hash) = (
> 1 => "$domain"
> );
>
> print_domain("test.com");
>
> sub print_domain()
On Thu, 7 Nov 2002 10:35:22 -0800
Timothy Johnson <[EMAIL PROTECTED]> wrote:
>
> Then I guess the real question is why you are declaring two variables
> that you want to be concurrently updated when you can just use one.
>
Obviously I must not be able to explain what I am trying to
accomplish.
on do, 07 nov 2002 17:13:22 GMT, Tim Yohn wrote:
> Hey All,
>
> Is there an easy way to have variables in the value of a hash that are
> not populated until the value of the hash is used...
my($domain);
my(%hash) = (
1 => '$domain'
);
print_domain("test.com");
sub
of variables in hash values...
Nope,
No typo, this is exactly what I am trying to accomplish... I want the
hash to store the variable (and thus be able to reference that variable
and it's current value later on) and not the value of the variable. You
are correct in the fact that it does not
I don't see how that could possibly work, since you are declaring the value
of $hash{1} to be $domain, which has not been initialized. You are
declaring $hash{1} to be the VALUE of $domain. When you change $domain
later, this won't update your hash retroactively. Maybe this is just a typo
in yo
10 matches
Mail list logo