Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^9: How to write to a file?

by soonix (Canon)
on Oct 15, 2019 at 19:27 UTC ( #11107502=note: print w/replies, xml ) Need Help??


in reply to Re^8: How to write to a file?
in thread How to count the length of a sequence of alphabets and number of occurence of a particular alphabet in the sequence?

Your input file seems to contain an empty line, but the script does not provide for it.

If empty lines are ok, you could define something like
my $rx_empty = qr{ \A \s* \z }xms; # empty line (or whitespace on +ly)
and after the chomp
if ($record =~ $rx_empty) { # ignore next RECORD }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2020-07-14 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?