I am a beginner and would appreciate any help.C:\>perl a:\oraexp.pl Prototype mismatch: sub Socket::IPPROTO_TCP () vs none at C:/Perl/lib/Socket.pm line 395. Prototype mismatch: sub Socket::TCP_NODELAY () vs none at C:/Perl/lib/Socket.pm line 395. Scalar found where operator expected at a:\oraexp.pl line 56, near "'\ +\exp ' $CONNECTUSER" (Missing operator before $CONNECTUSER?) <READMORE> String found where operator expected at a:\oraexp.pl line 56, near "$BACKUPDIR ' \samsdb.dmp log='" (Missing operator before ' \samsdb.dmp log='?) Scalar found where operator expected at a:\oraexp.pl line 57, near "'\ +\exp ' $CONNECTUSER" (Missing operator before $CONNECTUSER?) String found where operator expected at a:\oraexp.pl line 57, near "$BACKUPDIR ' \samsdb.dmp log='" (Missing operator before ' \samsdb.dmp log='?) syntax error at a:\oraexp.pl line 56, near "'\\exp ' $CONNECTUSER " syntax error at a:\oraexp.pl line 57, near "'\\exp ' $CONNECTUSER " Execution of a:\oraexp.pl aborted due to compilation errors.
use File::Path; use IPC::Run qw( run ); my($ORAHOME,$ORASID,$CONNECTUSER); $BACKUPDIR = undef; $LOGDIR = undef; $LOGFILE = '\export_samsdb.log'; # :::::::::::::::::::: End Declare Variables Section # :::::::::::::::::::: Begin Parameter Checking Section Start: print "\n What is the Oracle Home path ?"; chomp($ORAHOME = <STDIN>); print "What is the Oracle SID ?"; chomp($ORASID = <STDIN>); print "What is the username\/password ?"; chomp($CONNECTUSER = <STDIN>); if ($ORASID) { # Create backup directories if already not exist unless (-d $BACKUPDIR) { print "Attempting to make BACKUP directory $BACKUPDIR ... +... \n";} eval { (mkpath ($BACKUPDIR='C:\SAMS_DB_BKUP\EXPORT'))}; if ($@) { print "Could not create BACKUP directory: $@ \n"; } else { print "Directory made.\n";} unless (-d $LOGDIR) { print "Attempting to make LOG directory ........ \n";} eval { (mkpath ($LOGDIR='C:\SAMS_DB_BKUP\EXPORT\LOG'))}; + if ($@) { print "Could not create LOG directory: $@ \n"; } else { print "Directory made.\n";} # :::::::::::::::::::: Begin Export Section print $ORAHOME . '\\exp ' $CONNECTUSER . '@samsdb full=Y file=' . $BACKUPDIR ' \samsdb.dmp log=' . $LOGFILE; run $ORAHOME . '\\exp ' $CONNECTUSER . '@samsdb full=Y file=' . $BACKU +PDIR ' \samsdb.dmp log=' . $LOGFILE; open (loghandle, ">>" .$LOGDIR . $LOGFILE) or die "Cannot create log f +ile"; print (loghandle "Export Completed Successfully"); close(loghandle); } else {print '***********Did not define the Oracle SID'; Goto Start;} # :::::::::::::::::::: End Export Section
Edited 2003-03-06 by mirod: added code tags around the error list.
In reply to Using IPC::Run or System by ghosttown
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |