Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: regex syntax and idomatic Perl

by cbeckley (Curate)
on Mar 21, 2017 at 14:02 UTC ( #1185355=note: print w/replies, xml ) Need Help??


in reply to Re: regex syntax and idomatic Perl
in thread regex syntax and idomatic Perl

Ah, that's very cool:

my $match = my ($fsys, $kb, $used, $avail, $cap, $mtd) = $df_output =~ m{\A (.+) \s+ (\d+) \s+ (\d+) \s+ (\d+) \s+ (\d+) % \s+ +(.+) \z}xms;

I didn't know match could be used in a list context like that. Chaining the scalar assignment is a nice touch.
Thank you.

Thanks,
cbeckley

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1185355]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2020-05-26 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?