Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Searching for two elements in two different lines

by Eily (Hermit)
on Aug 30, 2013 at 12:45 UTC ( #1051622=note: print w/ replies, xml ) Need Help??


in reply to Searching for two elements in two different lines

Your code is hard to read, and I only say hard because I gave up too early to end up saying impossible.

If you have too many variables with names ending with a number, there's probably a design problem. In your case that's already obvious with the files. Either all three of them have the same role, and one can be used as the other without the whole program losing all its sense, and you can store their name and filehandles in an array or whatever data structure seems the best. Or your files have different purposes and you should give them names accordingly.

The same goes for arrays, you can't have 8 of them called "array" and use them for 8 different purposes.

As a rule, you should try to name your things by what they mean and not what they do. An array of colour names should be @colour, not @array. And how the hex do you end up with more than one kind of nothing?

And Perl warns you for a reason, because code that seems to work but has unexpected behaviour is actually worse than code that doesn't work but explicitly fails. So the first optimisation is use warnings


Comment on Re: Searching for two elements in two different lines
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1051622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-07-11 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (220 votes), past polls