Made changes to perl code and also verified