in reply to Print Vs Return In a Subroutine
As others have said, two very different things.
However, perhaps it's worth mentioning here Capture::Attribute which allows subs to declare that the stuff they print should be returned instead. I wrote it about a month ago as a bit of an experiment, and while it's probably not a great idea for code you actually want to be portable and reliable, it can be quite nice for quick scripts you want to write, run once, and then forget about.
|
|---|