Language Selection

English French German Italian Portuguese Spanish

Writing Perl test cases

Filed under
HowTos

If you've ever automated any operations with Perl you'll most likely have written a small script or two, and then left them to run. But how do you know that your code is correct? The answer is to write some test cases and verify they perform correctly. With Perls test facilities this is a simple thing to do.

Most large Perl projects have a test suite, and so do many of the common modules you'll have installed.

To get started we'll look at a simple example. Suppose your script uses some non-standard Perl modules that suggests the very first test you write should verify that those are available. That way if you attempt to run the program upon a new host you'll immediately know whether you need to install these non-standard modules.

Full Article.

More in Tux Machines

today's leftovers

Software: Grafana, Heaptrack, Vim

  • Grafana – An Open Source Software for Analytics and Monitoring
    Grafana is an open source, feature rich, powerful, elegant and highly-extensible analytics and monitoring software that runs on Linux, Windows and MacOS. It is a de facto software for data analytics, being used at Stack Overflow, eBay, PayPal, Uber and Digital Ocean – just to mention but a few. It supports 30+ open source as well as commercial databases/data sources including MySQL, PostgreSQL, Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB. It allows you to dig deeply into large volumes of real-time, operational data; visualize, query, set alerts and get insights from your metrics from differen
  • Heaptrack v1.1.0 release
    Better memory profiling on Linux After more than a year of work, I’m pleased to release another version of heaptrack, the Linux memory profiler! The new version 1.1.0 comes with some new features, significant performance improvements and – most importantly – much improved stability and correctness. If you have tried version v1.0 in the past and encountered problems, update to the new v1.1 and try again!
  • Ten Years of Vim
     

    The philosophy behind Vim takes a while to sink in: While other editors focus on writing as the central part of working with text, Vim thinks it's editing.

     

    You see, most of the time I don't spend writing new text; instead, I edit existing text.

  •  

GNU/Linux: Parrot 4.0, Oregan, Containers and Linux 4.18 Plans

  • Parrot 4.0 is out
    Parrot 4.0 has been released. Parrot is a security-oriented distribution aimed at penetration tests and digital forensics analysis, with additional tools to preserve privacy.
  • Parrot 4.0 release notes
  • Oregan launches SparQ middleware for Linux and Android TV
    Oregan said that the open standards-based offering resolves the differences between the current security and performance requirements of modern-day TV services and the hardware capabilities of STBs that were deployed up to a decade ago.
  • Linux app support coming to older Chrome OS devices
    Linux apps on Chrome OS is one of the biggest developments for the OS since Android apps. Previous reports stated Chromebooks with certain kernel versions would be left in the dust, but the Chrome OS developers have older devices on the roadmap, too. When Google first broke silence on Linux app functionality, it was understood that Linux kernel 4.4 was required to run apps due to dependencies on newer kernel modules. Thanks to an issue found on Chromium’s public bugtracker, we have confirmation that containers won’t be limited to the handful of Chrome OS devices released with kernel 4.4.
  • Looking Ahead To The Linux 4.18 Kernel
    There still are several weeks to go until the Linux 4.17 kernel will be officially released and for that to initiate the Linux 4.18 merge window, but we already know some of the features coming to this next kernel cycle as well as an idea for some other work that may potentially land.

Red Hat and Fedora Leftovers