Just compiling the sub ref will not produce that warning anyway. The sub ref needs to be actually called by some other code and executed to get an unitialized value warning.
Je suis Charlie.
Comment on Re^2: Use of uninitialized value $var in pattern match (m//)