Here's the script tweaked to save, delete and restore the reg key:
echo on
reg export HKLM\Software\Classes\.pl saved.reg /y
reg delete HKLM\Software\Classes\.pl /f
assoc .pl=perltest
perl -e"system(qq(ftype perltest=$^X \"%%1\" %%*))"
ftype perltest
mkdir pipe
cd pipe
pipe
perl -e "print 'print qq(| $_) while <>'" > pipe.pl
set pathext=.pl;.com;.exe;.bat;.cmd;
pipe pipe.pl
pipe < pipe.pl
type pipe.pl | pipe
set pathext=.com;.exe;.bat;.cmd;
pipe pipe.pl
pipe < pipe.pl
set pathext=.com;.exe;.bat;.cmd;.pl;
pipe pipe.pl
pipe < pipe.pl
type pipe.pl | pipe
del pipe.pl
cd ..
rmdir pipe
reg delete HKLM\Software\Classes\.pl /f
reg import saved.reg
del saved.reg
And here the results of a run on my system (no difference that I can see):
c:\test>pipetest
c:\test>echo on
c:\test>reg export HKLM\Software\Classes\.pl saved.reg /y
The operation completed successfully.
c:\test>reg delete HKLM\Software\Classes\.pl /f
The operation completed successfully.
c:\test>assoc .pl=perltest
.pl=perltest
c:\test>perl -e"system(qq(ftype perltest=$^X \"%1\" %*))"
perltest=C:\Perl64\bin\perl.exe "%1" %*
c:\test>ftype perltest
perltest=C:\Perl64\bin\perl.exe "%1" %*
c:\test>mkdir pipe
c:\test>cd pipe
c:\test\pipe>pipe
'pipe' is not recognized as an internal or external command,
operable program or batch file.
c:\test\pipe>perl -e "print 'print qq(| $_) while <>'" 1>pipe.pl
c:\test\pipe>set pathext=.pl;.com;.exe;.bat;.cmd;
c:\test\pipe>pipe pipe.pl
| print qq(| $_) while <>
c:\test\pipe>pipe 0<pipe.pl
| print qq(| $_) while <>
c:\test\pipe>type pipe.pl | pipe
| print qq(| $_) while <>
c:\test\pipe>set pathext=.com;.exe;.bat;.cmd;
c:\test\pipe>pipe pipe.pl
'pipe' is not recognized as an internal or external command,
operable program or batch file.
c:\test\pipe>pipe 0<pipe.pl
'pipe' is not recognized as an internal or external command,
operable program or batch file.
c:\test\pipe>set pathext=.com;.exe;.bat;.cmd;.pl;
c:\test\pipe>pipe pipe.pl
| print qq(| $_) while <>
c:\test\pipe>pipe 0<pipe.pl
| print qq(| $_) while <>
c:\test\pipe>type pipe.pl | pipe
| print qq(| $_) while <>
c:\test\pipe>del pipe.pl
c:\test\pipe>cd ..
c:\test>rmdir pipe
c:\test>reg delete HKLM\Software\Classes\.pl /f
The operation completed successfully.
c:\test>reg import saved.reg
The operation completed successfully.
c:\test>del saved.reg
c:\test>
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.