Cristoforo has asked for the wisdom of the Perl Monks concerning the following question:
(Below, the code before fixes noted above)C:\Old_Data\perlp>perl try3.pl >>> prd1702 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 746G 3.1T 23% /wor +kspace/data >>> prd1703 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 687G 3.2T 18% /wor +kspace/data >>> prd1701 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 887G 3.0T 13% /wor +kspace/data
It is printing error as:#!/usr/bin/perl use strict; use warnings; use feature 'say'; #https://stackoverflow.com/questions/79472778/sorting-the-content-of-a +-file my $s = <<EOF; >>> prd1701 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 887G 3.0T 13% /wor +kspace/data >>> prd1702 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 746G 3.1T 23% /wor +kspace/data >>> prd1703 Filesystem Size Used Avail Use% Moun +ted on /workspace 3.9T 687G 3.2T 18% /wor +kspace/data EOF my @data = map {$_[0]} sort {$b->[1] <=> $a->[1]} map {[$_, /\s(\d+)%/]} split(/(?<=workspace\/data)/, $s);
C:\Old_Data\perlp>perl try3.pl Use of uninitialized value in numeric comparison (<=>) at try3.pl line + 23. Use of uninitialized value in numeric comparison (<=>) at try3.pl line + 23.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: schwartzian transform problem - Solved
by johngg (Canon) on Feb 28, 2025 at 11:38 UTC | |
by Cristoforo (Curate) on Feb 28, 2025 at 19:14 UTC | |
by ikegami (Patriarch) on Mar 01, 2025 at 03:44 UTC | |
Re: schwartzian transform problem
by ikegami (Patriarch) on Feb 28, 2025 at 23:03 UTC | |
by etj (Priest) on Mar 01, 2025 at 10:57 UTC | |
by Cristoforo (Curate) on Mar 21, 2025 at 17:59 UTC | |
by choroba (Cardinal) on Mar 21, 2025 at 19:08 UTC | |
by Cristoforo (Curate) on Mar 22, 2025 at 14:36 UTC | |
| |
by ikegami (Patriarch) on Mar 25, 2025 at 23:16 UTC | |
Re: schwartzian transform problem
by Cristoforo (Curate) on Feb 27, 2025 at 20:12 UTC | |
Re: schwartzian transform problem - Solved
by Anonymous Monk on Mar 25, 2025 at 09:20 UTC |