#!/usr/bin/perl
use FileHandle;
format My_Top_Format =
Passwd File
Name Login Office Uid Gid Home
------------------------------------------------------------------------------------------------------------------
.
format My_Format =
@<<<<<<<<<<<<<< @||||||||||||||||| @<<<<<<<<<<<<<<<<< @>>>>>>>> @>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name, $login, $office, $uid, $gid, $home
.
STDOUT->format_name ("My_Format");
STDOUT->format_top_name ("My_Top_Format");
open(FILE, "/etc/passwd");
while ()
{
($name,$uid, $gid,$office,$home,$login) = /^(\w+):x:(\d+):(\d+):(.*?):(.*?):(.*?)$/;
write STDOUT;
}
exit 0;