usersub problems when invoked within a subroutine 
Author Message
 usersub problems when invoked within a subroutine

Keywords: usersub

Thanks for posting the notes on how to hook in usubs.
I've compiled ex1.c on a sun workstation and found
the following problem.  If I call opie from within
a subroutine and the subroutine returns a list,
the resulting information returned is lost.  If,
I put parenthesis around $new in the call to opie,
eg ($new) = &opie($num), the script runs as
expected.  Do you know why this is behaving this way?

Thanks,
sylvia

sub getval
{

   print "number entered is $num \n";
   $new =&opie($num);
   print "new = $new \n";
   local ($buf) = "hi there ";
   local($res) = 1;
   return ($new,$buf,$res);

Quote:
} #===============================================

if ( defined(&opie) ) {
    print "&opie is defined\n";
    print "\t&opie(10) = ", &opie(10), "\n";
Quote:
} else {

    print "&opie is not defined\n";

Quote:
}

($val,$buffer,$result) = &getval (5);
print "val = $val \n";
print "buffer = $buffer \n";
print "result = $result \n";
#===================================================

#resulting output ->

&opie is defined
        &opie(10) = 101.20000000000000284
number entered is 5
new = 26.199999999999999289
val = 1
buffer =  
result =  



Wed, 01 Mar 1995 04:10:54 GMT  
 usersub problems when invoked within a subroutine

   Thanks for posting the notes on how to hook in usubs.
   I've compiled ex1.c on a sun workstation and found
   the following problem.  If I call opie from within
   a subroutine and the subroutine returns a list,
   the resulting information returned is lost.  If,
   I put parenthesis around $new in the call to opie,
   eg ($new) = &opie($num), the script runs as
   expected.  Do you know why this is behaving this way?

   Thanks,
   sylvia

    [ ... Program omitted ... ]

This works ok with pathlevel > 19.  I'm running 4.35 now, and this problem
does not occur.  I recompiled with 19 and got the problem described above.

--
-- Rob Torop

+---------------------------------------------------------------------+
| The views expressed here are neither mine nor those of my employer. |
+---------------------------------------------------------------------+



Fri, 03 Mar 1995 03:45:20 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help - Subroutine within a Subroutine Illegal?

2. need help:problems accessing subroutines within child processes

3. Having trouble invoking subroutine inserting data to database

4. Tk::Radiobutton invoke doesn't seem to run callback subroutine

5. Win32::ODBC and Insert subroutine within While loop

6. Getting the subroutine name from within a sub

7. executing subroutines within a regex

8. Print to a filehandle within a subroutine

9. calling subroutines from within itself

10. Confused about file globbing within subroutines

11. Recursive subroutine output to recursive subroutine problem

12. problem invoking a new method!

 

 
Powered by phpBB® Forum Software