Professional Documents
Culture Documents
Perl Programming: Presented by Mark Bixby Solution Symposium 2001
Perl Programming: Presented by Mark Bixby Solution Symposium 2001
Perl Programming: Presented by Mark Bixby Solution Symposium 2001
perl
programming
perl programming
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
• entire hashes
• %days # (key1, val1, key2, val2 ...)
Solution Symposium
• hash values
• $abc{'December'} = 12;
• $month = $abc{'December'};
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
$bestday = max($mon,$tue,$wed,$thu,$fri);
Solution Symposium
Solution Symposium
Solution Symposium
• string comparsions:
• lt gt le ge eq ne cmp
• cmp returns -1, 0, or 1 depending on whether the left
argument is stringwise less than, equal to, or greater than
the right argument
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
use Socket;
$proto = getprotobyname('tcp');
$ipaddr = inet_aton('localhost');
$port = getservbyname('daytime', 'tcp');
$address = sockaddr_in($port, $ipaddr);
socket(SOCK, PF_INET, SOCK_STREAM, $proto);
connect(SOCK, $address);
$timestamp = <SOCK>;
print "$timestamp\n";
close(SOCK);
Solution Symposium
use IO::Socket;
$remote = IO::Socket::INET->new(
Proto = 'tcp',
PeerAddr = 'localhost',
PeerPort = 'daytime');
$timestamp = <$remote>;
print "$timestamp\n";
close($remote);
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium
#!/PERL/PUB/perl
use LWP::Simple;
$webpage = get('http://www.bixby.org/mark/perlix.html');
Solution Symposium
Solution Symposium
Solution Symposium
Solution Symposium