http://www.perlmonks.org?node_id=919930

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

When I run this code, it complains that

"Useless use of reference constructor in void context."

Can someone tell me what is going on?
#!/usr/bin/perl use strict; use warnings; ( my $test ) ? print 'c' : sub { print 'a'; print 'b' }
On the other hand, this works.
#!/usr/bin/perl use strict; use warnings; ( my $test ) ? print 'c' : print_me(); sub print_me { print 'a'; print 'b'; }