title: How to format /etc/passwd file using perl formatting
body: <p>I'm trying to format the /etc/passwd file by using perl formatting</p>
  
  <p>This is what I have come up with so far:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use warnings;
  
  format MYFORMAT =
  @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;| @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;| @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;
  $username,        $UID,             $name
  .
  
  $username = `cut -d: -f1 /etc/passwd`;
  $UID = `cut -d: -f3 /etc/passwd`;
  $name = `cut -d: -f5 /etc/passwd`;
  
  $~ = "MYFORMAT";
  write;
  </code></pre>
  
  <p>I receive no warnings or errors. The formatting works, but the issue is, it only displays the first line of the etc/passwd file. I only get root, 0, and root as the Username, UID and name respectively.</p>
  
  <p>I need all usernames, UIDs, and names printed for each column. I don't know what I'm doing wrong, because when I run the bash command to get only the usernames inside the terminal, it displays all of them. It won't do it inside of the script though.</p>