/[cvs]/joko/TestArea/perl/runtime/POE/interfaces/perlmodule_subwrapper.pl
ViewVC logotype

Annotation of /joko/TestArea/perl/runtime/POE/interfaces/perlmodule_subwrapper.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sun May 11 21:48:51 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
initial commit

1 joko 1.1 #!/usr/bin/perl
2    
3     #sub POE::Kernel::ASSERT_DEFAULT () { 1 }
4     #sub POE::Kernel::TRACE_DEFAULT () { 1 }
5    
6     use POE qw ( Component::SubWrapper );
7    
8     use Data::Dumper;
9     poeize Data::Dumper;
10    
11     sub _start {
12     my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];
13     print "1. session started", "\n";
14     print "2. posting command to \"Data::Dumper\"", "\n";
15     $kernel->post('Data::Dumper', 'Dumper', [ { a => 1, b => 2 } ], 'callback_handler', 'SCALAR');
16     $kernel->post('Data::Dumper', 'Dumper', [ { a => 1, b => 2 } ], 'callback_handler', 'SCALAR');
17     print "3. doing someting here", "\n";
18     print "4. doing someting here", "\n";
19     }
20    
21     sub callback_handler {
22     my $result = @_[ARG0];
23     # do something with the string returned by Dumper({ a => 1, b => 2})
24     print "2. recieved result: $result", "\n";
25     }
26    
27    
28     #my @handlers = qw( _start got_child_stdout got_child_stderr got_child_close );
29     my @handlers = qw( _start callback_handler );
30     POE::Session->create( package_states => [ main => \@handlers ] );
31     $poe_kernel->run();
32     exit;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed