The same piece of code works fine on Windows Env, but doesn't work on unix env (Solaris)
Can someone help as to why the filehandle give me a error.
This is the error i get "Bad symbol for filehandle"
# initialization
$Migrator::ERRORLOG_FILE_NAME = "$Migrator::BASE_DIR/migration/dyn/logfiles/sync_channel/synchannelsDB_error.log";
sub logerror{
my $t = time;
my $str = "[" . localtime(time) . "] ";
my $logdata = shift;
# this is where i get the error
error line: select($Migrator::ERRORLOG_FILE_HANDLE);
$| = 1;
if($Migrator::LOGGING){
print $Migrator::ERRORLOG_FILE_HANDLE $str . $logdata . "\n"
}
select(STDOUT);
$| = 1;
}
sub startLogging{
open(ERROR, ">>$Migrator::ERRORLOG_FILE_NAME"
or die "Couldn't open log $Migrator::ERRORLOG_FILE_NAME $!";
#$Migrator::LOGGING = 0;
if($Migrator::LOGGING){
$Migrator::ERRORLOG_FILE_HANDLE = *ERROR;
}
}
sub stopLogging{
if($Migrator::LOGGING){
close($Migrator::ERRORLOG_FILE_HANDLE);
}
}
mir...
Can someone help as to why the filehandle give me a error.
This is the error i get "Bad symbol for filehandle"
# initialization
$Migrator::ERRORLOG_FILE_NAME = "$Migrator::BASE_DIR/migration/dyn/logfiles/sync_channel/synchannelsDB_error.log";
sub logerror{
my $t = time;
my $str = "[" . localtime(time) . "] ";
my $logdata = shift;
# this is where i get the error
error line: select($Migrator::ERRORLOG_FILE_HANDLE);
$| = 1;
if($Migrator::LOGGING){
print $Migrator::ERRORLOG_FILE_HANDLE $str . $logdata . "\n"
}
select(STDOUT);
$| = 1;
}
sub startLogging{
open(ERROR, ">>$Migrator::ERRORLOG_FILE_NAME"
#$Migrator::LOGGING = 0;
if($Migrator::LOGGING){
$Migrator::ERRORLOG_FILE_HANDLE = *ERROR;
}
}
sub stopLogging{
if($Migrator::LOGGING){
close($Migrator::ERRORLOG_FILE_HANDLE);
}
}
mir...