in reply to Re: Error not reported while processing an open file
in thread Error not reported while processing an open file
> 1) Add use strict; to the beginning of your code to prevent autovivification of variables.
Yes, by the time I posted it here I had already used strict everywhere. Initially I had error messagse that I could not understand but eventually got over.
> Do this instead: my $SOME_GLOBAL_VARIABLE=some_sub_without_side_effects();
You are right. But the way I needed to use was to have several variables to be returned, which would be easier with global variables than with several functions. :)
> 3) Remove the { } around the function calls, they are unnecessary and ugly.
I was intending to use eval... In retrospect, that was not required. Yes, I would be removing them now. :)
> 4) Use IO::File ...
Yes, I would be using it from now on. Thanks. :)
> 5) When modifying a Perl built-in variable, always create a scope and localize it first...
This has been a problem for me to understand, I need better books for advanced settings. I am not sure which are actually global and which are not.
My array sizes are huge so I was not sure if I should use subroutines which might duplicate all the variables upon passing the info, but I could not verify if it actually happens. These problems exists, but I could somehow write my first code.
> Anyway, good luck and happy Perl programming.
Thanks. It's been an ugly code, but I am happy to have shfted from FORTRAN for these things. :)
Sorry I could not reply earlier, was out for some trip.
Thanks a lot again. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Error not reported while processing an open file
by Roger (Parson) on Mar 08, 2004 at 11:06 UTC | |
by qhayaal (Beadle) on Mar 13, 2004 at 19:05 UTC |