BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:
I was playing around with tie, tying various special variables and stuff when I encountered a error I've not seen before: "Can't upgrade that kind of scalar...".
A Google turns up quite a few references to this, but none that explain what it means or how to fix it.
None that is until it turned up this perlman:perldiag right here at the monastery which reads:
Can't upgrade that kind of scalar
(P) The internal sv_upgrade routine adds ``members'' to an SV, making it into a more specialized kind of SV. The top several SV types are so specialized, however, that they cannot be interconverted. This message indicates that such a conversion was attempted.
In this case, should I read that to mean: You cannot tie that variable, so stop trying?
The reason for asking for clarification is that the actual tie statement went ahead without comment. It was only when doing something ostensibly unrelated--though I realise it is--that the error occurs:
use X; BEGIN{ tie %::, 'X'; } ... require IO::Socket; ## This causes the "Can't upgrade that type of sc +alar"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fatal error: "Can't upgrade that kind of scalar"
by Anonymous Monk on Aug 15, 2007 at 08:21 UTC | |
by dogz007 (Scribe) on Aug 15, 2007 at 11:55 UTC | |
by clinton (Priest) on Aug 15, 2007 at 12:10 UTC | |
by Anonymous Monk on Aug 16, 2007 at 11:50 UTC |