Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplemental documentation for the chomp method #51

Merged
merged 1 commit into from Sep 2, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/IO/All.swim
Expand Up @@ -795,6 +795,16 @@ This is so that the option methods can be chained together. For example:
`separator` method has been called, chomp will remove that value from the
end of each record.

Note that `chomp` may cause the following idiom to halt prematurely
(e.g., if `separator` is `\n` (the default) and `chomp` is in effect,
then this command will stop reading at the first blank line):

`while ( my $line = $io->getline ) {...}`

Try the following, instead:

`while ( defined(my $line = $io->getline) ) {...}`

- confess

Errors should be reported with the very detailed Carp::confess function.
Expand Down