#!/usr/bin/env perl # removes the extension from a filename use strict; use warnings; use File::Basename; use File::Spec; foreach (@ARGV) { my ( $name, $path, $suffix ) = fileparse( $_, qr/\.[^.]*/ ); print File::Spec->join( $path, $name ) . "\n"; }