Interesting. I guess overload could take me some of the way there but it won't just be print; or I don't know how the value may end up being used - might be something like;
my $percentUsersOnline = ($usersOnline / $numUsers) * 100;
At which point the value needs evaluating.
Haven't played with overload knowingly before but get the feeling it's likely to end up as a messy hack - that the variable gets used in some way I hadn't predicted, and fails to be evaluated.
Gets me thinking though - wonder if there's some way by looking the call stack via caller? |