Help for this page

Select Code to Download


  1. or download this
    while (<FILE>) {
        $count += () = /\Q$constant\E/g;
    }
    print "$constant occurs $count times\n";
    
  2. or download this
    use File::Slurp;
    my $constant = '$_';
    $_ = read_file('filename.pl');
    $count = () = /\Q$constant\E/g;
    print "$constant occurs $count times\n";