On 4/15/09 Wed Apr 15, 2009 9:18 PM, "Fatema M" <fsm1...@gmail.com> scribbled:
> Hi, > I am facing an error while executing the Perl script, its compilation fails > with the following error > "Can't call method "execute_flow" without a package or object reference > at <addr> " > > Code Snippet: > > use netElement::vpu; > > &getSysConfig ($O3_VPU_ID , \%vpu); > $vpu=new vpu(\%vpu); This calls the new method in package vpu and assigns the return value, which should be a blessed scalar of some type, usually a reference to a hash, but it could be any scalar. One possible problem is that you have not explicitly imported a package vpu into your program. Perhaps you need here: $vpu = new netElement::vpu(\%vpu); $vpu must be a blessed scalar in order to call methods on it. Packages netElement::vpu and vpu are not the same. It is also possible that the new() method has not returned a valid object (blessed scalar) for some reason. You should look at the source code for the new() method and see why that might be. > > #&comment("Lock /neApps-1 in order to change APS mode."); > @vpuReport = (); > %my_step = ('lock:device'=> ["NEAPPS-0-0-0-1"]); > $rc = $vpu->execute_flow(\...@my_step,\...@vpureport,"$REPORT_STATUS"); -- > *ERROR Perl is telling you that it cannot call the execute_flow() method of a class instance because $vpu is not a valid instance, i.e., has not been blessed into a class (module or package). You need to determine why $vpu does not contain a proper blessed value at this point. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/