Recent Changes - Search:

Softwares

.

Perl-command-Line

Main.Perl-command-Line History

Hide minor edits - Show changes to output

July 16, 2012, at 03:04 PM by 115.241.32.34 -
Added lines 1-26:
!!Reading from a File

(:Google1:)
----

The -n switch allows you to loop through a file whose name is provided at the command line.

The Perl statements are enclosed in quotes, and the file or files are listed at the end of the command line.

The -e switch allows Perl to execute Perl statements at the command line instead of from a script.

This is a good way to test simple Perl statements before putting them into a script file.

[@
shine@shine:~$ perl -ne 'print if /^shine/ ;' /etc/passwd
shine:x:1000:1000:shine,,,:/home/shine:/bin/bash
shine@shine:~$

shine@shine:~$ perl -e 'print "My name is Shine\n";'
My name is Shine
shine@shine:~$
@]

(:Googletxt:)

(:Googlemm:)
Edit - History - Print - Recent Changes - Search
Page last modified on July 16, 2012, at 03:04 PM