You could eval{qr /something/};.
In reply to Re: Test regex compile by pbeckingham in thread Test regex compile by scottb