in reply to Re: The beauty that is perl.
in thread The beauty that is perl.

Index starting at 0? Very peculiar, sounds like a program discovered this, not a human brain. Perhaps...???

$c = -1; while (<DATA>) { ++$c; print $c, ',', index($_, 'l'), "\n" if index($_, 'l') > -1; } __DATA__ 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 111111111111111111111111111111l111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111 1111111111111111111111111111111111111111

Replies are listed 'Best First'.
Re: The beauty that is perl.
by BrowserUk (Patriarch) on Apr 04, 2004 at 03:14 UTC

    Nope, I counted manually. The only artificial aid was zooming the page to 400% so I could more easily pick out the flat-top of the l versus the pointed top of the 1.

    Why zero-based: This is a programming site:)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail

      Highlight the text, you'll find it instantly.

Re: The beauty that is perl.
by flyingmoose (Priest) on Apr 04, 2004 at 16:32 UTC
    My brain counts from zero. Comp Sci folks often reprogram themselves this way :) I must say, though, "find the small L" is sneaky and evil, I like it.
Re: Re: The beauty that is perl.
by inman (Curate) on Apr 05, 2004 at 15:25 UTC
    Following a more traditional x,y notation having the origin in the bottom left hand corner, the 'l' can be found at position 30,6. Slurp and reverse the data array.

    $/ = ''; my @lines = reverse split /\n/, <DATA>;