:::::::::::::: datebook.master :::::::::::::: Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA 83755:11/12/56:20300 Igor Chevsky:385-375-8395:3567 Populus Place, Caldwell, NJ 23875:6/18/68:23400 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700 Jennifer Cowan:548-834-2348:583 Laurel Ave., Kingsville, TX 83745:10/1/35:58900 Jon DeLoach:408-253-3122:123 Park St., San Jose, CA 04086:7/25/53:85100 Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500 XXX Evich:284-758-2857:23 Edgecliff Place, Lincoln, NB 92086:7/25/53:85100 XXX Evich:284-758-2867:23 Edgecliff Place, Lincoln, NB 92743:11/3/35:58200 Fred Fardbarkle:674-843-1385:20 Parak Lane, DeLuth, MN 23850:4/12/23:780900 Fred Fardbarkle:674-843-1385:20 Parak Lane, DeLuth, MN 23850:4/12/23:780900 Lori Gortz:327-832-5728:3465 Mirlo Street, Peabody, MA 34756:10/2/65:35200 Paco Gutierrez:835-365-1284:454 Easy Street, Decatur, IL 75732:2/28/53:123500 XXX Evich:284-758-2867:23 Edgecliff Place, Lincoln, NB 92743:11/3/35:58200 Ephram Hardy:293-259-5395:235 CarltonLane, Joliet, IL 73858:8/12/20:56700 Barbara Kertz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/1/46:268500 James Ikeda:834-938-8376:23445 Aster Ave., Allentown, NJ 83745:12/1/38:45000 Lesley Kirstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62:52600 William Kopf:846-836-2837:6937 Ware Road, Milton, PA 93756:9/21/46:43500 Jesse Neal:408-233-8971:45 Rose Terrace, San Francisco, CA 92303:2/3/36:25000 Zippy Pinhead:834-823-8319:2356 Bizarro Ave., Farmount, IL 84357:1/1/67:89500 Arthur Putie:923-835-8745:23 Wimp Lane, Kensington, DL 38758:8/31/69:126000 Popeye Sailor:156-454-3322:945 Bluto Street, Anywhere, USA 29358:3/19/35:22350 Jose Santiago:385-898-8357:38 Fife Way, Abilene, TX 39673:1/5/58:95600 Sir Lancelot:837-835-8257:474 Camelot Boulevard, Bath, WY 28356:5/13/69:24500 Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale, CA 94087:5/19/66:34200 Yukio Takeshida:387-827-1095:13 Uno Lane, Ashville, NC 23556:7/1/29:57000 Vinh Tranh:438-910-7449:8235 Maple Street, Wilmington, VM 29085:9/23/63:68900 :::::::::::::: emp.names :::::::::::::: Steve Blenheim Betty Boop Igor Chevsky Norma Cord Jon DeLoach Karen Evich :::::::::::::: emp.names2 :::::::::::::: 1 Steve Blenheim 2 Betty Boop 3 Igor Chevsky 4 Norma Cord 5 Jon DeLoach 6 Karen Evich :::::::::::::: example1 :::::::::::::: #! /usr/bin/perl # Scalar, array, and hash assignment $salary=50000;#Scalar assignment @months=('Mar', 'Apr', 'May'); # Array assignment %states= (# Hash assignment CA => 'California', ME => 'Maine', MT => 'Montana', NM => 'New Mexico', ); print "$salary\n"; print "@months\n"; print "$months[0], $months[1], $months[2]\n"; print "$states{CA}, $states{NM}\n"; print $x + 3, "\n";# $x just came to life! print "***$name***\n";# $name is born! :::::::::::::: example10 :::::::::::::: #! /usr/bin/perl $name="Tommy"; undef $name; print "OK \n" if defined $name; :::::::::::::: example11 :::::::::::::: #! /bin/sh perl -ne 'print' emp.names echo perl -ne 'print $_' emp.names :::::::::::::: example12 :::::::::::::: #! /usr/bin/perl @name=("Guy", "Tom", "Dan", "Roy"); @list=(2..10); @grades=(100, 90, 65, 96, 40, 75); @items=($a, $b, $c); @empty=(); $size=@items; @mammals = qw/dogs cats cows/; @fruit = qw(apples pears peaches); :::::::::::::: example13 :::::::::::::: #! /usr/bin/perl $indexsize=$#grades; $#grades=3; $#grades=$[ - 1; @grades=(); :::::::::::::: example14 :::::::::::::: #! /usr/bin/perl @digits=(0 .. 10); @letters=( 'A' .. 'Z' ); @alpha=( 'A' .. 'Z', 'a' .. 'z' ); @n=( -5 .. 20 ); :::::::::::::: example15 :::::::::::::: #! /usr/bin/perl # Populating an array and printing its values @names=('John', 'Joe', 'Jake'); # @names=qw/John Joe Jake/; print @names, "\n"; # prints without the separator print "Hi $names[0], $names[1], and $names[2]!\n"; $number=@names; # The scalar is assigned the number # of elements in the array print "There are $number elements in the \@names array.\n"; print "The last element of the array is $names[$number - 1].\n"; print "The last element of the array is $names[$#names].\n"; # Remember, the array index starts at zero!! @fruit = qw(apples pears peaches plums); print "The first element of the \@fruit array is $fruit[0]; the second element is $fruit[1].\n"; print "Starting at the end of the array: @fruit[-1, -3]\n"; :::::::::::::: example16 :::::::::::::: #! /usr/bin/perl # Array slices @names=('Tom', 'Dick', 'Harry', 'Pete' ); @pal=@names[1,2,3]; # slice -- @names[1..3] also O.K. print "@pal\n\n"; ($friend[0], $friend[1], $friend[2])=@names; # Array slice print "@friend\n"; :::::::::::::: example17 :::::::::::::: #! /usr/bin/perl # Array slices @colors=('red','green','yellow','orange'); ($c[0], $c[1],$c[3], $c[5])=@colors; # The slice print "**********\n"; print @colors,"\n"; # prints entire array, but does # not separate elements print "@colors,\n"; # quoted, prints the entire array with # elements separated print "**********\n"; print $c[0]."\n"; # red print $c[1],"\n"; # green print $c[2],"\n"; # undefined print $c[3],"\n"; # yellow print $c[4],"\n"; # undefined print $c[5],"\n"; # orange print "**********\n" ; print "The size of the \@c array is ", $#c + 1,".\n"; :::::::::::::: example18 :::::::::::::: #! /usr/bin/perl # A two-dimensional array consisting of 4 rows and 3 columns. @matrix=( [ 3 , 4, 10 ], # Each row is an unnamed list [ 2, 7, 12 ], [ 0, 3, 4 ], [ 6, 5, 9 ], ) ; print "@matrix\n"; print "Row 0, column 0 is $matrix[0][0].\n"; # can also be written - $matrix[0]->[0] print "Row 1, column 0 is $matrix[1][0].\n"; # can also be written - $matrix[1]->[0] for($i=0; $i < 4; $i++){ for($x=0; $x < 3; $x++){ print "$matrix[$i][$x] "; } print "\n"; }:::::::::::::: example19 :::::::::::::: #! /usr/bin/perl # An list of lists. @record=( "Adams", [2, 1, 0, 0], "Edwards", [1, 0, 3, 2], "Howard", [3 ,3 ,2,0 ], ); print "In the first game $record[0] batted $record[1]->[0].\n"; print "In the first game $record[2] batted $record[3]->[0].\n"; print "In the first game $record[4] batted $record[5]->[0].\n"; :::::::::::::: example2 :::::::::::::: #! /usr/bin/perl # Double quotes $num=5; print "The number is $num.\n"; print "I need \$5.00.\n"; print "\t\tI can't help you.\n"; :::::::::::::: example20 :::::::::::::: #! /usr/bin/perl %seasons=(Sp=>'Spring', Su=>'Summer', F=>'Fall', W=> 'Winter'); %days=('Mon'=> 'Monday'=>'Tue'=>'Tuesday' =>'Wed',); $days{'Wed'}="Wednesday"; $days{5}="Friday"; :::::::::::::: example21 :::::::::::::: #! /usr/bin/perl # Assigning keys and values to a hash %department = ( Eng => 'Engineering', # Eng is the key, # Engineering is the value M => 'Math', S => 'Science', CS => 'Computer Science', Ed => 'Education', ); $department = $department{'M'}; $school = $department{'Ed'}; print "I work in the $department section\n" ; print "Funds in the $school department are being cut.\n"; print qq/I'm currently enrolled in a $department{CS} course.\n/; print qq/The department associative array looks like this:\n/; print %department, "\n"; #The printout is not in the expected order due to internal hashing :::::::::::::: example22 :::::::::::::: #! /usr/bin/perl # Hash slices %officer= ( NAME=>"Tom Savage", SSN=>"510-222-3456", DOB=>"05/19/66" ); @info=qw(Marine Captain 50000); @officer{'BRANCH', 'TITLE', 'SALARY'}=@info; # This is a hash slice @sliceinfo=@officer{'NAME','BRANCH','TITLE'}; # This is also a hash slice print "The new values from the hash slice are: @sliceinfo\n\n"; print "The hash now looks like this:\n"; foreach $key ('NAME', 'SSN', 'DOB', 'BRANCH', 'TITLE', 'SALARY'){ printf "Key: %-10sValue: %-15s\n", $key, $officer{$key}; } :::::::::::::: example23 :::::::::::::: #! /usr/bin/perl # Nested hashes # values # keys key value key value %students=( Math => { Joe => 100, Joan => 95 }, Science => { Bill => 85, Dan => 76 } ); print "On the math test Joan got "; print qq/$students{Math}->{Joan}.\n/; print "On the science test Bill got "; print qq/$students{Science}->{Bill}.\n/; :::::::::::::: example24 :::::::::::::: #! /usr/bin/perl # Anonymous arrays as keys in a hash %grades=(Math => [ 90, 100, 94 ], Science => [ 77, 87, 86 ], English => [ 65, 76, 99, 100 ], ); print %grades, "\n"; print "The third math grade is: $grades{Math}->[2]\n"; print "All of the science grades are: @{$grades{Science}}\n"; :::::::::::::: example25 :::::::::::::: #! /usr/bin/perl # An array of hashes @stores=( { Boss =>"Ari Goldberg", Employees => 24, Registers => 10, Sales => 15000.00, }, { Boss =>"Ben Chien", Employees => 12, Registers => 5, Sales => 3500.00, }, ); print "The number of elements in the array: ", $#stores + 1, "\n"; # The number of the last subscript + 1 for($i=0; $i< $#stores + 1; $i++){ print $stores[$i]->{"Boss"},"\n"; # Accessing an element of the array print $stores[$i]->{"Employees"},"\n"; print $stores[$i]->{"Registers"},"\n"; print $stores[$i]->{"Sales"},"\n"; print "-" x 20 ,"\n"; } :::::::::::::: example26 :::::::::::::: #! /usr/bin/perl # Getting a line of input from the keyboard. print "What is your name? "; $name = ; print "What is your father's name? "; $paname=<>; print "Hello respected one, $paname"; :::::::::::::: example27 :::::::::::::: #! /usr/bin/perl # Getting rid of the trailing newline. Use chomp instead of chop. print "Hello there, and what is your name? "; $name = ; print "$name is a very high class name.\n"; chop($name); # Removes the last character no matter what it is. print "$name is a very high class name.\n\n"; chop($name); print "$name has been chopped a little too much.\n"; print "What is your age? "; chomp($age=); # Removes the last character if # it is the newline. chomp($age); # The last character is not removed # unless a newline print "For $age, you look so young!\n"; :::::::::::::: example28 :::::::::::::: #! /usr/bin/perl # Reading input in a requested number of bytes print "Describe your favorite food in 10 bytes or less.\n"; print "If you type less than 10 characters, press Ctrl-d on a line by itself.\n"; $number=read(STDIN, $favorite, 10); print "You just typed: $favorite\n"; print "The number of bytes read was $number.\n"; :::::::::::::: example29 :::::::::::::: #! /usr/bin/perl # Getting only one character of input print "Answer y or n "; $answer=getc; # Gets one character from stdin $restofit=<>; # What remains in the input buffer is assigned $restofit. print "$answer\n"; print "The characters left in the input buffer were: $restofit\n"; :::::::::::::: example3 :::::::::::::: #! /usr/bin/perl # Single quotes print 'I need $100.00.', "\n"; print 'The string literal, \t, is used to represent a tab.', "\n"; print 'She cried, "Help me!"', "\n"; :::::::::::::: example30 :::::::::::::: #! /usr/bin/perl # Assigning input to an array print "Tell me everything about yourself.\n "; @all = ; print "@all"; print "The number of elements in the array are: ", $#all + 1, ".\n"; print "The first element of the array is: $all[0]"; :::::::::::::: example31 :::::::::::::: #! /usr/bin/perl # Assign input to a hash $course_number=101; print "What is the name of course 101?"; chomp($course{$course_number} = ); print %course, "\n"; :::::::::::::: example32 :::::::::::::: #! /usr/bin/perl # Chopping and chomping a list @line=("red", "green", "orange"); chop(@line); # chops the last character off each # string in the list print "@line\n"; @line=( "red", "green", "orange"); chomp(@line); # chomps the newline off each string in the list print "@line\n"; :::::::::::::: example33 :::::::::::::: #! /usr/bin/perl @names = qw(Tom Raul Steve Jon); print "Hello $names[1]\n", if exists $names[1]; print "Out of range!\n", if not exists $names[5]; :::::::::::::: example34 :::::::::::::: #! /usr/bin/perl # Searching for patterns in a list @list = (tomatoes, tomorrow, potatoes, phantom, Tommy); $count = grep( /tom/i, @list); @items= grep( /tom/i, @list); print "Found items: @items\nNumber found: $count\n"; :::::::::::::: example35 :::::::::::::: #! /usr/bin/perl # Joining each elements of a list with colons $name="Joe Blow"; $birth="11/12/86"; $address="10 Main St."; print join(":", $name, $birth, $address ), "\n"; :::::::::::::: example36 :::::::::::::: #! /usr/bin/perl # Joining each element of a list with a newline @names=('Dan','Dee','Scotty','Liz','Tom'); @names=join("\n", sort(@names)); print @names,"\n"; :::::::::::::: example37 :::::::::::::: #! /usr/bin/perl # Mapping a list to an expression @list=(0x53,0x77,0x65,0x64,0x65,0x6e,012); @words = map chr, @list; print @words; @n = (2, 4, 6, 8); @n = map $_ * 2 + 6, @n; print "@n\n"; :::::::::::::: example38 :::::::::::::: #! /usr/bin/perl # Map using a block open(FH, "datebook.master") or die; @lines=; @fields = map { split(":") } @lines; foreach $field (@fields){ print $field,"\n"; } :::::::::::::: example39 :::::::::::::: #! /usr/bin/perl # Removing an element from the end of a list @names=("Bob", "Dan", "Tom", "Guy"); print "@names\n"; $got = pop(@names); # pops off last element of the array print "$got\n"; print "@names\n"; :::::::::::::: example4 :::::::::::::: #! /usr/bin/perl # Backquotes and command substitution print "The date is ", `date` ; # Win32 users: `date /T` print "The date is `date`", ".\n"; # Back quotes will be treated as literals $directory=`pwd`; # Win32 users: `cd` print "\nThe current directory is $directory."; :::::::::::::: example40 :::::::::::::: #! /usr/bin/perl # Adding elements to the end of a list @names=("Bob", "Dan", "Tom", "Guy"); push(@names, Jim, Joseph, Archie); print "@names \n"; :::::::::::::: example41 :::::::::::::: #! /usr/bin/perl # Removing elements from front of a list @names=("Bob", "Dan", "Tom", "Guy"); $ret = shift @names; print "@names\n"; print "The item shifted is $ret.\n"; :::::::::::::: example42 :::::::::::::: #! /usr/bin/perl # Splicing out elements of a list @colors=(red, green, purple, blue, brown); print "The original array is @colors\n"; @discarded = splice(@colors, 2, 2); print "The elements removed after the splice are: @discarded.\n"; print "The spliced array is now @colors.\n"; :::::::::::::: example43 :::::::::::::: #! /usr/bin/perl # Splicing and replacing elements of a list @colors=(red, green, purple, blue, brown); print "The original array is @colors\n"; @lostcolors=splice(@colors, 2, 3, yellow, orange); print "The removed items are @lostcolors\n"; print "The spliced array is now @colors\n"; :::::::::::::: example44 :::::::::::::: #! /usr/bin/perl # Splitting a scalar on whitespace and creating a list $line="a b c d e"; @letter=split(' ',$line); print "The first letter is $letter[0]\n"; print "The second letter is $letter[1]\n"; :::::::::::::: example45 :::::::::::::: #! /usr/bin/perl # Splitting up $_ while(){ @line=split(":"); print "$line[0]\n"; } __DATA__ Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500 Igor Chevsky:385-375-8395:3567 Populus Place, Caldwell, NJ 23875:6/18/68:23400 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700 Jennifer Cowan:548-834-2348:583 Laurel Ave., Kingsville, TX 83745:10/1/35:58900 Fred Fardbarkle:674-843-1385:20 Park Lane, Duluth, MN 23850:4/12/23:78900 :::::::::::::: example46 :::::::::::::: #! /usr/bin/perl # Splitting up $_ and creating an unnamed list while(){ ($name,$phone,$address,$bd,$sal)=split(":"); print "$name\t $phone\n" ; } __DATA__ Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500 Igor Chevsky:385-375-8395:3567 Populus Place, Caldwell, NJ 23875:6/18/68:23400 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:245700 Jennifer Cowan:548-834-2348:583 Laurel Ave., Kingsville, TX 83745:10/1/35:58900 Fred Fardbarkle:674-843-1385:20 Park Lane, Duluth, MN 23850:4/12/23:78900 :::::::::::::: example47 :::::::::::::: #! /usr/bin/perl # Many ways to split a scalar to create a list $string= "Joe Blow:11/12/86:10 Main St.:Boston, MA:02530"; @line=split(":", $string); # the string delimiter is a colon print @line,"\n"; print "The guy's name is $line[0].\n"; print "The birthday is $line[1].\n\n"; @str=split(":", $string, 2); print $str[0],"\n"; # the first element of the array print $str[1],"\n"; # the rest of the array because limit is 2 print $str[2],"\n"; # nothing is printed @str=split(":", $string); # Limit not stated will be one more # than total number of fields print $str[0],"\n"; print $str[1],"\n"; print $str[2],"\n"; print $str[3],"\n"; print $str[4],"\n"; print $str[5],"\n"; ( $name, $birth, $address )=split(":", $string); # limit is implicitly 4, one more than # the number of fields specified print $name , "\n"; print $birth,"\n"; print $address,"\n"; :::::::::::::: example48 :::::::::::::: #! /usr/bin/perl # Sorting a list @string=(4.5, x, 68, a, B, c, 10, 1000, 1); @string_sort=sort(@string); print "@string_sort\n"; sub numeric { $a <=> $b ; } @number_sort=sort numeric 1000, -22.5, 10, 55, 0; print "@number_sort\n";a :::::::::::::: example49 :::::::::::::: #! /usr/bin/perl # Sorting numbers with an unamed subroutine @sorted_numbers= sort {$a <=> $b} (3,4,1,2); print "The sorted numbers are: @sorted_numbers", ".\n"; :::::::::::::: example5 :::::::::::::: #! /usr/bin/perl # Using alternative quotes print 'She cried, "I can\'t help you!"',"\n"; # Clumsy print qq/She cried, "I can't help you!" \n/; # qq for double quotes print qq/I need $5.00\n/; # Really need single quotes for a literal dollar sign to print print q/I need $5.00\n/; # What about backslash interpretation? print qq/\n/, q/I need $5.00/,"\n"; print q!I need $5.00!,"\n"; print "The present working directory is ", `pwd`; print qq/Today is /, qx/date/; print "The hour is ", qx{date +%H}; :::::::::::::: example50 :::::::::::::: #! /usr/bin/perl # Reversing the elements of an array @names=("Bob", "Dan", "Tom", "Guy"); print "@names \n"; @reversed=reverse(@names),"\n"; print "@reversed\n"; :::::::::::::: example51 :::::::::::::: #! /usr/bin/perl # Putting new elements at the front of a list @names=(Jody, Bert, Tom) ; unshift(@names, Liz, Daniel); print "@names\n"; :::::::::::::: example52 :::::::::::::: #! /usr/bin/perl # The keys function and a hash %weekday= ( '1'=> 'Monday', '2'=>'Tuesday', '3'=>'Wednesday', '4'=>'Thursday', '5'=>'Friday', '6'=>'Saturday', '7'=>'Sunday', ); foreach $key ( keys(%weekday) ) {print "$key ";} print "\n"; foreach $key ( sort keys(%weekday) ) {print "$key ";} print "\n"; :::::::::::::: example53 :::::::::::::: #! /usr/bin/perl # The values function and a hash %weekday= ( '1'=> 'Monday', '2'=>'Tuesday', '3'=>'Wednesday', '4'=>'Thursday', '5'=>'Friday', '6'=>'Saturday', '7'=>'Sunday', ); foreach $value ( values(%weekday)){print "$value ";} print "\n"; :::::::::::::: example54 :::::::::::::: #! /usr/bin/perl # # Example of using each function in Associative Arrays # %weekday=( 'Mon' => 'Monday', 'Tue' => 'Tuesday', 'Wed' => 'Wednesday', 'Thu' => 'Thursday', 'Fri' => 'Friday', 'Sat' => 'Saturday', 'Sun' => 'Sunday', ); while(($key,$value)=each(%weekday)){ print "$key = $value\n"; } :::::::::::::: example55 :::::::::::::: #! /usr/bin/perl %employees=("Nightwatchman" => "Joe Blow", "Janitor" => "Teddy Plunger", "Clerk" => "Sally Olivetti", ); $layoff=delete $employees{"Janitor"}; print "We had to let $layoff go.\n"; print "Our remaining staff includes: "; print "\n"; while(($key, $value)=each(%employees)){ print "$key: $value\n"; } :::::::::::::: example56 :::::::::::::: #! /usr/bin/perl %employees=( "Nightwatchman" => "Joe Blow", "Janitor" => "Teddy Plunger", "Clerk" => "Sally Olivetti", ); print "The Nightwatchman exists.\n" if exists $employees{"Nightwatchman"}; print "The Clerk exists.\n" if exists $employees{"Clerk"}; print "The Boss does not exist.\n" if ! exists $employees{"Boss"}; :::::::::::::: example57 :::::::::::::: #! /usr/bin/perl # Loading an Associative Array from a file. open(NAMES,"emp.names2") || die "Can't open emp.names2: $!\n"; while(){ ( $num, $name )= split(' ', $_, 2); $realid{$num} = $name; } close NAMES; while(1){ print "Please choose a number from the list of names? "; chomp($num=); last unless $num; print $realid{$num},"\n"; } :::::::::::::: example58 :::::::::::::: #! /usr/bin/perl foreach $key (keys(%ENV)) { print "$key\n"; } print "\nYour login name $ENV{'LOGNAME'}\n"; $pwd=$ENV{'PWD'}; print "\n", $pwd, "\n"; :::::::::::::: example59 :::::::::::::: #! /usr/bin/perl sub handler { local($sig) = @_; # first argument is signal name print "Caught SIG$sig -- shutting down\n"; exit(0); } $SIG{'INT'} = 'handler'; # Catch ^C print "Here I am!\n"; sleep(10); $SIG{'INT'}='DEFAULT'; :::::::::::::: example6 :::::::::::::: #! /usr/bin/perl $number=150; $name="Jody Savage"; :::::::::::::: example7 :::::::::::::: #! /usr/bin/perl $var="net"; print "${var}work\n"; :::::::::::::: example8 :::::::::::::: #! /usr/bin/perl # Initializing scalars and printing their values $num = 5; $friend = "John Smith"; $money = 125.75; $now = `date`; # Backquotes for command substitution $month="Jan"; print "$num\n"; print "$friend\n"; print "I need \$$money.\n"; # Protecting our money print qq/$friend gave me \$$money.\n/; print qq/The time is $now/; print "The month is ${month}uary.\n"; # Curly braces shield the variable :::::::::::::: example9 :::::::::::::: #! /usr/bin/perl $name="Tommy"; print "OK \n" if defined $name; :::::::::::::: input26 :::::::::::::: Isabel Nick :::::::::::::: input27 :::::::::::::: Joe Smith 25 :::::::::::::: input28 :::::::::::::: apple pie and ice cream :::::::::::::: input29 :::::::::::::: yessirreebob :::::::::::::: input30 :::::::::::::: O.K. Let's see I was born before computers. I grew up in the 50s. I was in the hippie generation. I'm starting to get bored with talking about myself. :::::::::::::: input31 :::::::::::::: Linux Administration :::::::::::::: input57 :::::::::::::: 1 4 5 2 6 8 3