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
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.