faneesh has asked for the wisdom of the Perl Monks concerning the following question:
HI
I am new to Perl and want to know if there is difference in below declaration
Type 1:
my $filename=sprintf("%s/filename1.log.%s",$file_dir,$todayDate);
Type 2:
my $filename="${file_dir}/filename1.log.${today_date}";
I know both declarations will work, but want to know which is good practice and if there is any reason for the same.
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string concatenation, which way is better?
by trizen (Hermit) on Aug 08, 2012 at 21:27 UTC | |
|
Re: string concatenation, which way is better?
by frozenwithjoy (Priest) on Aug 08, 2012 at 21:39 UTC | |
|
Re: string concatenation, which way is better?
by johngg (Canon) on Aug 08, 2012 at 22:09 UTC | |
|
Re: string concatenation, which way is better?
by BillKSmith (Monsignor) on Aug 09, 2012 at 02:50 UTC | |
|
Re: string concatenation, which way is better?
by Anonymous Monk on Aug 09, 2012 at 00:35 UTC |