in reply to Re: Quesion on PAR::Packer
in thread Quesion on PAR::Packer

Hello Alex,

Thanks so much for responding.

1. I did not know that DLL is included in the zip. So I believe that -d switch should remove the dll?

3. Code: Pease see below. The error message is:
Memory Overflow!

#!/user/bin/perl # A perpetual run flag ($PERPETUAL_RUN variable) can be set to "Y" so +that the # script keeps running perpetually until shutdown manually. # IMPORTANT: This script requires the following packages: # Date::Formatter use strict; #use warnings; use Config::IniFiles; use Date::Formatter; use IO::Handle; use Cwd; use Fcntl qw(:flock); use IPC::Run3; # Variables # Configurable: my $PERPETUAL_RUN="N"; my $SLEEP_TIME=30; # In seconds. # Variables from configuration file my $ORA_USER; my $ORA_PWD; my $ORA_SERVER; # Variables from Oracle itself my $ORA_DIR_NAME_PHYSICAL; my $GZIPPER_COMMAND; my $MIMENCODER_COMMAND; # Local and temporary variable my $AMA_DIR; my $AMA_MIME_LOG_FILE; my $WORK_DIR; my $AMA_INI="ama.ini"; my $AMA_SECTION="AMA"; my $AMA_AUTO_SECTION="AMA_AUTO_GENERATED"; my $AMA_MIME_LOCK_FILE="ama_mime_lock.txt"; my $AMA_SUBSYSTEM="MIME"; my $AMA_SMTP_AGENT_SCRIPT="ama_smtp_agent.pl"; my $AMA_MIME_SCRIPT="_temp_mime.pl"; # This script is generated automa +tically. From config parameter. my $CURR_DT = Date::Formatter->now(); my $FHLOCK; my $Config; # Sqlplus variables my @SQLPLUSCMD; my $SQLSTMT; my $SQLOUPUT; my $v1; sub MyEval { my $RET; $RET=`@_`; eval($RET); return 0; } sub PrintLog { my $C_DT; $C_DT=Date::Formatter->now(); $C_DT->createDateFormatter("(YYYY)-(MM)-(DD) (hh):(mm):(ss)"); print $C_DT." ".$_[0]."\n"; return 0; } sub LockActive { PrintLog "Another copy of $0 is already running. Exiting.\n"; exit(1); } sub GetOraConfigParam { my $TEMP1=`perl _get_config_param.pl "$_[0]" "$_[1]"`; if (length($TEMP1) > 1) { $TEMP1=substr($TEMP1,0,length($TEMP1)-1); } return $TEMP1; } sub strReplace { # @PARAM $subject The string that we are operating on. # @PARAM $search String that you want to replace. # @PARAM $replace Replacement string. # @PARAM $count (optional) Limit the number of instances to replace +. my $subject = shift; # the scalar we are +operating on my $search = shift; # what to find my $replace = shift; # what to replace it + with if (! defined $subject) { return -1; } my $count = shift; if (! defined $count) { $count = -1; } # start iterating my ($i,$pos) = (0,0); while ( (my $idx = index( $subject, $search, $pos )) != -1 ) { substr( $subject, $idx, length($search) ) = $replace; $pos=$idx+length($replace); if ($count>0 && ++$i>=$count) { last; } } return $subject; } sub FixFolderName { # Fixes the folder names with backslashes to forward slashes (Windows +platform specific). return (strReplace($_[0],'\\','/')); } # Main code starts here # Set the local variables $CURR_DT->createDateFormatter("(YYYY)(MM)(DD)"); $AMA_DIR=cwd(); $WORK_DIR=$AMA_DIR."/work"; $AMA_MIME_LOG_FILE=$AMA_DIR."/log/mime".$CURR_DT.".txt"; $AMA_MIME_LOCK_FILE=$AMA_DIR."/lock/".$AMA_MIME_LOCK_FILE; $AMA_SMTP_AGENT_SCRIPT=$AMA_DIR."/".$AMA_SMTP_AGENT_SCRIPT; # Make work directory mkdir ($WORK_DIR,"755"); # Make log directory mkdir ($AMA_DIR."/log","755"); # Make lock directory mkdir ($AMA_DIR."/lock","755"); # Open log files in extend mode. open OUTPUT, '>>', $AMA_MIME_LOG_FILE or die $!; open ERROR, '>>', $AMA_MIME_LOG_FILE or die $!; # Redirect the stdout and stderr to log files now. #STDOUT->fdopen( \*OUTPUT, 'w' ) or die $!; STDOUT->autoflush(1); #STDERR->fdopen( \*OUTPUT, 'w' ) or die $!; STDERR->autoflush(1); PrintLog ("AMA session started. Arguments passed ".@ARGV); $Config = new Config::IniFiles( -file => "$AMA_INI", -nocase => 1); $ORA_USER=$Config->val($AMA_SECTION,"ORA_USER"); $ORA_PWD=$Config->val($AMA_SECTION,"ORA_PWD"); $ORA_SERVER=$Config->val($AMA_SECTION,"ORA_SERVER"); $v1="Hello There"; print $v1; open my $pipe_fh, '|-', 'sqlplus.exe -s scott/tiger@butthead' or die "Can't open pipe: $!"; print {$pipe_fh} <<'END_OF_SQL' set echo off set lines 1000 set trims on set serverout on size 999999 set feed off select * from emp; --select * from dept; --exec dbms_output.put_line(\'$v1\'); -- Will not work because variab +les do not expand. exec dbms_output.put_line('Hello There'); exit; END_OF_SQL ; close $pipe_fh; print "End of report.\n"

Ash