Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 Returning Values

Perhaps we did not want our new subroutine to actually print the message. Instead, we would like it to return the string of the message, and then we will call print on it.

This is very easy to do with the return statement.

use strict; sub HowdyEveryone { return "Hello everyone.\nWhere do you want to go with Perl today?\n"; } print &HowdyEveryone;

  Published under the terms of the GNU General Public License Design by Interspire