Re: Test if string does not exist in an array.

2007-07-27 Thread Chas Owens
On 7/27/07, snickwad [EMAIL PROTECTED] wrote: snip Not sure of the installation details, as perldoc does nothing. snip Happily, you can read it online: http://perldoc.perl.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Test if string does not exist in an array.

2007-07-27 Thread snickwad
Thanks for the resonses and apologies for the lack of script, and the glaring typo : The area of code for the test is currently - open(ULIST,/etc/passwd) or die Could not open /etc/passwd; @udata=ULIST; close(ULIST); sub check_details { return 1 if (grep(/$user/,@udata)); } So the script is

Re: Test if string does not exist in an array.

2007-07-26 Thread yaron
Hi, Perl has a built in function that do just that: if (my $username = getpwuid($input_uid)) { print Founf the user $username\n; } else { print No user found\n; } for help try perldoc -f getpwent perldoc -f getpwnam perldoc -f getpwuid BFN Yaron Kahanovitch - Original Message

Re: Test if string does not exist in an array.

2007-07-26 Thread Paul Lalli
On Jul 26, 7:14 am, [EMAIL PROTECTED] (Snickwad) wrote: Apologies if this is a bit noobie, As a newbie, you may not be aware that Perl comes with a built-in FAQ. You can see the whole thing by typing at your command window: perldoc perlfaq But the specific question you care about is: $ perldoc

Test if string does not exist in an array.

2007-07-26 Thread snickwad
Apologies if this is a bit noobie, but I have been left with a short window to write a tool and I have had no experience with Perl. Very familiar with Kornshell, and so far my Perl script is going okay. However, I am struggling to get a test working correctly. Is there a simple way to test if a

Re: Test if string does not exist in an array.

2007-07-26 Thread Chas Owens
On 7/26/07, snickwad [EMAIL PROTECTED] wrote: Apologies if this is a bit noobie, but I have been left with a short window to write a tool and I have had no experience with Perl. Very familiar with Kornshell, and so far my Perl script is going okay. However, I am struggling to get a test working