Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my ( $num, $text ) = unpack( 'A4xA*', $string );
    
    print "[$num][$text]\n";
    
  2. or download this
    [1234][this is the remaining string]
    
  3. or download this
    use strict;
    use warnings;
    ...
                    regex  => sub { $string =~ m[(\d+)\s+(.*)$] },
                    split  => sub { split( /(\d+)\s+/, $string, 2 ) },
                  } );
    
  4. or download this
                Rate  split  regex unpack
    split   789472/s     --   -44%   -70%
    regex  1422218/s    80%     --   -45%
    unpack 2594984/s   229%    82%     --