Perl is a widely used general-purpose programming language. It offers great services, including text manipulation, GUI development, and much more.
There were many enhancements from the Perl 5.32.0
release and the 5.34.0
release. Click here for a full list of differences between the two versions.
In this shot, let’s talk about the new octal syntax in Perl 5.34.0
.
The update to v5.34.0
introduces a new way to specify 0o
as a prefix. For example, 0o1236
is an octal number in Perl.
We can use the built in method
oct()
to convert octal values to corresponding decimal values. Thisoct()
also accepts the octal parameter using this new octal syntax.
Previously, octal numbers were declared as follows:
0466
(Numbers that begin with 0).
Alternatively, in this new method, the numbers can be initialized as
0o1236
using the 0o
prefix.