#!/usr/bin/perl -w use Net::FTP; my $SUBDIR = $ARGV[0]; my $BATCH_ID = $ARGV[1]; my $RDBMS_ID = $ARGV[2]; my $scripttop=$ENV{'SCRIPT_TOP'}; my $dir_path=$ENV{'DIR_PATH'}; #************************************************************************** # Set directories #************************************************************************** $FULL_PATH="$dir_path/$SUBDIR"; $LOG="$FULL_PATH/LOG"; $FTP_FILE="$scripttop/1.log"; $LOG_FILE="$LOG/$BATCH_ID.log"; # open( FILE, "<$FTP_FILE" ) or die "can't open $FTP_FILE: $!"; # Above line Throws error if calling from Oracle , but running fine by direct calling. open FILE, "<$FTP_FILE" || die "Can't open $FTP_FILE: $!"; # Above line does not throw any error if calling from Oracle my @lines = ; # Above line Throws error if calling from Oracle , but running fine by direct calling. close FILE; if (-e $FTP_FILE) # Above line Throws error if calling from Oracle , but running fine by direct calling. { my $temp="1"; } exit 0;