Tuesday, 8 October 2013

$# in Perl

$#array_name This is one less than the number of elements in the array. If the array just doesn't exist or is empty, $#array_name is -1

difference between single quotes and double quotes in perl

 that single quotes mean that their contents should be takenliterally, while double quotes mean that their contents should be interpreted. For example, the character sequence \n is a newline character when it appears in a string with double quotes, but is literally the two characters, backslash and n, when it appears in single quotes.
    print "This string\nshows up on two lines.";
    print 'This string \n shows up on only one.';
(Two other useful backslash sequences are \t to insert a tab character, and \\ to insert a backslash into a double-quoted string.)