in reply to PERL $/variable

You really should enable warnings in your code...

Your first example: $/ = m/\d..../;.
What this really means: $/ = ($_ =~ m/\d..../);.
That is: you are first doing a match on $_ with the regex m/\d.../ and then assign the result of the match to $/.

Your second example: $/ == m/\d.../;.
What this really means: my $foo = ($_ =~ m/\d..../);$/ == $foo;.
That is: That is: you are first doing a match on $_ with the regex m/\d.../ and then comparing the result of the match with $/ in a void context. (=> useless comparison)

What you want to do is not possible with $/. $/ has to be a string (or a reference to a integer). It can not be a regex.

What you could do is set $/ to undef; then read from the file and then use: while ($data =~ m/\d.../g) { ... }