Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2014-09-30 13:13 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (369 votes), past polls