More JavaScript to Perl traps: =item * In Perl, binary C<+> is always addition. C<$string1 + $string2> converts both strings to numbers and then adds them. To concatenate two strings, use the C<.> operator. =item * To iterate over the indices of an array, use C<foreach my $i (0 .. $#array) {}>. C<foreach my $v (@array) {}> iterates over the values. =item * To iterate over the keys of a hash, use C<foreach my $k (keys %hash) {}>. C<foreach my $kv (%hash) {}> iterates over the keys and values, and is generally not useful ($kv would be a key, then a value, and so on). =item * Perl requires braces following C<if>, C<while>, C<foreach>, etc. =item * In Perl, "else if" is spelled "elsif". RonaldThread Previous | Thread Next