Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: The beauty that is perl.

by Anonymous Monk
on Apr 04, 2004 at 03:03 UTC ( [id://342396]=note: print w/replies, xml ) Need Help??


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>;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-18 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found