Do you know where your variables are? | |
PerlMonks |
Re: print all data matching identical three alphabets from two different filesby kcott (Archbishop) |
on Nov 15, 2017 at 23:22 UTC ( [id://1203534]=note: print w/replies, xml ) | Need Help?? |
G'day mao9856, Here's another (less busy) way to do it.
Output:
I've used Inline::Files just to show the technique. It's good you've used the 3-argument form of open; but less good that you've used package variables for the filehandles — prefer lexical filehandles instead. Also, your error reporting (i.e. or die) is rubbish: either spend a lot more time on this tedious and error-prone task yourself, or just let Perl do it for you with the autodie pragma. Please post data within <code>...</code> tags as you did with your code. This makes it a lot less work for you; your data isn't subject to HTML interpretation (e.g. special characters and whitespace compression); and it makes it a lot easier for us to paste it directly into any example code we might provide. — Ken
In Section
Seekers of Perl Wisdom
|
|