Help for this page

Select Code to Download


  1. or download this
    use List::Util 'first';
    use File::Map 'map_handle';
    open my $fh, '<', 'huge_file';
    map_handle my $map, $fh;
    my $string = first {$_ ~~ @strings} ($map =~ m"^(.*)$"gm);
    
  2. or download this
    use List::MoreUtils 'firstval';
    use File::Map 'map_handle';
    open my $fh, '<', 'huge_file';
    map_handle my $map, $fh;
    my $string = firstval {$_ ~~ @strings} ($map =~ m"^(.*)$"gm);