Bob, I'd love to see POE working on VMS. I bet there's a lot of Unixy code and untested assumptions in there. However, I doubt seriously that anyone on vmsperl can help you with what is basically a POE porting question.
I might recommend that you take your story, complete with background in what you are trying to accomplish, and copy both vmsperl and to the POE discussion list. Information on subscribing to the POE mailing list can be found here: http://poe.perl.org/?POE_Support_Resources/POE's_mailing_list I'm going to go subscribe right away and I might recommend that anyone else who's interested in seeing POE work on VMS do so as well. Together, we might be able to cross this bridge. In case anyone is interested, information on POE can be found here: http://poe.per.org/ POE is really, really, cool. There are all kinds of cool components being written for it. Check out: http://search.cpan.org/search?mode=all&query=POE In general, any large body of Perl code is typically less difficult to port from Unix to VMS or Windows than a C program is, but it's not always plug and play. POE is a fairly large body of code. Jordan Henderson Defense Automatic Addressing System Center WPAFB, OH DSN: 986 3804 Commercial: (937) 656 3804 Instead of getting married again, I think I'll just find a woman I don't like and give her a house. -Steven Seagal > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 2:45 PM > To: [EMAIL PROTECTED] > Subject: FollowTail.pm file::spec > > > All, > > I'm trying to get a simple log monitor to work on Perl 5.8.0 with the > latest POE. The code was based off the > sample log watcher written for FreeBSD. > > /* Code Start > #!/usr/bin/perl > # $Id$ > > use warnings; > use strict; > use POE; > use POE::Wheel::FollowTail; > > my $device = "dka100"; > my $dir = "[rsa.agent.bin]"; > my $file = "check-logs.txt"; > my $msg_file = File::Spec::VMS->catpath( $device, $dir, $file ); > > my %logs_to_watch = > ( msg => $msg_file ); > print %logs_to_watch; > print %logs_to_watch; > POE::Session->create > ( inline_states => > { _start => \&begin_watchers, > > msg_record => \&msg_got_record, > > # Handle log resets and errors the same way for each file. > log_reset => \&generic_log_reset, > log_error => \&generic_log_error, > } > ); > > > sub begin_watchers { > my $heap = $_[HEAP]; > > while ( my ( $service, $log_file ) = each %logs_to_watch ) { > my $log_watcher = POE::Wheel::FollowTail->new > ( Filename => $log_file, > InputEvent => $service . "_record", > ResetEvent => "log_reset", > ErrorEvent => "log_error", > ); > > $heap->{services}->{ $log_watcher->ID } = $service; > $heap->{watchers}->{ $log_watcher->ID } = $log_watcher; > } > } > > sub msg_got_record { > my $log_record = $_[ARG0]; > print $log_record, "\n"; > } > > # Handle log resets the same way for each file. Simply recognize that > # the log file was reset. > > sub generic_log_reset { > my ( $heap, $wheel_id ) = @_[ HEAP, ARG0 ]; > > my $service = $heap->{services}->{$wheel_id}; > print "--- $service log reset at ", scalar(gmtime), " GMT\n"; > } > > # Handle log errors the same way for each file. Recognize that an > # error occurred while watching the file, and shut the watcher down. > # If this were a real log watcher, it would periodically try to resume > # watching the log file. > > sub generic_log_error { > my ( $heap, $operation, $errno, $error_string, $wheel_id ) = > @_[ HEAP, ARG0, ARG1, ARG2, ARG3 ]; > > my $service = $heap->{services}->{$wheel_id}; > print "--- $service log $operation error $errno: $error_string\n"; > print "--- Shutting down $service log watcher.\n"; > > delete $heap->{services}->{$wheel_id}; > delete $heap->{watchers}->{$wheel_id}; > } > */ Code End > > > Error message is: > > kite_hab15$ perl simple_log.pl > msgdka100:[rsa.agent.bin]check-logs.txthandle= GLOB(0x814c2c) > filename= dka100:[rsa.agent.bin]check-logs.txt > fcntl(GLOB(0x814c2c), F_GETFL, etc.) fails: invalid argument > at /perl_root/lib/site_perl/POE/Wheel/FollowTail.pm line 136 > POE::Kernel's run() method was never called. > %SYSTEM-F-ABORT, abort > > TIA, > Bob Safran > 425.739.3228 > ALSTOM's T&D Energy Automation & Information Business > > CONFIDENTIALITY: This e-mail and any attachments are > confidential and may > be privileged. If you are not a named recipient, please > notify the sender > immediately and do not disclose the contents to another > person, use it for > any purpose or store or copy the information in any medium. > >
