Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > BOOK: Beginning Perl
|
BOOK: Beginning Perl
This is the forum to discuss the Wrox book Beginning Perl by Curtis Poe; ISBN: 978-1-118-01384-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 27th, 2015, 04:57 AM
Registered User
 
Join Date: Apr 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Chapter 3 exercise solutions

I don't know if anyone is still bothering to check these forums, as they apparently never seemed to get much activity in the past, but heres my solutions for the exercises at the end of ch03:

Array Exercise:
Code:
#!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;

my @karray = qw( Andrew Andy Kaufman );
my $andrew = $karray[0];
my $andy = $karray[1];
my $kaufman = $karray[2];

print qq($andrew "$andy" $kaufman\n);

Hash Exercise:
Code:
#!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;

my %fruit = (
	bananas => 'yellow',
	apples => 'red',
	grapes => 'green',
);

for my $produce ( keys %fruit ) {
	print qq($produce are $fruit{$produce}\n); 
}
I would be very interested as to alternate ways to solve these simple problems, this being perl and all, theres more than one way to do it...





Similar Threads
Thread Thread Starter Forum Replies Last Post
where to get the Exercise Solutions? ke3pup BOOK: Beginning Visual C++ 6 1 August 19th, 2006 05:33 PM
Exercise Solutions AlreadyDead BOOK: Beginning Access VBA 6 February 26th, 2006 04:23 PM
Beginning Access 2002 VBA Exercise Solutions naivegeye BOOK: Beginning Access VBA 3 October 18th, 2004 04:12 PM
Exercise Solutions gsforfree BOOK: Beginning ASP.NET 1.0 3 June 28th, 2004 12:56 PM
Beginning ASP.NET 1.0 using C# Exercise Solutions danradley BOOK: Beginning ASP.NET 1.0 8 October 14th, 2003 04:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.