Saturday, May 10, 2008

Perl Basic Program PART II

String matchingOne of the most useful features of Perl (if not the most useful feature) is its powerful string manipulation facilities. At the heart of this is the regular expression (RE) which is shared by many other UNIX utilities. Regular expressionsA regular expression is contained in slashes, and matching occurs with the =~ operator. The following expression is true if the string the appears in variable $sentence. $sentence =~ /the/The RE is case sensitive, so if $sentence = "The quick brown fox";then the above match will be false. The operator !~ is used for spotting a non-match. In the above example $sentence !~ /the/is true because the string the does not appear in $sentence. The $_ special variableWe could use a conditional as if ($sentence =~ /under/){ print "We're talking about...

Perl Basic Program PART I

Here is the basic perl program that we'll use to get started. #!/usr/local/bin/perl## Program to do the obvious#print 'Hello world.'; # Print a messageEach of the parts will be discussed in turn. The first lineEvery perl program starts off with this as its very first line: #!/usr/local/bin/perlalthough this may vary from system to system. This line tells the machine what to do with the file when it is executed (ie it tells it to run the file through Perl). Comments and statementsComments can be inserted into a program with the # symbol, and anything from the # to the end of the line is ignored (with the exception of the first line). The only way to stretch comments over several lines is to use a # on each line. Everything else is a Perl statement which must end with a semicolon, like the...

Thursday, May 8, 2008

TELNET (TELecommunication NETwork)

TELNET (TELecommunication NETwork) is a network protocol used on the Internet or local area network (LAN) connections. It was developed in 1969 beginning with RFC 15 and standardized as IETF STD 8, one of the first Internet standards.The term telnet also refers to software which implements the client part of the protocol. TELNET clients have been available on most Unix systems for many years and are available for virtually all platforms. Most network equipment and OSs with a TCP/IP stack support some kind of TELNET service server for their remote configuration (including ones based on Windows NT). Recently, Secure Shell has begun to dominate remote access for Unix-based machines."To telnet" is also used as a verb meaning to establish or use a TELNET or other interactive TCP connection, as...