in reply to The return value of tie()

dragonchild,
Well, to know for sure I would need to see the TIEARRAY sub from My::Class, but I think you are misreading tie. The new() function for a tied class is replaced by "TIESCALAR", "TIEHANDLE", "TIEARRAY", or "TIEHASH".

As for why it is returning a blessed reference - that's what it supposed to do. That is so you can create a hybrid OO and tied object to do things like:

my $obj = tie my @array, 'My::Class'; $obj->some_method;
The uglier way to do that without storing the return value is to do:
(tied @array)->some_method();
It is important to note that you should undef $obj before trying to untie @array. Ultimately the underlying object needn't be the same type as the user sees. If you look under the covers of my Tie::Hash::Sorted, you will see that the hash is really an array under the covers.

If you want to post more code of My::Class I would be happy to take a look.

Cheers - L~R