print () operator print operator in Perl is used to print the values of the expressions in a List passed to it as an argument. These functions can display anything passed to them as arguments. This sign is called dollar It's a multiline string I want to print. ![]() The output I get from this command on my Windows PC looks like this: C:/Perl/lib C:/Perl/site/lib. So, for each of the keys in the hash (sorted in alphanumeric order), you would print the key name, followed by a space and a tab, followed by the contents of the arrayref (tab-separated) which is the has value for that key, followed by newline.Į.g. To display this evaluated expression, Perl uses print () function and say () function. /perl/bin/perl print <<EOF This sign is called dollar It's a multiline string EOF This is giving me result. Here's a simple way to print your Perl include path from the command line: perl -e 'print qq (INC)' You can just run that command from the Unix/Linux or DOS command line. ' Notice that you need to supply the newline character at the end of your string. ![]() ![]() As a simple example, you can print a string literal using the Perl print function, like this: print 'Hello, world. printf can be used to create a formatted print to the screen. The following code demonstrates how to print integers with Perl, using the printf function. It's a foreach loop expressed via a postfix modifyer, which is equivalent to the following regular loop: foreach (sort keys %hash) and make it into a real array, and join("\t", takes that array and puts it in a tab-separated string. The Perl print function Generally you'll print simple output with the Perl print function.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |