title: Splitting one txt file into multiple txt files based on delimiter and naming them with a specific character
body: <p>I have a text file that looks like this <a href="http://www.uniprot.org/uniprot/?sort=score&amp;desc=&amp;compress=no&amp;query=id:P01375%20OR%20id:P04626%20OR%20id:P08238%20OR%20id:P06213&amp;format=txt" rel="nofollow noreferrer">http://www.uniprot.org/uniprot/?sort=score&amp;desc=&amp;compress=no&amp;query=id:P01375%20OR%20id:P04626%20OR%20id:P08238%20OR%20id:P06213&amp;format=txt</a>.   </p>
  
  <p>This file is contained of different entries that are divided with //. I think I have almost found the way how to divide txt file into multiple txt files whenever this specific pattern appears, but I still don't know how to name them after dividing and how to print them in specific directory. I would like that each file that is divided carries specific ID which is a first line nut second column in each entry. </p>
  
  <p>This is the code that I have wrote so far:                                                   </p>
  
  <pre><code>mkdir "spliced_files"; #directory where I would like to put all my splitted files
  $/="//\n";             # divide them whenever //appears and new line after this
  open (IDS, 'example.txt') or die "Cannot open"; #example.txt is an input file
  my @ids = &lt;IDS&gt;;
  close IDS;
  my $entry = 25444; #number of entries or //\n characters
  my $i=0;
  while ($i eq $entry) {
    print $ids[$i];
  };
  $i++;
  </code></pre>
  
  <p>I am still having problem with finding how to split all entries from 'example.txt' file whenever "//\n" and to print all this seperated files into directory spliced_files. In addition I would have to name all of these seperated files with the ID that is specific for each of these files or entries (which appears in the first row, but only a second column).</p>
  
  <p>So I expect output to be number of files in spliced_files directory, and each of them are named with their ID (first row, but only second column). For example name of the first file wiould be TNFA_HUMAN, od the second would be ERBB2_HUMAN and so on..)</p>