akrrs7 has asked for the wisdom of the Perl Monks concerning the following question:
The expected result for $fileName should be c:/temp/thisItem1_01.txt However, I am getting errors like - string found or bareword found where operator expected. What is the correct syntax for defining $fileName ? Thanks...my $var1 = "thisItem1"; my $var2 = "01"; $ENV{'scriptDir'} = "c:/temp"; my $fileLocn = $ENV{'scriptDir'}; my $fileName = "fileLocn/$var1_$var2.txt";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use scalars to define a filename
by toolic (Bishop) on Oct 17, 2011 at 14:11 UTC | |
by akrrs7 (Acolyte) on Oct 17, 2011 at 14:16 UTC | |
|
Re: Use scalars to define a filename
by Ovid (Cardinal) on Oct 17, 2011 at 14:13 UTC | |
|
Re: Use scalars to define a filename
by ikegami (Patriarch) on Oct 17, 2011 at 14:15 UTC | |
|
Re: Use scalars to define a filename
by Utilitarian (Vicar) on Oct 17, 2011 at 14:13 UTC | |
|
Re: Use scalars to define a filename
by Anonymous Monk on Oct 17, 2011 at 14:06 UTC |