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 $
+!";
myconfig_imagetransfer
[TRUNK]
SOURCE_DIR = /home/ad/prod/war
TARGET_DIR = /app/tomcat6/trunkcurrent/webapps
LOG_FILE = '/home/ad/prod/logs/test.log'
Any help in this regard will be appreciated.
Thank you in advance
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.