Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to read input from a file, one section at a time?

by hippo (Bishop)
on Feb 21, 2019 at 22:33 UTC ( [id://1230339]=note: print w/replies, xml ) Need Help??


in reply to how to read input from a file, one section at a time?

Please help.

You will likely receive substantially more help if you take the time to enclose each datafile and program in its own pair of <code> tags. See Markup in the Monastery for more help on that.

Even without that, code which looks like this sets alarm bells ringing:

if($aa =~/A/ig){ $A++; } if($aa=~/C/ig){ $C++; } if($aa=~/D/ig){ $D++; + } if($aa=~/E/ig){ $E++; } if($aa=~/F/ig){ $F++; } if($aa=~/G/ig){ $G +++; } if($aa=~/H/ig){ $H++; } if($aa=~/I/ig){ $I++; } if($aa=~/K/ig){ + $K++; } if($aa=~/L/ig){ $L++; } if($aa=~/M/ig){ $M++; } if($aa=~/N/i +g){ $N++; } if($aa=~/P/ig){ $P++; } if($aa=~/Q/ig){ $Q++; } if($aa=~/ +R/ig){ $R++; } if($aa=~/S/ig){ $S++; } if($aa=~/T/ig){ $T++; } if($aa +=~/V/ig){ $V++; } if($aa=~/W/ig){ $W++; } if($aa=~/Y/ig){ $Y++; }

Why not use a hash instead?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (8)
As of 2024-03-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found