http://www.perlmonks.org?node_id=1468

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

use Set::Scalar; use Set::Scalar::Valued; $foo = Set::Scalar::Valued->new; $foo->insert("bar", Set::Scalar->new); $foo->value("bar")->insert("baz"); # But I get 'Can't call method 'insert' on unblessed # reference at test.pl line 6.' What's the deal oh wise # ones?

Replies are listed 'Best First'.
RE: This should work
by chromatic (Archbishop) on Apr 01, 2000 at 11:07 UTC
    I think you need to create your "bar" object explicitly before you insert() it into "foo". (An "unblessed reference" is something that you're treating as an object before Perl knows it's an object. See bless.)