Cool, very useful. :)
Couple suggestions for possible further improvement:
- You should really replace "my $cnt=1;" with "my $cnt=0;". Just test it on an empty file and you'll see it will claim there was one modified line.
- If you'd like, you can move the "pause" from the Batch script to the Perl script (and then get rid off the Batch script). I don't speak Perl, but it will definitely have some way to read input. (Don't forget to write a message such as "Press enter to close this program" before your "pause" command.)
- Was this your second Perl program (after Hello World! :p ), or do you already have some experience (sorry, hard to judge from such a short program)? If you have some experience, you might want to consider using a command line parameter to tell the script which file to work with (again, I don't know Perl, but Googling "perl command line parameter" should do the trick).
At first you can test it by changing the Batch script to
perlid.pl "in.svg"Once that works, you can simply drag any SVG file onto the Perl script and it will be processed!
If, for whatever reason, you really want to keep using the combination of a Batch and a Perl script, you will need to change the Batch script to
perlid.pl "%~f1"to pass the name of the file along. I'm really sorry about the ugly code, but unfortunately that's the correct way to make Windows handle spaces in filenames properly.