foreach (@files) { my $choppedstring=$_; substr($choppedstring,0,$length_of_dir)=""; print " Delete this File: $choppedstring \n"; }