Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^15: The current state of Perl6

by Anonymous Monk
on Jan 28, 2015 at 01:05 UTC ( [id://1114686]=note: print w/replies, xml ) Need Help??


in reply to Re^14: The current state of Perl6
in thread The current state of Perl6

I was going to reply to Re^13: The current state of Perl6 and say Basic debugging checklist, its for you too

But, all the code seems to be inside the LOOP

$ perl -MO=Deparse,-p -e"open $fh[$_],'>','split.'.$_ for 0..9;" -nl +e"print {$fh[substr $_,3,1]} $_" big.log BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined(($_ = <ARGV>))) { chomp($_); open($fh[$_], '>', ('split.' . $_)) foreach (0 .. 9); print({$fh[substr($_, 3, 1)];} $_); } -e syntax OK

I only do one -e and use BEGIN{} blocks for one-time global stuff

Replies are listed 'Best First'.
Re^16: The current state of Perl6 (bug)
by BrowserUk (Patriarch) on Jan 28, 2015 at 02:16 UTC

    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.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1114686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found