in reply to Getting rid of (.*) from a not-quite-complex regex.

my ($ptid, $total, $used, $avail, $pct, $mp) = split /\s+/, $element, +6;
Also unpack would be natural for this.

Replies are listed 'Best First'.
Re: Re (tilly) 1: Getting rid of (.*) from a not-quite-complex regex.
by Anonymous Monk on Feb 05, 2001 at 08:16 UTC
    You don't want to assume "fixed-width" columns; if the numbers are large then the format breaks. The whitespace is normally more consistent. Hey, is there a perl interface to statfs(2)?