Hi!

I am learning to program with Perl using a PDF-file on the Internet called

Picking up Perl : a tutorial book for new Perl programmers / Bradley 
M. Kuhn. - 0.12th ed, covering Perl Version 5.6.0.

and BBedit 6.0.2 and MacPerl 5.2.0.r4. I am totally new to 
programming and now I have a problem, I cannot solve.

An example script is the following:

<script>

#!/usr/bin/perl

use strict

my $owner = 'Elizabeth';
my $dog = 'Rex';
my $amount = '12.5';
my $what = 'dog food';

print "${owner}'s dog, $dog, ate $amount pounds of $what.\n";

</script>

The result of this script is:

's dog, Rex, ate 12.5 pounds of dog food.

and not

Elizabeth 's dog, Rex, ate 12.5 pounds of dog food.

as it is supposed to be.

I understand why I have to put the curly braces around "owner" in the 
last line. But the curly braces don't seem to work with MacPerl. I 
have searched through the archives of the mailing list and found an 
example where the braces were used. I also looked through other Perl 
books and found the curly braces used as well. Leaving them out 
doesn't work.

What am I doing wrong or is it MacPerl or BBedit or what?

Thanking you for your help.

Anette

Reply via email to