Errata for Intermediate Perl
Submit your own errata for this product.
The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update
| Version |
Location |
Description |
Submitted By |
Date Submitted |
| Printed |
Page 79
3rd block of code |
The statement
my $data_structure = eval $string #Missing semicolon?
does not restore the original variables with the new names $VAR1 and $VAR2 using ActiveState perl v5.16.1 under Windows XP.
use warnings;
use Data::Dumper;
my @data1 = qw(one won);
my @data2 = qw(two too to);
push @data2, \@data1;
push @data1, \@data2;
my $string = Dumper( \@data1, \@data2 );
print $string;
print "--------------------------------\n";
my $data_structure = eval $string;
print "Message: $@\n" if $@;
print Dumper( $VAR1, $VAR2 );
OUTPUT: (Note undef)
$VAR1 = [
'one',
'won',
[
'two',
'too',
'to',
$VAR1
]
];
$VAR2 = $VAR1->[2];
--------------------------------
$VAR1 = [
'one',
'won',
[
'two',
'too',
'to',
undef
]
];
$VAR2 = $VAR1->[2];
|
Willialm K. Smith |
Jan 27, 2013 |
| Printed |
Page 135
sub rightmost |
In reply to:
"Note from the Author or Editor:
I fixed the missing 'my', but I don't see the problem with the first issue."
The bug is obvious:
rightmost('Ginger and Ginger Ale', qr/Ginger/) returns 0 but the rightmost occurrence of Ginger is at position 11.
NB, the "my" isn't fixed in the downloads section.
|
cg |
Dec 15, 2012 |
|
| |