Help with Perl

Hi Techies,

I'm a newbie to PERL, Please help me with following problem.

I have an input text file like below

cat Input.txt

418673132,P
492538858,P
384535478,P
521522357,I
529435679,I
183617024,P
184414408,I
735510689,P
736238343,I
411642045,I
412690979,I
104232783,I
104281821,P
104526020,I
180317526,P
180480531,I

i want the output like below in a seperate text file

cat output.txt

INSERT INTO TMP_TBL value(104526020,'I');
INSERT INTO TMP_TBL value(412690979,'P');
INSERT INTO TMP_TBL value(411642045,'P');

I know its quite simple with Shell Scripting but i specifically want to use PERL (as agreed with Client). Please help me with this.

Thanks in advance.

Regards,
Mahi

#! /usr/bin/perl

use warnings;
use strict;

my @elements;

open I, "< input.txt";
open O, "> output.txt";

while (<I>) {
    chomp;
    @elements = split (',');
    print O "INSERT INTO TMP_TBL value ($elements[0], \'$elements[1]\');\n";
}

close O;
close I;

Perl is 12 tons of overkill for this.

awk -F, "{ printf(\"INSERT INTO TMP_TBL value(%s,'%s');\n\" }" inputfile > outputfile
perl -F, -alne "print \"INSERT INTO TMP_TBL value(\", @F[0], \",'\", @F[1], \"');\"" < inputfile > outputfile
perl -pe 's/(\d+),(\w)/INSERT INTO TMP_TBL value\(\1,\047\2\047\);/' file