my $y = "a big string of something"; if (!$x) { $y =~ s/somebigoldregex/etc/; }