title: Detect if back button has been clicked using Perl
body: <p>I have seen people post about this question online but they were either using JavaScript or a different language.  Is there a way in Perl to detect if the user has clicked the back button?</p>
  <pre><code>               print &quot;&lt;form&gt;&quot;;
              my $back_button_check = &quot;Y&quot;;
              print qq{&lt;input type=hidden name=&quot;backCheck&quot; value=&quot;$back_button_check&quot;&gt;};
              print qq{&lt;button type=&quot;Button&quot; class=&quot;inner&quot; value=&quot;Back&quot; onclick=&quot;history.back()&quot;&gt;Back&lt;/button&gt;};
              print &quot;&lt;/form&gt;&quot;;
  </code></pre>
  <p>Then on the previous page I will check for this variable.  However, this doesn't work but I'm looking to check if the user has clicked the back button because I am collecting user data.  If the user goes back a page and changes something then goes forward again, I want to update my mysql query with any changes they have made.</p>
  <p>Is there a way in Perl to tell if the user has clicked the back button?</p>