This article provides some sample scripts for automating Surfer with Perl.
The script grid_data_create_contours.pl grids some data and creates a contour map. In the script, the grid file is saved to the Program Files directory, so you either have to have permission to write to this folder, or you can simply change the folder location.
You are welcome to see if these examples help you. We do not officially support writing scripts in Perl so we cannot help with modifications of this scripts.
Updated October 9, 2017