in reply to Re^3: open file error
in thread open file error

oh i got it ... i should have read chomp properly, i used a regex to trim the spaces from both ends of any string

$logfile =~ s/^\s+|\s+$//g;

and now it's working. Sorry for the not so intelligent answer above :P please don't down vote that :) Thanks