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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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


May 5, 2013, 1:34 PM

Views: 779
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.

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