From: missoula on
$string1 eq $string2

will the above just compare the first letter of the 2 strings or
compare the whole string.

From: John Bokma on
"missoula" <rva_ec(a)yahoo.com> wrote:

> $string1 eq $string2
>
> will the above just compare the first letter of the 2 strings or
> compare the whole string.

If in doubt *always* check the documentation. Don't waste time of other
people.

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

From: Sherm Pendley on
"missoula" <rva_ec(a)yahoo.com> writes:

> $string1 eq $string2
>
> will the above just compare the first letter of the 2 strings or
> compare the whole string.

The whole string. If you want to compare just the first character of two
strings, one way is to use eq and substr together:

if (substr($string1,0,1) eq substr($string2,0,1)) {
# First characters match.
}

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org