in reply to Problems using ties

I saw a few problems. Check out perltie for more details as to how this all works.

The constructor seems fine...

package Celcius; sub TIESCALAR { my $class=shift; my $data=shift; return bless \$data, $class; }
Your version of STORE didn't actually STORE the change...
sub STORE{ my $self=shift; my $data=shift; $$self = ($data*(9/5)+32); }
And last, FETCH only takes one argument, and it's that one argument you should dereference.
sub FETCH{ my $self=shift; return $$self; } 1;

If you're interested, here's the test code I used to try out my version:

#!/usr/bin/perl -w use strict; use Celcius; my $temp; tie $temp, 'Celcius'; $temp = 0; print "Initial temp is $temp (C)\n"; while(<>) { chomp; $temp = $_; print "Temp is $_ (F) ($temp (C))\n"; }
As an alternative, you could store the Farenheit temp, and do the conversion in FETCH when you return the value.

Oh, and I think it's spelled "Celsius", but I'm not sure :)
--
Mike