in reply to Re^2: search for '\' in perl
in thread search for '\' in perl

I read that page a while ago, threw me off because the $count = (my pattern matching) format didn't seem to work. But apparently, $count = () = pattern match does, cool! I learn something new every day:

use strict; use warnings; open (HANDLE, 'C:\username\Sources') || die; $_ = join '', <HANDLE>; my $c = () = m/\\/g; print "Found $c matches!";

Replies are listed 'Best First'.
Re^4: search for '\' in perl
by Anonymous Monk on Dec 13, 2011 at 14:44 UTC