C:\Old_Data\perlp>perl try3.pl >>> prd1702 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 746G 3.1T 23% /workspace/data >>> prd1703 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 687G 3.2T 18% /workspace/data >>> prd1701 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 887G 3.0T 13% /workspace/data #### #!/usr/bin/perl use strict; use warnings; use feature 'say'; #https://stackoverflow.com/questions/79472778/sorting-the-content-of-a-file my $s = <>> prd1701 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 887G 3.0T 13% /workspace/data >>> prd1702 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 746G 3.1T 23% /workspace/data >>> prd1703 Filesystem Size Used Avail Use% Mounted on /workspace 3.9T 687G 3.2T 18% /workspace/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.