Monkomatic has asked for the wisdom of the Perl Monks concerning the following question:
Greetings fellow perl coders
I am tring to write a package module to make my code easier but i cannot seem to return the value generated. Anyone know what I am missing? It has got to be something simple i missed
use LWP::Simple; use LWP::Simple qw( $ua get ); use LWP::UserAgent; use HTTP::Request::Common qw(POST); use Price_calc; use Price_calc qw($amastringsentback1 $amastringsentback2 @amaglobal $ +amastringsentback); Price_calc::get_ama($amastringsent); # And then some attempted trys to + get value returned by Price_calc::get_ama $amastringsentback1=$Price_calc::amastringsentback; $amastringsentback2=shift; $amastringsentback3=@amagotback[0]; print "DATA: $amastringsentback - $amastringsentback1 - @amaglobal - +$amastringsentback3 - $Price_calc::amastringsentback" ; # everything just prints as empty ---------------------------------- package Price_calc; use LWP::Simple; use LWP::Simple qw( $ua get ); use LWP::UserAgent; use HTTP::Request::Common qw(POST); use Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw($amastringsentback1 $amastringsentback2 @amaglobal $am +astringsentback); sub get_ama { do stuff ## THE CODE WORKS FINE JUST WONT REUTRN VALUES. @amagotback[0]=$amastringsentback; return $amastringsentback; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning the value generated in package/module problem
by kcott (Archbishop) on Oct 12, 2010 at 11:39 UTC | |
by Monkomatic (Sexton) on Oct 12, 2010 at 11:58 UTC | |
|
Re: Returning the value generated in package/module problem
by cdarke (Prior) on Oct 12, 2010 at 12:38 UTC | |
|
Re: Returning the value generated in package/module problem
by Anonymous Monk on Oct 12, 2010 at 11:35 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |