Passing Named Pipe to Function



I figured someone here would know, so here goes.  I am trying to
simplify my progress bars by making a single function that would handle
them.  Here is what I am trying to do:

pipe($mainfractread,$mainfractwrite);
pipe($mainprogread,$mainprogwrite);

.
.
.

$mainprogresstab = Gtk2::Helper->add_watch(fileno($mainprogwrite), 'in',
sub{updateprogressb(\$mainprogread,\$mainfractread,$mainprogressbar);});

However when the updateprogressb function runs, it dies because it seems
I am not referencing it correctly.  The perl error is:

*** unhandled exception in callback:
***   Not a GLOB reference at ./gtk.pl line 119.

Other relevant lines of code before the error in the updateprogressb
function are:
  my ($prog,$fract,$progressbar) = @_;
  my $size = pack("L", 0);
  ioctl($fract, FIONREAD(), $size) or die "Couldnât call ioctl: $!\n";

So how do I pass these?

thanks,

Dan




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