Recent additions to CPAN
Healthy in Old Age
Many people have declared the granddaddy of scripting, Perl, to be dead. A look at new items in the CPAN software repository, however, shows that the community is still quite active.
To paraphrase Friedrich Nietzsche, and may I be forgiven for doing so, "When Zarathustra was alone, however, he spoke thus to his heart: Is it possible? This old saint has not yet heard in his forest that Perl is dead!"
No question: Perl as a programming language has lost some of its significance. Few youngsters today have enough patience to grapple with the admittedly whimsical peculiarities of what used to be the leading scripting language. For years, many users have been moving off in various directions. This does not seem to affect the will of diehard Perl hackers, however. Hardly a day goes by without 50 new module versions appearing on CPAN [1] (Figure 1).
This edition of my column accesses some of the most useful and entertaining modules I stumbled upon while reviewing what the Perl community has released in the past two weeks.
The King's Speech
Converting written text into spoken words requires a speech synthesizer – algorithmically, this is clearly top-level computer science that takes a lot of brain and computing power. Instead of struggling with this itself, the CPAN Speech::Google::TTS module [2] hooks into the multibillion dollar infrastructure of the Google Group by misusing the http://translate.google.com site, where Google provides word-for-word translations of typed text phrases.
But, there's more: At the bottom of the text box is a loudspeaker icon; when clicked, a computer voice dictates the pasted text (Figure 2). The module used in Listing 1 [3] intercepts the sound output and saves it as a .wav
file in the /tmp
directory. The as_filename()
method shows the associated file name, and a call to the MPlayer binary in line 9 plays the spoken text.
Listing 1
text2speech
The language is set in line 7 to en
for US English. If you have always wanted to end a tough build job acoustically with a crisp "Finish up your coffee break and get back to work!" command, the script now gives you the opportunity to do so. The module also requires the MPlayer package (or a different audio player like mpg123), which Ubuntu installs via apt-get install
.
Analyzing Makefiles
You may have experienced that sense of despair when faced with a complicated makefile. The make syntax is not easily understandable, and if a target happens to depend on three others and each of those depends on …, then it can be very difficult to figure out where a potential bug is hiding. The CPAN GraphViz::Makefile module [4] sets out to visualize the dependencies between make targets with the Graphviz package.
In fairness, it must be said that currently GraphViz::Makefile only correctly visualizes toy makefiles: Once the syntax exceeds a certain complexity, the graphs it generates look like a haystack hit by a tornado. However, the makefile (Listing 2) used in the make tutorial [5] for training purposes was neatly processed by GraphViz::Makefile, as the graph generated in Listing 3 shows (Figure 3).
Listing 2
Makefile
Listing 3
make2viz
The Path to PNG
To do this, the constructor in GraphViz::Makefile in line 6 of Listing 3 first accepts an optional GraphViz
object. If the parameter is set to undef
, GraphViz::Makefile generates its own Graphviz object. The second parameter is set to Makefile
, that is, it finds the Makefile in the current directory.
To generate the graph for a target, the generate()
method in line 9 accepts the name of the target (in Listing 2, this is all
). From here on, the graph is plotted. At the happy ending, the GraphViz->as_png()
method saves the graph as makefile.png
(Figure 3). The module may be still in its infancy, but its basic concept is quite compelling.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.