---
name: "Weblint::Messages"
section: "3pm"
platform: "linux"
package: "weblint"
version: "1.93-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/Weblint::Messages"
---

# Weblint::Messages(3pm)

Weblint::Messages - perl module encapsulating weblint output messages

```
    use Weblint::Messages;
```

```
    my $msg = Weblint::Messages->new();
    $msg->whine('title-length');
```

**Weblint::Messages** is a class which provides access to the messages output by weblint (warnings, error messages, and stylistic comments). By default this module is used by the **Weblint** module, so unless you're doing something fancy, you don't need to know about it.\
 **CONSTRUCTOR** The constructor doesn't take any arguments, so is used as follows:

```
    use Weblint::Messages;
```

```
    $messages = Weblint::Messages->new();
```

**whine** Generate an output message:

```
    $messages->whine( ID, argument1 ... argumentN );
```

The first argument is a string which identifies the message. This is followed by zero or more message-specific arguments, which get interpolated into the message.\
 **reset\_defaults** This method will reset the configuration of the module to the defaults built in:

```
    $messages = Weblint::Messages->new();
    ... do some things ...
    $messages->reset_defaults();
```

**message\_format** Set the format of message which will be output:

```
    $messages->message_format( MF_TERSE );
```

There are three message formats currently supported. The identifiers for the three formats are defined in the **Weblint::Constants** module. The three message formats are: This is the standard lint format, which is used by default. The format is:

```
    filename(line): message
```

This is meant mainly for automatic processing of weblint output; the format is:

```
    filename:line:message
```

This is a shortened format, which doesn't include the filename. It is useful in places where the filename is temporary:

```
    line N: message
```

**enable**\
 **class\_enable**\
 **output\_handle** Set the filehandle which messages should be written to.

```
    $messages = Weblint::Messages->new();
    $FILE = new IO::File("> file.out");
    $old = $messages->output_handle($FILE);
```

This method returns the previous filehandle. The method can be used without any argument to query the current filehandle.

```
    $cur_handle = $messages->output_handle();
```

By default this is set to standard output (STDOUT).\
 **class\_enable**\
 **pedantic** Hmm, just thought, this should be a meta class. Maybe should have flags, so you can enable (PEDANTIC ⎪ INTERNAL). OK, this method is likely to go away :-)\
 **set\_message\_handler** The weblint module. The weblint web site, where you can always get the latest version of weblint. Neil Bowers \<neilb@weblint.org\> Copyright (c) 1999 Neil Bowers. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
