Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        Regex => '($a=$1, $b=$2, $c=$3, $d=$4) if $myvar   =~ /^([^,]+),([
    +^,]+),([^,]+),([^,]+)$/',
        Split => '@results = split /,/, $myvar'
    });
    
  2. or download this
    Benchmark: timing 1000000 iterations of Regex, Split...
         Regex: 27 wallclock secs (28.06 usr +  0.00 sys = 28.06 CPU)
         Split: 16 wallclock secs (16.19 usr +  0.00 sys = 16.19 CPU)