Reputation: 997
What is wrong with this code?
I get an error: Useless use of log in void context at ./test.pl line 12.
Useless use of log in void context at ./test.pl line 12.
#!/usr/bin/perl use strict; use warnings; log(); sub log { print "Test"; return; }
Upvotes: 3
Views: 476
Reputation: 62164
log is a built-in Perl function. One way to solve this is to rename your sub:
use strict; use warnings; mylog(); sub mylog { print "Test"; return; }
Upvotes: 7