in reply to Cannot update record in file with Dump module

I'm not entirely sure what you mean by "It gives no effects after: ...". For instance, is $tempFile not created? If it is, then that would be an effect. Perhaps you mean $megalithFile is empty after the script completes; although, that seems unlikely unless you received some error message (which I'd also class as an effect).

NOTE: I have the first edition of "Programming the Perl DBI" (February 2000), so what I'm looking at may differ from your copy if you have a more recent edition. The while loop you show is on page 24 of my copy - you may be able to use that as a reference point.

The purpose of the examples you're referring to is to show how you could use Data::Dumper to format input records so that they may be evaled. On page 23, you'll see:

my $dumpedValues = $dumper->Dump(); ... eval $dumpedValues;

From your code above and your description of xxx.txt, you appear to be evaling the single record:

$name="MyName";$location="MyLoc";$mapRef="MyRef";$type="MyType";$descr +iption="MyDesc";

In order for

my ( $name, $location, $mapref, $type, $description ) = @$fields;

to be doing something useful, you should be evaling something that looks more like:

$fields = [ qw{name location mapref type description} ];

You appear to have removed all the comments that appear in the book. The comment regarding the eval should have provided a clue. My copy has:

### Evaluate perl record string to set $fields array reference my $fields; eval $_; die if $@;

Two paragraphs before the while loop code, my copy has:

"... use Data::Dumper to format the records ...

I suggest you try doing that.

If you're still having problems, please show your input and output within <code>...</code> tags (as opposed to a prosaic description).

-- Ken