#!/usr/bin/perl -w use strict; open FILEHANDLE , "$filename" or die "cannot open the file : $filename :$!"; my @array = ; foreach ( @array ) { chomp $_; #This Chomp plays an important role here; sleep 1; print "$_"; #But this line does some thing strange. } close FILEHANDLE ;