good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
regex syntax and idomatic Perlby cbeckley (Curate) |
on Mar 21, 2017 at 02:32 UTC ( [id://1185300]=perlquestion: print w/replies, xml ) | Need Help?? |
cbeckley has asked for the wisdom of the Perl Monks concerning the following question: I have input from a "df -k /home" that looks like this:
And a function that parses it for the capacity (creatively named no less):
This works. I should be done right? Noooo, I'm looking for a more idiomatic way to rewrite the "if regex" for purely aesthetic reasons. I tried:
Which returns 'Match Error' every time.
Why does the ternary statement not work?
Thanks,
Back to
Seekers of Perl Wisdom
|
|