CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: ref used in classes: Edit Log



death_metal
Novice

May 5, 2013, 1:34 PM


Views: 480
ref used in classes

Hi members,
I am new to Perl and this forum too. Just started my hands on Perl, objects and classes.

I couldn't understand why ref is used in object blessing.

Code
package Room; 
use strict;
sub new{
my ($caller,@arg)=@_;
my $class=ref(caller);
my $self{
#some code
};
return (#some code);
}


Kindly help me, what is the use of Ref?. Unimpressed
we could have got class name in first line of subroutine new.

Any help shall be appreciated. Smile


(This post was edited by death_metal on May 5, 2013, 1:36 PM)


Edit Log:
Post edited by death_metal (Novice) on May 5, 2013, 1:36 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives