Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > BOOK: Beginning Perl
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 27th, 2015, 05:57 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 06: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 05:12 PM
Exercise Solutions gsforfree BOOK: Beginning ASP.NET 1.0 3 June 28th, 2004 01:56 PM
Beginning ASP.NET 1.0 using C# Exercise Solutions danradley BOOK: Beginning ASP.NET 1.0 8 October 14th, 2003 05:10 AM



All times are GMT -4. The time now is 01:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.