Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: index using a range

by choroba (Bishop)
on Jun 13, 2013 at 23:07 UTC ( #1038857=note: print w/replies, xml ) Need Help??


in reply to index using a range

A bit cryptic, but without the need of $1:
my $str = '000001'; my $index = length(($str =~ /^(0*)/)[0]);
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1038857]
help
Chatterbox?
[Eily]: remember kids, the "first" step™ to avoid this """kind""" of issues is to not write bad code in the first place™
[erix]: but what will we eat tomorrow?
[Eily]: Zavináč and Chiocciola until we reach sigil invariance

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-11-24 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (349 votes). Check out past polls.

    Notices?