I have no explanation for you. It is too long ago for me to remember making the post; though I remembered posting the over expanded version, hence referencing it in the new thread.
I didn't think I would have posted it if it didn't work; but I've just tried it on the oldest Perl I have still kicking around -- 5.8.6 -- and get exactly the same compilation errors as I do for my current build; which strongly suggests it never did worked.
This does work:
E:\test>c:\DELL\bin\perl5.8.6.exe -e"BEGIN{ open $fh[$_],'>','split.'.
+$_ for 0..9 }" -nle"print {$fh[substr $_,3,1]} $_" junk.log
E:\test>dir
Volume in drive E is New Volume
Volume Serial Number is 1821-B83A
Directory of E:\test
28/01/2015 02:20 <DIR> .
28/01/2015 02:20 <DIR> ..
28/01/2015 02:13 1,900 junk.log
28/01/2015 02:20 190 split.0
28/01/2015 02:20 190 split.1
28/01/2015 02:20 190 split.2
28/01/2015 02:20 190 split.3
28/01/2015 02:20 190 split.4
28/01/2015 02:20 190 split.5
28/01/2015 02:20 190 split.6
28/01/2015 02:20 190 split.7
28/01/2015 02:20 190 split.8
28/01/2015 02:20 190 split.9
11 File(s) 3,800 bytes
2 Dir(s) 1,624,181,084,160 bytes free
Though as you suggested, using 2 -e's is unnecessary.
My best guess is that I was trying to work around the 70 character code section wrap point when posting; and thought splitting the command into an -e and an -nle would achieve the desired affect; but never actually tried it.
Update:FWIW, IMO, the fact that an -e, that precedes an -nle, gets amalgamated into the latter's loop; is a bug.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
|