I have this perl script#!/usr/bin/perluse strict; open my $df, '<', 'file.txt' or die open: $!\n;my %h;while (<$df>) {    $h{$_}++ for split /\s+/;    END{        for (keys %h){            print $_, =, $h{$_};            print \n;        }     } }it prints the occurrence of each word  in the file, I have several questions 1) How can I make this script dynamic by let the user put one argument as a file nameNow:perl script.plwanted:perl script.pl fileName2) How can I sort the output in descending way?NOTE: I want the sort according to the occurrence.
file name as argument and sort in descending way in perl?
scripting;perl
What I would do :#!/usr/bin/perluse strict;my %h;while (<>) {    $h{$_}++ for split /\s+/;    END{        for (sort { $h{$b} <=> $h{$a} } keys %h){            print $_, =, $h{$_};            print \n;        }     }}so :./script input_file