Skip to content

Instantly share code, notes, and snippets.

@leszekdubiel
Created February 9, 2019 20:26
Show Gist options
  • Save leszekdubiel/46aa24388b067bc31c2e758ace6f3f51 to your computer and use it in GitHub Desktop.
Save leszekdubiel/46aa24388b067bc31c2e758ace6f3f51 to your computer and use it in GitHub Desktop.
printf "\tname John\tage 24\t\ncity Kraków\tname Ann\tabout works here\tage 45\n\tspeaks Polish\tname Leszek\t\r\v\b\t\tnote malformed line still works\n" | perl -e 'use utf8; use Modern::Perl qw{2017}; use Data::Dumper; no warnings qw{uninitialized}; while (<STDIN>) { my %h = map { split / /, $_, 2 } grep { / / } split /[^[:print:]]/, $_, -1; 0 && warn Dumper(\%h); print "\t$_ $h{$_}" for @ARGV ? @ARGV : sort keys %h; print "\t\n"; }' name age about
@leszekdubiel
Copy link
Author

O! Thank you... I think I didn't get email that you have commented. I will test that too.
:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment