#!/usr/bin/perl -w

# playing a bit further still...
# from CIS 180 - Perl - class 1
# last modified: 4-8-03 (added some comments)

print "Hello, world!\n";

# playing with concatenation and string repetition operators

print (('hello' . "\n") x 5);

print 'hello' x3 . "\n";
print 'Hello world!' . "\n" x 3 ; 

# very little is treated as "special" in a single quoted
# string --- except \' as a single quote character, and \\
# as a backspace character

print 'Jane\'s Airplances' . "\n"; 
print 'c:\\personal' . "\n";

# playing with Perl's automatic conversion between strings and
# numbers

print "12" * 6, "\n" ;
print "12fred34" * "   3" , "\n";
print "fred" * 3, "\n";
print "fred3" * 3, "\n";

# playing with scalar variables

$fred = 27;
print $fred, "\n";
print ++$fred, $fred--, $fred, "\n";  # see p. 134
$fred += 28;
print "\$fred is now $fred\n";
print '$fred' . "\n";

print "I want $freds right now!\n"; 
print "I want ${fred}s right now!\n";  

# example of user input and chomping off its newline...

print "type something:\n"; 
chomp($fred= <STDIN>); 
print $fred x 3, "\n"; 

