I am trying to run some shell (DOS) commands on Win2k Perl 5.8.0 that allow me to call the Oracle Export Utility with some parameters. When I run my script these are the errors I receive
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.
I am a beginner and would appreciate any help.
******************Here is mycode*****************************************
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.