abcdefg has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use an executable through my perl script which takes an input file and gives an output file with name output_.$inputfile. I want to check if this file output_.$inputfile already exists and if it already exist then add a numerical suffix as that can be incremented for each run. How can I do that.
$abc_cmd = "abc.exe -i $input_file -o output_$input_file ";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: incrementing the file
by toolic (Bishop) on Feb 21, 2012 at 20:10 UTC | |
Re: incrementing the file
by kcott (Archbishop) on Feb 21, 2012 at 20:25 UTC | |
by abcdefg (Acolyte) on Feb 21, 2012 at 21:10 UTC | |
by oko1 (Deacon) on Feb 22, 2012 at 05:02 UTC | |
Re: incrementing the file
by GrandFather (Saint) on Feb 21, 2012 at 20:20 UTC | |
Re: incrementing the file
by Marshall (Canon) on Feb 22, 2012 at 07:19 UTC | |
Re: incrementing the file
by lune (Pilgrim) on Feb 22, 2012 at 13:06 UTC | |
by nemesdani (Friar) on Feb 22, 2012 at 13:28 UTC |
Back to
Seekers of Perl Wisdom