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_pty_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.