File: FilterList.pl

package info (click to toggle)
piwi 0.8%2B20041206-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, sarge, squeeze, wheezy
  • size: 1,076 kB
  • ctags: 162
  • sloc: perl: 5,425; makefile: 49; xml: 49
file content (36 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (2)
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
sub ParseFilterFile($)
{
	my $FilterFile = shift;

	my %Filter = ();

	local *FilterFile;
	undef $!;
	open( FilterFile, $FilterFile );
	if ( $! and ( $! !~ m/Inappropriate ioctl for device/i ) )
	{
		error( "erreur d'ouverture du filtre $FilterFile : $!" );
		return ();
	}
	while( my $Line = <FilterFile> )
	{
		$Line =~ s/\r|\n//g;
		if ( $Line )
		{
			my ( $Key, $Value ) = split( /=/, $Line, 2 );
			$Filter{$Key} = $Value;
		}
	}
	close( FilterFile );

	return %Filter;
}

sub DeleteFilterFile($)
{
	my $FilterFile = shift;

	unlink 'generated/Filters/'.$FilterFile.'.flt';
}

1;