perl script to remove the extension from its name

There are few files in my windows directory and I need a perl script to rename the files to its original names i.e., the last extension(.orig) needs to be removed programatically,

files in directory

data1.htm.orig
data2.htm.orig
data3.htm.orig

to be renamed to

data1.htm
data2.htm
data3.htm

You should check the perl manual first.

Ok balaje...

What the logic I am applying is splitting each file into a array(now array consists with 3 elements) and then concatenating the first elements from array.

For eg.
data1.htm.orig

@arr = split(/\./,$file1);        ## here 3 elements will be splitted
$new_file = $arr[0].$arr[1];   ## new_file becomes data1.htm

Could you please correct if I am wrong and guide me in right direction?

Looks correct so far, yes.

you can simply strip out the .orig from the variable

$ perl a.pl
data1.htm

$ cat a.pl
#!/usr/bin/perl

$filename="data1.htm.orig";
$origname=$filename;
$filename=~s/.orig//;
print $filename , "\n";