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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

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

  




 

 

[ < ] [ > ]   [ << ] [ 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