bofinken has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I don't want the subroutine in a module write the string value. I want to do it in my main program. That seems easy and logical, but I can't get it working.
My value is in a subroutine that I am calling, so far so good, but I want to continue pass it over to my program. How do I do that?
Here is my module (with subroutine) and my main. This doesn't work... Thankful for help.
*********
my main program .pl:
use testarvilt(menskrivtillbaka); testarvilt::menskrivtillbaka("Hejhej"); print $dininput_len;
my .pm file:
package testarvilt; sub menskrivtillbaka { $dininput=@_[0]; print $dininput; $dininput_len = length $dininput; } 1;
2018-12-01 Athanasius added code and paragraph tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get the string from the module
by tobyink (Canon) on Nov 28, 2018 at 15:49 UTC | |
by bofinken (Initiate) on Nov 29, 2018 at 21:36 UTC | |
|
Re: Get the string from the module
by karlgoethebier (Abbot) on Nov 28, 2018 at 15:50 UTC | |
|
Re:Get the string from the module
by BillKSmith (Monsignor) on Nov 28, 2018 at 16:14 UTC |