[go: up one dir, main page]

File: code.pl

package info (click to toggle)
libgetargs-long-perl 0.1.3-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 120 kB
  • ctags: 15
  • sloc: perl: 617; makefile: 44
file content (43 lines) | stat: -rw-r--r-- 746 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
37
38
39
40
41
42
43
#
# $Id: code.pl,v 0.1.1.1 2001/03/02 17:59:48 ram Exp $
#
#  Copyright (c) 2000-2001, Raphael Manfredi
#  
#  You may redistribute only under the terms of the Artistic License,
#  as specified in the README file that comes with the distribution.
#
# HISTORY
# $Log: code.pl,v $
# Revision 0.1.1.1  2001/03/02 17:59:48  ram
# patch1: added.
#
# Revision 0.1  2001/03/01 14:46:55  manfredi
# Initial revision.
#
# $EndLog$
#

sub ok {
	my ($num, $ok) = @_;
	print "not " unless $ok;
	print "ok $num\n";
}

sub contains {
	my ($file, $pattern) = @_;
	local *FILE;
	local $_;
	open(FILE, $file) || die "can't open $file: $!\n";
	my $found = 0;
	while (<FILE>) {
		if (/$pattern/) {
			$found = 1;
			last;
		}
	}
	close FILE;
	return $found;
}

1;