summaryrefslogtreecommitdiff
path: root/regress/base/virtual_maps.pl
blob: 70774bf5b2c8080b7275b5a0091e87754dcd4174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env perl
#
# $FML: virtual_maps.pl,v 1.1 2002/02/13 12:30:35 fukachan Exp $
#

use strict;
my $debug = defined $ENV{'debug'} ? 1 : 0;

if (-f "/etc/postfix/virtual") {
    print "IO::Adapter::find() for /etc/postfix/virtual\n";

    use IO::Adapter;

    my $map = new IO::Adapter ("file:/etc/postfix/virtual");

    if (defined $map) {
	$map->open;

	{
	    print "# want is not specified.\n";
	    my $r = $map->find('^nuinui');
	    print $r, "\n";
	}

	{
	    print "# want = key,value\n";
	    my $r = $map->find('^nuinui', { want => 'key,value' } );
	    print $r, "\n";
	}

	{
	    print "# want = key\n";
	    my $r = $map->find('^nuinui', { want => 'key' } );
	    print $r, "\n";
	}

    }
    else {
	use Carp;
	croak("undefined");
    }
}

exit 0;