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
-
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.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.