title: Executing perl code inside shell script using eval
body: <p>I came across the following example. I tried to google but could not find much so I'm posting this question here.</p>
  
  <ol>
  <li>What is the benefit of executing the perl script like this?</li>
  <li>How can we make the shell script work like a "normal" shell script once we are through executing the perl code?</li>
  </ol>
  
  <p>Here's the code:</p>
  
  <pre><code>#!/bin/ksh
  #! -*- perl -*-
  eval 'exec $PERLLOCATION/bin/perl -x $0 ${1+"$@"} ;'
  if 0;
  
  print "hello world\n";
  # how can I make it behave like a "normal" shell script from this point onwards? What needs to be done?
  # echo "hello world" ### this results in error
  </code></pre>