tie variable to function?
From: JupiterHost.Net (mlists_at_jupiterhost.net)
Date: 11/29/04
- Next message: Jonathan Paton: "Re: tie variable to function?"
- Previous message: Jenda Krynicky: "Re: Error: Scalar found where operator expected"
- Next in thread: Jonathan Paton: "Re: tie variable to function?"
- Reply: Jonathan Paton: "Re: tie variable to function?"
- Reply: Jenda Krynicky: "Re: tie variable to function?"
- Reply: Randy W. Sims: "Re: tie variable to function?"
- Reply: JupiterHost.Net: "Re: tie variable to function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Nov 2004 09:03:39 -0600 To: beginners@perl.org
Hello list,
I saw this recently on here but can't find the thread and since I'm not
sure what the technique is called (tie variable to function?) I'm not
sure where to look on perldoc :)
What is it called/How do you go about doing it when you have a var that
each time is used (IE printed or in calculation) has the current value
of a function?
For example:
my $time =...
# do magic to make $time always return time()
print "$time\n";
sleep 3;
print "$time\n";
would output:
1101740477
1101740480
Any ideas? benefits/drawbacks to consider?
TIA!
- Next message: Jonathan Paton: "Re: tie variable to function?"
- Previous message: Jenda Krynicky: "Re: Error: Scalar found where operator expected"
- Next in thread: Jonathan Paton: "Re: tie variable to function?"
- Reply: Jonathan Paton: "Re: tie variable to function?"
- Reply: Jenda Krynicky: "Re: tie variable to function?"
- Reply: Randy W. Sims: "Re: tie variable to function?"
- Reply: JupiterHost.Net: "Re: tie variable to function?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|