NateTut has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; $| = 1; require 'Comm.pl'; use IPC::Open3 qw/open3/; &Comm::init(1.8); my $TimeOut = 30; my $Server = 'Server'; my $User = 'User'; my $Password = 'Password'; my ( $Proc_pty_handle, $Proc_tty_handle, $pid ) = &open_proc( "bteq"); die "open_proc failed" unless $Proc_pty_handle; my ($success, $matched, $before_match, $after_match) = &expect($Proc_p +ty_handle, $TimeOut, 'Enter your logon or BTEQ command:'); die("Time out\n") unless ($success); print(" \$matched \[$matched\] \$before_match\[$before_match\] \$success \[$success\] \$after_match \[$after_match \] "); print $Proc_pty_handle ".logon $Server/$User\n";
$matched [] $before_match[ Teradata BTEQ 08.02.04.00 for UNIX5. Copyright 1984-2006, NCR Corporation. ALL RIGHTS RESERVED. ] $success [Enter your logon or BTEQ command:] $after_match [ ] Can't use string ("proccommutils000001") as a symbol ref while "strict + refs" in use at btp.pl line 25.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comm.pl Help
by gone2015 (Deacon) on Jan 16, 2009 at 01:11 UTC | |
by NateTut (Deacon) on Jan 16, 2009 at 17:01 UTC | |
|
Re: Comm.pl Help
by ikegami (Patriarch) on Jan 15, 2009 at 23:08 UTC | |
|
Re: Comm.pl Help
by sgt (Deacon) on Jan 16, 2009 at 18:04 UTC |