RE: matching on a variable

2001-07-30 Thread Peter Cornelius
> How can I test whether a person's name (which is the variable called > $vars::name) is in a particular file ( "links.dat")? The > file is simply a > list of names all separated by the newline character, i.e, > > Harry\n > Joe\n > Jane Doe\n > > When I change my pattern-to-match to the litera

Re: matching on a variable

2001-07-30 Thread Lisa Nyman
Hi, Have you printed the variable $vars::name to be sure it contains what you think it does? Also, try the grep command: open(LINKS, "$statedir/links.dat") or die "Error at LINKS: $!\n" my @all_matches = grep (/$vars::name/, ); &print_link (@all_matches) You can use arguments to grep to get in

Re: matching on a variable

2001-07-30 Thread fliptop
[EMAIL PROTECTED] wrote: > > ### > open(LINKS, "$statedir/links.dat") || die "Error at LINKS: $!"; > @people = ; > $pattern_to_match = "$vars::name"; #$vars::name is Harry, but the code where are you declaring $vars::name? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

matching on a variable

2001-07-30 Thread sabrina
Hi List, How can I test whether a person's name (which is the variable called $vars::name) is in a particular file ( "links.dat")? The file is simply a list of names all separated by the newline character, i.e, Harry\n Joe\n Jane Doe\n When I change my pattern-to-match to the literal string I'