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!

--
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