#!/lusr/bin/perl -w $day = "Sunday"; print 'The boy said, "Today is $day"' . "\n"; print "The boy said, 'Today is $day'" , "\n"; print 'hello' . "\n"; print 'hello\'', "\n"; print 'hello\\', "\n"; print 'Don\'t do it!' . "\n"; print 'can\'t, won\'t, wouldn\'t ever!', "\n"; print 'apple are good\n' , "\n"; @list = (1, 4, 6, 2 , 'cho', "hyuk"); print join(' ', @list); ($first, @list) = @list; print $first . "\n"; print "@list"; print "----------------------\n"; @list = (1, 2, 3, 4, 5); @new = (7, 6); #splice (@list, 3); #print "@list" , "\n"; #splice (@list, 2, 2); #print "@list", "\n"; #splice (@list, 2, 2, @new); #print "@list", "\n"; #splice (@list, 2, 0, @new); #print "@list", "\n"; #splice (@list, 2, 2, 9, 8, 7); #print "@list", "\n"; splice(@list, 3, 1, ()); print "@list", "\n"; @fruit = split /,/, "apples, grapes, lime", 2; print "@fruit\n"; @chars = split(//, "hyukcho"); print "@chars" . "\n"; print "\n========================\n"; @myList = (1, 2, 3, 4, 5, 6); print @myList , "\n"; print "@myList", "\n"; print $#myList, "\n"; $l = @myList; print $l, "\n"; $myString = "abc"."def" x 2; print $myString . "\n"; $myString = ("abc" . "def") x 2; print $myString . "\n"; @temp = 1; print "@temp", "\n"; print "\n======================\n"; $tempString = "Wish You Were Here\n"; print $tempString; print "\n======================\n"; $list = "Bob"; @list = (1, 2, 3); $list[1] = 4; print $list, "\n"; @names = ('Bob', "Mary", "Fred"); @reversed_names = reverse @names; @sorted_names = sort @names; @num = (42, 68, 10, 5, 103); @sorted_num = sort @num; print "@reversed_names\n"; print "@sorted_names\n"; print "@sorted_num\n"; @list = (1, 2, 3, 4, 5); @new = (7, 6); print splice(@list, 3), " : ", @list, "\n"; @list = (1, 2, 3, 4, 5); print splice(@list, 2, 2), " : ", @list, "\n"; @list = (1, 2, 3, 4, 5); print splice(@list, 2, 2, @new), " : ", @list, "\n"; @list = (1, 2, 3, 4, 5); print splice(@list, 2, 0, @new), " : ", @list, "\n"; @list = (1, 2, 3, 4, 5); print splice(@list, 2, 2, 9, 8, 7), " : ", @list, "\n"; @list = (1, 2, 3, 4, 5); print splice(@list, 3, 1, ()), " : ", @list, "\n"; print "4e3" + 0, "\n"; print "-6**3xyz" + 0, "\n"; print "12 Monkeys" + 0, "\n"; print "UTCS" + 0, "\n"; print " UB40" + 0, "\n"; print " 20 10 " + 0, "\n"; print "\n========================\n"; @r = (1, 2, 3, 4, 5); @s = (6,7); #print splice(@r, scalar @r - 1, 1), "\n"; print splice(@r, scalar @r, 0, @s), "\n"; print @r; print splice(@r, 0, 0);