Thread: cant call method "Value"
Results 1 to 4 of 4
Related
-
is there a difference between <script language="javascript> and <script type="text/javascript"> Forum: Javascript Forum
Replies: 8 -
input type=hidden name="to" VALUE="user@yahoo.com" Forum: HTML Forum
Replies: 1 -
how can i only make "one" link turn to another color when hovered(mouse moves to it)? Forum: CSS Forum
Replies: 5
-
06-28-2006, 04:20 AM #1
cant call method "Value"
while executing a perl file, i got an error saying--cant call method "Value" on an undefined value.
what does this mean?
pla reply
-
06-28-2006, 05:26 AM #2
Re: cant call method "Value"
This is an error that people will need to see the code for.
Please post the code that is causing the error, and don't forget to use the proper tags ...
-
06-28-2006, 06:32 AM #3
Re: cant call method "Value"
Am jus pasting a part of the code here with the error line..
Pls tell me wats wrong with this code
my $status;
my($iC, $oWkS);
for(my $iC = 0;$iC <= $oWkS->{MaxCol} ; $iC++)
{
$oWkC9 = $oWkS->{Cells}[1][$iC];
$status = $oWkC9->Value; (ERROR IN THIS LINE)
print "$status\n";
$_=$status;
#print "$_\n";
if(/F-record/){my $frecord = $iC;} #0
if(/Brief Description/){my $briefdescription = $iC;} #4
if(/prio/){my $priority = $iC;} #15
if(/failure detected by/){my $failuredetected = $iC;} #22
if(/Date Assign/){my $dateassign = $iC;} #35
if(/Date Corrected/){my $datecorrected = $iC;} #38
if(/Date Unverify/){my $dateunverify = $iC;} #41
if(/Date Reopened/){my $datereopened = $iC;} #42
if(/Status Action date/){my $statusactiondate = $iC;} #45
}
-
07-09-2006, 02:13 AM #4
Re: cant call method "Value"
From: Michael (http://Perl-services.mprv.biz)
Hi Priya,
I wonder, what you are trying to do here. Is this your complete code or just a fraction?
To your question.
$oWkC9->Value is a function call in Perls approach to Object Oriented Programming (OOP). More explicitely you'd write $oWkC9->Value(). Perl assumes:
* you have defined the object somewhere
* you create a new instance calling the new() function.
So something like this should appear in your code:
Code:$oWkC9 = YOUROBJECT->new(); # creating a new instance
Code:package YOUROBJECT; sub Value { # some operations } .. 1;
A way to save variables permanently inside a Perl object is assigning it to an anonymous hash (during calling new()). When you intend Value to be just a value, you probably meant:
Code:$oWkC9->{Value};
Michael
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum