Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Advocacy > Re: Serious que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 20 of 92
Post > Topic >>

Re: Serious question on using Perl or not...

by nferraz@[EMAIL PROTECTED] (Nelson Ferraz) Jul 26, 2004 at 05:47 PM

Gregoire Hostettler wrote:
> Seriousely considering making my customer change his mind and revert to
> plain old C++
(...)
> Looks like Perl is not able to handle trivial data structure like an
array
> of records (or hashes).

Gregoire,

1) Your code *shows* you're a C/C++ programmer; it will take some time 
to be proficient in Perl, if you want to.

2) The comment at line 29 is impolite and unnecessary.

3) It's easy to add a new item to an array of hashes (you must fix it in 
line 60):

	push @[EMAIL PROTECTED]
 \%hash;

4) Use Data::Dumper to check your data structure:

	use Data::Dumper;
	print Dumper @[EMAIL PROTECTED]
) It's easier to iterate over an array of hashes using foreach:

	foreach my $hashref (@[EMAIL PROTECTED]
) {
	  # do something with $hashref or %{$hashref}
	}

[]s

Nelson
 




 4 Posts in Topic:
Serious question on using Perl or not...
ghostettler@[EMAIL PROTEC  2004-07-26 21:58:33 
Re: Serious question on using Perl or not...
nferraz@[EMAIL PROTECTED]  2004-07-26 17:47:40 
Re: Serious question on using Perl or not...
hursh@[EMAIL PROTECTED]   2004-07-26 16:25:19 
Re: Serious question on using Perl or not...
uri@[EMAIL PROTECTED] (U  2004-07-27 01:22:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 12:14:50 CDT 2008.