Challenge 2: Numeric vs String Comparison — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; my $a = "07"; my $b = "7"; say $a == $b ? "numeric: equal" : "numeric: not equal"; say $a eq $b ? "string: equal" : "string: not equal"; # They disagree because == forces both sides into NUMERIC context # first, and the number 07 is the same value as the number 7 (leading # zero has no numeric meaning) — but eq compares them as literal # STRINGS, and the characters "07" and "7" are not identical text. Output: numeric: equal string: not equal WHY THIS WORKS AS AN ANSWER ------------------------------ $a == $b reuses the chapter's own numeric comparison operator directly — per Chapter 2's string-number duality, the strings "07" and "7" are both converted to numbers before comparing, and numerically, 07 and 7 are the exact same value, so == correctly reports them equal. $a eq $b reuses the chapter's own string comparison operator — eq compares the two values as literal TEXT, character by character, with no numeric conversion at all. "07" and "7" are different sequences of characters (one has an extra leading "0"), so eq correctly reports them as not equal. This is precisely the chapter's own core point about Perl's split operator sets: the SAME two values can be "equal" or "not equal" depending entirely on which comparison operator is used, because == and eq are asking fundamentally different questions (are these the same NUMBER vs are these the same TEXT) rather than one operator trying to guess which comparison was intended.