I wouldn't use Perl for something so trivial - that's easily done in a shell one-liner. I'll give a shell (bash) solution, porting it to Perl is left as an exercise for the reader. Assume the names of the two files are in variables
$FILE1 and
$FILE2.
sort -n -k1,1 <(nl -ba -i2 -v1 $FILE1) <(nl -ba -i20 -v0 $FILE2) | c
+ut -f2-