Re: Passing Named Pipe to Function




On Feb 3, 2006, at 5:16 PM, Daniel Davidson wrote:

pipe($mainfractread,$mainfractwrite);
[snip]
sub{updateprogressb(\$mainprogread,\$mainfractread, $mainprogressbar);});
[snip]
*** unhandled exception in callback:
***   Not a GLOB reference at ./gtk.pl line 119.
[snip]
  ioctl($fract, FIONREAD(), $size) or die "Couldn’t call ioctl: $!\n";

You're passing a reference to a reference to a GLOB. The fact that the filehandle is in a scalar means that it is already a reference.

$ perl
pipe ($foo, $bar);
print '$foo is a '.ref ($foo)."\n";
print '\\$foo is a '.ref (\$foo)."\n";
^D
$foo is a GLOB
\$foo is a REF

So, don't put the \ in front of $mainprogread and $mainfractread in the call to updateprogressb().

--
me: Need any help?
elysse, hugging the toilet: No thanks, i can puke just fine by myself.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]