use strict; use warnings; use Data::Dumper; my @users; while (<DATA>) { m#^\s*(?<login>[\w-]+) :x :(?<uid>\d+) :(?<gid>\d+) :(?<name>[\w\s(),-]*) :(?<home>[\w/]+) :(?<shell>[\w/]*)$#x or die "Malformed input [$_]"; push @users, { %+ }; } print Dumper \@users; __DATA__ root:x:0:0::/:/usr/bin/ksh paul:x:201:1::/home/paul:/usr/bin/ksh jdoe:x:202:1:John Doe:/home/jdoe:/usr/bin/ksh
In reply to Re^2: Getting rid of a temporary variable in AoH
by Arunbear
in thread Getting rid of a temporary variable in AoH
by reisinge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |