in reply to Delete a line from the file

Surprising that no one mentioned a here document. Get perl to read a script from stdin using a script name of - (hyphen). For example:
perl -n - gash.txt << END # insert fun Perl here print qq(Quote ': double: "); END
You can also quote the label, which quotes the data in the heredoc. Alternatively, ditch the shell and use Perl for everything.