title: How to convert text file to JSON data in perl?
body: <p>I have a file name in perl . I want to convert this file to JSON data . Is that possible in perl?</p>
  
  <pre><code>sub conversion {
    my($p)=@_;
    my $f = $p-&gt;{file};
    open(FIN,"&lt;/pathtofile/$f");
    # now i want to convert this opened file into json 
    # something like encode_json(&lt;FIN&gt;);
    # is that possible?
  }
  </code></pre>
  
  <p>file content sample:</p>
  
  <pre><code>Header   Name Type  Altitude     Depth       
  Waypoint 001  User  N12 58.441   E77 32.647                                 
  Waypoint 002  User N13 00.503    E77 41.714 
  Waypoint 003  User N13 00.856    E77 42.054                             
  </code></pre>