Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: incrementing the file

by toolic (Bishop)
on Feb 21, 2012 at 20:10 UTC ( #955378=note: print w/replies, xml ) Need Help??


in reply to incrementing the file

You could use a file test like -e in a while loop:
my $output_file = "output_$input_file"; my $i = 1; while (-e $output_file) { $output_file = "output_$input_file$i"; $i++; } $abc_cmd = "abc.exe -i $input_file -o $output_file ";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://955378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-08-13 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?