![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Reading (the same) data in different ways & memory usageby jwkrahn (Abbot) |
on Apr 20, 2011 at 03:59 UTC ( [id://900276]=note: print w/replies, xml ) | Need Help?? |
This doesn't answer your question but:
You are using prototypes but prototypes were introduced to allow programmers to imitate Perl's built-in functions, not for user code per se. FMTEYEWTK on Prototypes in Perl You are testing for the existence of a file twice, first with stat and then with open. In the stat test you are unnecessarily copying the file name to a string before testing it. What's wrong with always quoting "$vars"? You should include the $! variable in your error messages so you know why they failed.
That is usually written as:
Which avoids unnecessary substitution.
What is the sprintf doing that the simple assignment is not doing? It looks like you don't need this test at all.
In Section
Seekers of Perl Wisdom
|
|