#!/usr/bin/perl
#
# Author: Peter Keel <killer@discordia.ch>
# This will cut off the first two parts of a filename to the second dot.
# This means foo.bar.baz.* will be changed to baz.*
#

die "Usage: $0 filename\n" unless ($ARGV[0]);

chop ( $PWD = `pwd`);
$base_dir = $PWD;

foreach $file_name (@ARGV)
    {
	print STDERR "Processing '$file_name'\n";
        $indice = index $file_name, ".";
	$endice = length $file_name;
	$temp_file = substr $file_name, $indice+1, $endice ;
	$indice = index $temp_file, ".";
	$new_file = substr $temp_file, $indice+1, $endice ;
	# This will give you a new beginning of the name...
	# $new_file = "firstpart".$new_file;
        system ("cp $file_name $new_file");
    }
