Read about how Perl passes parameters :-)
You shift the value of your parameter into $bb, now you modifiy $bb, but $bb
is a variable of it's own, it has nothing to do with the parameter you pass.
Reread my example and write your sub like this:
[$ sub TTEST $]
[- $aa = 3; -]
p$aa is
Hi there,
On Mon, 13 Dec 1999, Albert Liu wrote:
It works, but I never thought i can use this way to pass parameter. Indeed
i never read this in "Programming Perl" book. Perhaps it is at some where
it the book
Second edition, pages 111 to 121 inclusive.
73
Ged.
Here is the code for Execute
[- Execute ({ inputfile = '/mypath/mylibfile.lib', import = 1 }) -]
[- TTEST($bb); -]
p$bb is [+$bb+]/p
and here is the code inside the lib file
[$ sub TTEST $]
[- $bb = shift; -]
[- $aa = 3; -]
p$aa is [+$aa+]
[- $bb = $aa; -]
[$ endsub
It works, but I never thought i can use this way to pass parameter. Indeed
i never read this in "Programming Perl" book. Perhaps it is at some where
it the book
You can find all the infomations in the Perl man pages. Read
man perlsub
for example and you will find this information. Also
Thanks, it works, but the sub routine has to be in same files. How about
the sub routine is "Execute" from external lib file? I test it, it doesn't
work, do you know how to pass value between sub routines they are not in
same file?
This should work, regardless in which file you sub
Hi Gerald,
Thanks, it works, but the sub routine has to be in same files. How about
the sub routine is "Execute" from external lib file? I test it, it doesn't
work, do you know how to pass value between sub routines they are not in
same file?
Regards,
Albert
At 08:47 AM 12/10/99 +0100, Gerald