CSharma has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl $x = 10; $y = 0010; $y =~ s/^0+//; ##OR $y += 0; if($x == $y) { print $x . " and " . $y . " are equal\n"; } else { print $x . " and " . $y . " aren't equal\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: removing leading 0's
by AnomalousMonk (Archbishop) on Oct 03, 2015 at 16:06 UTC | |
|
Re: removing leading 0's
by RichardK (Parson) on Oct 03, 2015 at 15:59 UTC | |
|
Re: removing leading 0's
by karlgoethebier (Abbot) on Oct 03, 2015 at 17:01 UTC | |
|
Re: removing leading 0's
by BillKSmith (Monsignor) on Oct 04, 2015 at 02:05 UTC |