 waz
Member
|
I made this simple tool to sort lines:
Command: %(CYGWIN_ROOT)binperl.exe
Parameters: -we ‘print sort <STDIN>’
Pass my selection to this tool using Standard Input = true
Capture Output? = Replace my selection.
It partly works, but gobbles some (or all) of the lines. I’ve played around with different ways of doing it in Perl, all with the same result. The Perl works as it should when run from a Cygwin shell.
Has anyone seen anything like this before, or can offer a solution? Do you think it’s a PN bug, or have I done something silly?
Versions:
PN v2.0.10.1010-dizzy
Perl5 v10.0 patch 34065 (osname=cygwin, osvers=1.5.25)
|
 waz
Member
|
It works ok if I direct the output to the output window. I do notice a NUL character included with the output — could PN see this NUL character and consider that to be the end of the output?
|
 waz
Member
|
Yay. It was the NUL’s fault. This works:
command: perl.exe
params: -we 'print sort map {s/\0//g; $_} <STDIN>'
|
 simon
Key Master
|
Thanks, I can reproduce this with ActivePerl, I’ll need to work out what’s going on, but I reproduced it with this simple example:
a
b
d
f
e
c
->
a
b
c
With activeperl I had to change the parameters to use double-quotes instead of single.
|