Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 7th, 2012, 03:09 AM
ScarletOScarlet ScarletOScarlet is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 ScarletOScarlet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 44 sec
Reputation Power: 0
Is this some oop stuff

Hello!

I am trying to call a function here:


$Dashboard::dashboard->DoSomething($myvariable_1, $myvariable_2, $myvariable_3, $myvariable_4,$myvariable_5);



sub DoSomething {
my ( $self, $myvariable_1, $myvariable_2, $myvariable_3, $myvariable_4,$myvariable_5 ) = @_;

$self->_debug("1: $myvariable_1\n");
$self->_debug("2: $myvariable_2\n");
$self->_debug("3: $myvariable_3\n");
$self->_debug("4: $myvariable_4\n");
$self->_debug("5: $myvariable_5\n");


Is this $self some reserved variable in perl ? This is not working. saying uninitialised value for the variables @myvariable_1-5

Reply With Quote
  #2  
Old August 7th, 2012, 05:51 AM
keath's Avatar
keath keath is offline
!~ /m$/
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2004
Location: Reno, NV
Posts: 4,099 keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level)keath User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 8 h 20 m 20 sec
Reputation Power: 1809
$self isn't a reserved keyword, but when you are inside an object, methods receive the object as their first argument. You receive it even though it was not passed in, and it is traditionally captured into a variable called $self, though you could call it anything you want.

I can't tell from the context of your code snippet if you are inside or outside of an object. Also, you appear to be calling methods on the class rather than on an instantiated object.

Reply With Quote
  #3  
Old August 7th, 2012, 06:23 AM
ScarletOScarlet ScarletOScarlet is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 4 ScarletOScarlet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 44 sec
Reputation Power: 0
Thanks again Keath, have a nice day!



Quote:
Originally Posted by keath
$self isn't a reserved keyword, but when you are inside an object, methods receive the object as their first argument. You receive it even though it was not passed in, and it is traditionally captured into a variable called $self, though you could call it anything you want.

I can't tell from the context of your code snippet if you are inside or outside of an object. Also, you appear to be calling methods on the class rather than on an instantiated object.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Is this some oop stuff

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap