Rename files

It happens quite often that directories contain files names which are tailored according to some rule, like a common generic part. The following script demonstrates how the names of these files can be changed.

#!/usr/bin/perl -w
#
# searches the current directory for files that are named '*_fzm.fio' and
# renames them to '*_online.fio'.
# 
use strict;
my $temp;
my @files = <*_kzm.fio>;

foreach my $file (@files)
{
    $temp = $file;
    $temp =~ s/_kzm\.fio/_online\.fio/;
    print " renaming $file to $temp \n";
    system( "mv $file $temp"); 
}