in reply to Re^2: Easy find and replace loop. HELP!
in thread Find and replace by five character string

Here's one way to do your search and replace. I suggest you look into each element of why this works. Opening the file and looping through the lines should be simple enough (there are many tutorials on that). Note that this one will treat upper and lower case characters the same

Try this example:
#!/usr/bin/perl use strict; use warnings; my $string = "ABC0000K0000T12345"; $string =~ s/0000([J-U])/my $x=ord(uc($1))-ord('I');('0'x(4-length($x) +)).'-'.$x/ige; print $string, "\n";


Update (added links)

s///
ord
length

tutorial on open