in reply to Executing "perl -pi -e" in perl script

Its documented in perlrun under -i[extension]. Here is an example (based on this)
#!/usr/bin/perl -- use strict; use warnings; use open qw' :std :encoding(UTF-8)'; Main( @ARGV ); exit( 0 ); sub Main { local ( *ARGV, $^I ); @ARGV = @_; $^I = '.orig'; while(<>){ #~ U+2018 (8216), U+2019 (8217) &lsquo; &rsquo; Single quotes +(left and right) #~ U+201C (8220), U+201D (8221) &ldquo; &rdquo; Double quotes +(left and right) #~ U+201B (HTML: &#8219;) – single high-reversed-9, or single reversed + comma, quotation mark (This is sometimes used to show dropped charac +ters at the end of words, such as goin? instead of using goin‘, goin +’, goin`, or goin'[citation needed]) #~ U+201F (HTML: &#8223;) – double high-reversed-9, or double reversed + comma, quotation mark y/\x{2018}\x{2019}\x{201B}\x{201C}\x{201D}\x{201F}/'''"""/; print; } } __END__