Closed Bug 662070 Opened 13 years ago Closed 13 years ago

Use say() instead of print() where appropriate

Categories

(Bugzilla :: Bugzilla-General, enhancement)

4.1.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

Till we require Perl 5.10.1 in Bugzilla 5.0, we can already start converting print "$foo\n" into say $foo by implementing say() ourselves in Bugzilla::Util:

sub say {
    print @_;
    print "\n";
}

When writing to a filehandle, we should still use print for now, though, as the function above is a very simple implementation of say(). Once we require 5.10.1, we can remove this function and automatically use the builtin one. Meanwhile, this will let everybody work on it without breaking Bugzilla for those who still use Perl 5.8.x, and if it appears that the next Bugzilla version will be 4.4 instead of 5.0, then we won't have to backout anything (as we said we won't require Perl 5.10.1 if we release 4.4).
Sure, sounds like a reasonable idea. Note:

Should be: 

sub say (@)
Attached patch patch, v1Splinter Review
My regexp didn't catch multiline print() statements, so there are probably some other strings to catch. But this can be done in subsequent bugs (or while writing new code or cleaning up old one).
Assignee: general → LpSolit
Status: NEW → ASSIGNED
Attachment #551320 - Flags: review?(glob)
Comment on attachment 551320 [details] [diff] [review]
patch, v1

r=glob
Attachment #551320 - Flags: review?(glob) → review+
Flags: approval?
Flags: approval? → approval+
Whiteboard: [Good Intro Bug]
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified report.cgi
modified sanitycheck.cgi
modified testserver.pl
modified whineatnews.pl
modified Bugzilla/Chart.pm
modified Bugzilla/DB.pm
modified Bugzilla/Field.pm
modified Bugzilla/Install.pm
modified Bugzilla/Migrate.pm
modified Bugzilla/Util.pm
Committed revision 7936.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: