Re: File with hash inside it



"phillyfan" <philly_fan1@xxxxxxxxxxx> wrote in
news:1125435734.882677.39690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

> I should have quoted as you say.

And yet you still do not quote. Hmmm ...

> open(OUT,">hash-table.txt");

Always, yes *always*, check if open succeeded:

open my $out, '>', 'hash-table.txt'
or die "Cannot open 'hash-table.txt for writing: $!";

> while( ( $key, $value) = each(%$href) ) {
> while( ($value1, $value2) = each %$value ){

I am not even going to presume to understand what you are doing here.

> if($value1 eq 'title'){next}

More Perl-like:

next if $value1 eq 'title';

> }close(OUT);

Do check if close succeded as well.

> exit 0;

Unnecessary.

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.



Relevant Pages