method2: $item = 'path/path1==new'; my ($epath, $relt) = $item =~ /([^=]*)==(.*)/;