I like bart's (edited to correct name) solution except you may want to add a prototype so you can call the sub without parentheses around the arguments.
#!/usr/bin/perl
use strict;
use warnings;
use 5.008;
sub say (@){
local $\ = "\n";
print @_ ? @_ : $_;
}
say 'Hey';
>>>Update>>>: On further testing, I guess you don't need a prototype. The trick is to define the sub above the statement where you call it. The following works just as well for me:
#!/usr/bin/perl
use strict;
use warnings;
use 5.008;
sub say{
local $\ = "\n";
print @_ ? @_ : $_;
}
say 'Hey';