bless

What exactly does Perl's "bless" do?

I understand one uses the "bless" keyword in Perl inside a class's "new" method: sub new { my $self = bless { }; return $self; } But what exactly is "bless" doing to that hash reference ? ...

How can I unbless an object in Perl?

From perldoc -f bless: bless REF,CLASSNAME This function tells the thingy referenced by REF that it is now an object in the CLASSNAME package. Is there any way of obtaining an unblessed structure without unnecessary copying? ...

To bless or not to bless, that is my question!

Hello everyone, first post from a newbie-user. Every question I google seems to bring me here and I always get a great answer to what I'm looking for; so naturally this was my first stop when I began pondering the usage of blessing in Perl. I've just gotten into Perl's OOP and just today read the post asking what bless does. I now under...

Perl read_config sub, oop or not?

Hi, I have a package (really just one subroutine) I use frequently to parse config file etc. Basically it looks like this: sub get_settings { my %config; my $config = 'path...'; unless(-r $config) { die("Couldn't read config"); } open CONFIG, '<', $config or die $!; while(...