Monday, 9 September 2013

how to put two variables together

how to put two variables together

Noob question. I'm checking if a file exists in perl, but I'm not sure how
to put two variables together when I have a sourceFile predetermined, and
a path that must be passed in as argument. In other words, how do I concat
an argument passed in with another variables so that I could use perl's
file test -X function?
$sourceFile = 'somefile';
if ( $ARGV[0] && -e ($ARGV[0] + '\' + $sourceFile) )
I've also tried:
if ( $ARGV[0] && -e ($ARGV[0]\\$sourceFile) )

No comments:

Post a Comment