change script to perl language