#!/usr/bin/perl my @files = glob( "$ARGV[0]/*.*" ); for my $file (@files) { open NB_FILE, '<', $file or die "Couldn't open Netbackup file!"; while() { print "Printing line $. from file $file\n"; print $_; } close NB_FILE or die "Couldn't close the file properly!" }