Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Accessing or printing key and value

by ww (Bishop)
on Dec 11, 2012 at 00:49 UTC ( #1008199=note: print w/ replies, xml ) Need Help??


in reply to Accessing or printing key and value

The close-curly on Ln 15 terminates your if clause... but there's no body to the if block. No code means the first if test is a nullity.

If that first conditional fails, the code falls thru to the elsif.

Pls explain why your code at Ln 40, open too,">out.txt";   # open file for counts to be depposited to, is unlike your other (reasonably well-formed opens.

It appears that you're using neither strict nor warnings. Both would help you find your own syntax mistakes. Your localization (or Not) of variables is inconsistent. Your $ARG variable tromps all over it's conventional usage:

$ARG $_ The default input and pattern-searching space.
(per perlvar)

Your indentation is idiosyncratic (at the kindest) and erratic. Single-tab (or 2 to 4 space) indents for each level of curlies would make this code far easier to read.

... and so far, nothing here explicitly addresses your question. That's deliberate. Please, when you post code, make sure it's runnable (or at least passes a compile test with strict in force. And, please, put your data inside code tags, so there's no question about the actual content of the data.. If you fix these problems, you'll find the Monks most generous in helping you learn.


Comment on Re: Accessing or printing key and value
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2014-07-23 06:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (133 votes), past polls