The below script does what I want, but it seams *wrong* to have two extra lines of regex.

The length of the part before the first `/` can be any length, so I don't suppose I can use `substr()`...

**Question**

Would it be possible to avoid the two extra regex lines and do it in the if-condition?

```
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;

my $a = "tank5/a/b";
my $b = "pool/a/b";

$a = $1 if $a =~ qr{.+?/(.+)};
$b = $1 if $b =~ qr{.+?/(.+)};

if ($a eq $b) {
    print "same\n";
}

```