perlhp has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am trying to open a read file path from properties file, but I am unable to do that. However, I have tried doing some hard-coded, it works fine.
Error: Could not open file '/home/ad/prod/logs/test.log' No such file or directory at binaryImageTransfer.pl In below code, when I try to use tempVar directly it works. I have also tried printing logFileName. It works
my $config = Config::Tiny->new; $config = Config::Tiny->read('myconfig_imagetransfer'); $logFileName = $config->{TRUNK}->{LOG_FILE}; chomp $logFileName; #my $tempVar = '/home/ad/prod/logs/test.log'; my $tempVar = $logFileName; open($logFile, '>>', $tempVar) or die "Could not open file $tempVar $ +!";
Any help in this regard will be appreciated. Thank you in advancemyconfig_imagetransfer [TRUNK] SOURCE_DIR = /home/ad/prod/war TARGET_DIR = /app/tomcat6/trunkcurrent/webapps LOG_FILE = '/home/ad/prod/logs/test.log'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Files/Properties: Not able to open file from properties file
by Athanasius (Archbishop) on Jan 22, 2014 at 08:43 UTC | |
|
Re: Files/Properties: Not able to open file from properties file
by nithins (Sexton) on Jan 22, 2014 at 07:41 UTC |