Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Finding length of line if have any position of any char inside line

by rjt (Curate)
on Oct 10, 2019 at 12:50 UTC ( [id://11107304]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @tests = (
        # $string, $pos, $expected, $description
        [ "\nString\n", 2, 6, 'Surrounded' ],
    ...
        [ "String",     2, 6, 'No \n' ],
        [ "",           0, 0, 'Blank' ],
    );
    
  2. or download this
                    Rate     op_ver      daxim    rlindex cur_strlen
    op_ver      564186/s         --       -23%       -66%       -86%
    daxim       737063/s        31%         --       -56%       -81% <-- H
    +ERE
    rlindex    1677856/s       197%       128%         --       -57%
    cur_strlen 3932672/s       597%       434%       134%         --
    
  3. or download this
    not ok 1 - daxim: Surrounded
    #   Failed test 'daxim: Surrounded'
    #   at /home/ryan/src/perlmonks/subline.pl line 37.
    ...
    Use of uninitialized value $prev in subtraction (-) at /home/ryan/src/
    +perlmonks/subline.pl line 64.
    Use of uninitialized value $next in subtraction (-) at /home/ryan/src/
    +perlmonks/subline.pl line 64.
    ok 5 - daxim: Blank
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-16 05:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found