[LON-CAPA-users] passing variables by ref in problem

H. K. Ng lon-capa-users@mail.lon-capa.org
Mon, 07 Feb 2005 12:34:25 -0500

Hi Guy,

My mistake - didn't realize that

$eqn0 = &poly_xn([\$d,\$c,\$b,\$a],'x');

is a double ref for variables $d, $c ..


At 11:48 AM 2/7/2005, you wrote:
>Hi Hon-Kie,
> > It seems that when variables are passed to a sub routine by ref, the sub
> > routine cannot de-ref the variables. Is there a way to fix this?
>Works fine for me:
><script type="loncapa/perl">
><startouttext />test value is $test<br /><endouttext />
><script type="loncapa/perl">
>sub change {
>     my ($ref)=@_;
>     $$ref="finished";
><startouttext />test value now is $test<endouttext />
>In what way is it not working for you?
>guy@albertelli.com  LON-CAPA Developer  0-7-3-2-
>LON-CAPA-users mailing list