in reply to undefined hash elements

MrTEE:

I don't know how df decides to break the lines up, but if it uses the terminal size, then you might be able to change the terminal width environment variable (COLUMNS, I'd guess) before running it.

$ENV{COLUMNS}=4096; my @array = `df -k`;

If that doesn't work, you could check for the problem and join with the next line if required. For example, you might do something like:

# Fix array: If line is too short, append to previous line { my @tmp; while (@array) { my $line = shift @array; $line .= shift @array if length($line)<50; push @tmp, $line; } @array = @tmp; }

Note: Untested, as I don't have perl on this computer.

...roboticus

When your only tool is a hammer, all problems look like your thumb.