12.3. Tips for the FORTRAN Programmer

Perl code appears quite odd to a FORTRAN programer. FORTRAN uses ( ) (parentheses) exclusively for indices. An array element has the form ARRELM(1), a matrix element has the form MATELM(1,1), and a subroutine call takes the form CALL ASUB ( VALUE1, VALUE2 ), whereas Perl uses ( ) (parentheses), [ ] (brackets), and { } (braces) in various ways depending on data type and function. For instance, whereas $a[$i] refers to an element of an array, $a{$i} refers to a value in a hash. Forgetting the proper uses of these separators is a common error for the neophyte Perler experienced in FORTRAN.

If you use FORTRAN for its native handling of high-precision floating point numbers (and if you don't—what are you using ...

Get Perl Debugged now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.