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
Answertopia.com

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

  




 

 

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

2.5 Output of Scalar Data

To output a scalar, you can use the print and printf built-in functions. We have already seen examples of the print command, and the printf command is very close to that in C or C++. Here are a few examples:

use strict; my $str = "Howdy, "; my $name = "Joe.\n"; print $str, $name; # Prints out: Howdy, Joe.<NEWLINE> my $f = 3e-1; printf "%2.3f\n", $f; # Prints out: 0.300<NEWLINE>




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