f



Re: Can't locate object method "OPEN" via package "Tk::Event::IO"

I answered my own question.  I needed to undefine the callback near the
close of the filehandle.
eg
    close $fh;
    $mw->fileevent( $fh, 'readable', '' );

----- Original Message ----- 
From: "Tim Harsch" <harsch1@llnl.gov>
To: "PTK" <ptk@lists.stanford.edu>
Sent: Thursday, August 21, 2003 5:48 PM
Subject: Can't locate object method "OPEN" via package "Tk::Event::IO"


> I'm trying to set up a basic queue of processes to run.  Here is an
example
> where I create 4 sleep jobs, submit NUM_PROCS many as pipe opens to start,
> and want fileevent to open any remaining jobs when a job is finished.
Below
> this script is my error output.  Anyone know why the open command inside
> command_ready isn't working?
>
>  #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Tk;
>
> use constant NUM_PROCS => 2;
> use constant DIR => "C:\\Documents and Settings\\Tim
> Harsch.BBRP2000\\Desktop\\Array-Image-Store\\SlideArray\\t";
> my $mw = MainWindow->new();
> $mw->Button( -text => 'Cancel',
>              -command => sub { exit }
>             )->pack();
>
> my @cmds = ( "perl -e \"sleep 2; print 'DONE'\" " ) x 4;
>
> if( $#cmds > 0 ) {
>     my $cmd = pop @cmds;
>     for( my $i = 0; $i < &NUM_PROCS; $i++ ) {
>         my $fh;
>         open $fh, "$cmd |" or die "Could not open command \"$cmd\" ";
>         $mw->fileevent( $fh, 'readable', [ \&command_ready, $mw, $fh ] );
>     } # end for
> }
>
> sub command_ready {
>     my $mw = shift;
>     my $fh = shift;
>
>     warn ref( $fh );
>     print <$fh>;
>     close $fh;
>
>     my $cmd = pop @cmds;
>     print "Executing cmd $cmd\n";
>
>     open $fh, "$cmd |" or die "Could not open command \"$cmd\" ";
>     $mw->fileevent( $fh, 'readable', [ \&command_ready, $mw, $fh ] );
> }
>
> MainLoop;
> __END__
>
> GLOB at C:\Documents and Settings\Tim
> Harsch.BBRP2000\Desktop\Array-Image-Store\SlideArray\test_mult_procs.pl
line
> 30.
> Can't locate object method "OPEN" via package "Tk::Event::IO" at
> C:\Documents and Settings\Tim
> Harsch.BBRP2000\Desktop\Array-Image-Store\SlideArray\test_mult_procs.pl
line
> 37.
> DONEExecuting cmd perl -e "sleep 2; print 'DONE'"
>

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
Tim
8/22/2003 3:07:21 AM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
430 Views

Similar Articles

[PageSpeed] 20

Reply:

Similar Artilces:

Can't locate object method "OPEN" via package "Tk::Event::IO"
I'm trying to set up a basic queue of processes to run. Here is an example where I create 4 sleep jobs, submit NUM_PROCS many as pipe opens to start, and want fileevent to open any remaining jobs when a job is finished. Below this script is my error output. Anyone know why the open command inside command_ready isn't working? #!/usr/bin/perl use strict; use warnings; use Tk; use constant NUM_PROCS => 2; use constant DIR => "C:\\Documents and Settings\\Tim Harsch.BBRP2000\\Desktop\\Array-Image-Store\\SlideArray\\t"; my $mw = MainWindow->new(); $m...

"Can't locate object method "PV" via package "B::SPECIAL""
When I try to use B::Lint I get the error Can't locate object method "PV" via package "B::SPECIAL"" Does anyone know where B::SPECIAL is defined? TIA, kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. On Oct 20, 5:53 am, kj <so...@987jk.com.invalid> wrote: > When I try to use B::Lint I get the error > > Can't locate object method "PV" via package "B::SPECIAL"" > > Does anyone know where B::SPECIAL is defined? &...

Can't locate object method "blocking" via package "IO::Handle"
I am receiving the error message: Can't locate object method "blocking" via package "IO::Handle" at /usr/opt/perl5/lib/site_perl/5.8.0/Net/SSH/Perl.pm line 212, <GEN0> line 1. Here is a program that demonstrates the error: #!/usr/bin/perl use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("<your hostname>"); $ssh->login("username", "xxxxxxxx"); my $command = "date"; my ($out, $err, $rc) = $ssh->cmd($command); print "out: $out\n"; print "err: $err\n"; print "rc: $rc\n"; Her...

Can't locate object method "first" via package "attempt" (perhaps you forgot to load "attempt"?) at ....
"Can't locate object method "first" via package "attempt" (perhaps you forgot to load "attempt"?) at E:\Inetpub\....\N_Clt_prf.pl line 38."I get this error on a perl program that prints & processed a form.Program was working until I made a simple (cosmetic) change. Could not find any reference to this error.Could anyone our there help?Thanks. "GMI" <Admin@GoMonitor.com> wrote in news:11bbgp4iovmsdb@corp.supernews.com: > "Can't locate object method "first" via package "attempt" (perhaps you >...

Can't locate object method "connect" via package "DBI"
Hi, I have DBI 1.45, Apache 2.052 Win32, mod_perl 1.99_17, Perl 5.84. I am very sure that @INC contains the right path, and simple DBI stuff can run on the command-line. Any comments are highly appreciated. #error.log [error] Can't locate object method "bootstrap" via package "DBI" at F:/Net/Perl/site/lib/DBI.pm line 249. BEGIN failed--compilation aborted at F:/Net/Perl/site/lib/DBI.pm line 256. Compilation failed in require at (eval 7) line 8. BEGIN failed--compilation aborted at (eval 7) line 8. #!F:/Net/Perl/bin/Perl.exe ## ## Perl eg use strict...

Can't locate object method "new" via package "Net::SMTP"
I'm attempting to use the line: $smtp = Net::SMTP->new("mailhost.myisp.co.uk"); however it generates the error message: Can't locate object method "new" via package "Net::SMTP" Any advice on how to locate the cause of the error? MTIA -- bof at bof dot me dot uk bof wrote: > > I'm attempting to use the line: > $smtp = Net::SMTP->new("mailhost.myisp.co.uk"); > > however it generates the error message: > Can't locate object method "new" via package "Net::SMTP" Did you load the Net::S...

Can't locate object method "host" via package "URI::_foreign"
Hi, Here is the complete error message: Can't locate object method "host" via package "URI::_foreign" at PERL2EXE_STORAG E/Net/SDEE/Session.pm line 108. I get this error when I run ssss.exe file. My ssss.pl file works fine, this error pops up after I convert ssss.pl file to ssss.exe file using perl2exe utility. I am not sure what is wrong here. Any help will be greatly appreciated. Thanks. vkinger@hotmail.com wrote: >Can't locate object method "host" via package "URI::_foreign" at >PERL2EXE_STORAG >E/Net/SDEE/Session.pm line 108. ...

Can't locate object method "newFromJpeg" via package "GD::Image"
Hi. I'm trying to execute this Perl simple script: -------- #!/usr/bin/perl use GD; my $srcimage = GD::Image->newFromJpeg("image_news.jpg"); my ($srcW,$srcH) = $srcimage->getBounds(); --------- But I get this error message: ------- Can't locate object method "newFromJpeg" via package "GD::Image" at ../test.pl line 3. ------- I've got GD and libgd compiled with JPEG support turned on. 1) JPEG libs + Downloaded from http://www.ijg.org/files/jpegsrc.v6b.tar.gz + mkdir /usr/local/jpeg-6b + mkdir /usr/local/jpeg-6b/bin + mkdir /usr/local/...

Can't locate object method "requirements_for_module" via package "CPAN::Meta::Requirements"
Hi Everyone, I'm blocked from installing modules by this problem: Can't locate object method "requirements_for_module" via package "CPAN::Met= a::Requirements" at /usr/lib/perl5/5.8.8/CPAN/Distribution.pm line 2802. The command I had run was cpan -if Business::ISBN I've taken a look at a closely related thread: https://groups.google.com/fo= rum/#!topic/perl.perl5.porters/GmmtAoaHhbc . It seems to me that the solut= ion was to uninstall and reinstall perl. Have I read that correctly, and/o= r can anyone give me other guidance out of this proble...

Tk::Browser, "Can't locate object method 'Construct'"
Using perl 5.10, I'm trying to run the Tk::Browser.pm SYNOPSIS example. I get a "Can't locate object method "Construct" via package "Tk::Widget" " error. In more detail --- use strict; use warnings; use Tk::Browser; my $b = new Browser; __END__ gets --- Can't locate object method "Construct" via package "Tk::Widget" at C:/Perl/site/lib/Tk/Frame.pm line 13. Compilation failed in require at (eval 15) line 3. ...propagated at C:/Perl/lib/base.pm line 93. --- etc The "Construct" that can't be located for Tk::W...

Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
"Hi, I am trying to to learn PERL, I am using it for an Automation Tool, Selenium RC. My target is to open google. If the operation is successful, I will open an existing excel sheet and write PASS, if it fails, It will write Fail. I have installed the required library. The code is as follows:- -------------- use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More "no_plan"; use Test::Exception; use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; print "\...

Can't locate object method "ymd" via package...
Hi! I've installed DateTime and DateTime::Format::MySQL via CPAN and I get a strange error message executing this code: #!/usr/bin/perl -w use strict; use DateTime; use DateTime::Format::MySQL; my $str = "2007-08-03"; my $mySQLdate = DateTime::Format::MySQL->new; my $parsed = DateTime::Format::MySQL->format_date($mySQLdate); The error message I get is: Can't locate object method "ymd" via package "DateTime::Format::MySQL" at /usr/lib/perl5/site_perl/5.8.8/DateTime/Format/MySQL.pm line 84. Does anybody knows why I get this error messa...

Can't locate object method "new" via package
Hi all, I am finding an issue in perl v5.10.1. I am getting the following issue. I have added the path in @INC in my script. Error : Can't locate object method "new" via package Can anybody help me in this regard? Regards Pradeep # try use strict; use warnings; use FindBin; use lib $FindBin::Bin; use MyModule; .... smilesonisamal@gmail.com wrote: >Hi all, > I am finding an issue in perl v5.10.1. I am getting the following issue. >I have added the path in @INC in my script. > >Error : Can't locate object method &qu...

""""""""""""""""""""""ADD ME""""""""""""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfo Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... We look forward to build a ve...

Web resources about - Re: Can't locate object method "OPEN" via package "Tk::Event::IO" - comp.lang.perl.tk

Resources last updated: 2/8/2016 9:52:52 PM