---
name: "Mail::Folder::FastReader"
section: "3pm"
platform: "linux"
package: "grepmail"
version: "4.70-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/Mail::Folder::FastReader"
---

# Mail::Folder::FastReader(3pm)

Mail::Folder::FastReader - A fast mailbox reader

```
  use Mail::Folder::FastReader qw( read_email reset_file );
```

```
  open MAILBOX,"saved-mail";
  reset_file(MAILBOX);
  while (1)
  {
    my ($status, $email, $line_number) = read_email();
    last unless $status
```

```
    print <<EOF;
EMAIL STARTING ON LINE $line_number:
$email
-------------------------------------
EOF
  }
  close MAILBOX;
```

This module provides a simple and fast way to read unix-style mailboxes. It basically searches for the next line that begins with "From ", but which doesn't follow a "----- Begin Included Message -----".\
 **FUNCTIONS** Read the next email from the filehandle, storing the email in `$email` and the line number in `$line`. The status is 1 if successful, and 0 if not. Reset the internal line counter and the reference to the filehandle. Call this before calling *read\_email()*. David Coppit \<david@coppit.org\> grepmail, [*mail*(1)](/mail/1.md), [*printmail*(1)](/printmail/1.md), *Mail::Internet*(3) Crocker,  D.  H., Standard for the Format of Arpa Internet Text Messages, RFC822.
