Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: split string at variable position with matching

by AnomalousMonk (Archbishop)
on Sep 12, 2021 at 02:28 UTC ( [id://11136673]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub split_before {
        my ($string, $pos) = @_;
        my $pos = rindex $string, '*', 30;
        split /(?<=^.{$pos}\*) /, $string, 2
    }
    
  2. or download this
    Win8 Strawberry 5.30.3.1 (64)  Sat 09/11/2021 21:56:27
    C:\@Work\Perl\monks
    ...
    ok 11 - 28 split invalid
    ok 12 - 55 split invalid
    1..12
    

Log In?
Username:
Password:

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

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

    No recent polls found