title: System command not running when called through cgi from Perl
body: <p>I have been stuck for many days where I have a perl script. I have made a function in my CGI File which has some HTML content and a system command to execute a shell script.Then I have an href which calls the perl file which in turn calls the CGI function and shows the content on the browser. But everything is loading except the execution of system command in CGI. I tried to put this system command in my Perl File itself and on execution it is successfully executing the shell script from command line. But I wanted this to happen on a button click so I had to make a CGI call but still I am not able to call it.
  I have been through many questions but I still am looking for the perfect answer.
  Here is my code:
  test1.pl</p>
  
  <pre><code>#!/usr/bin/perl -w
  
  use strict;
  
  use CGI::Carp qw(fatalsToBrowser);
  use Basecamp::UI;
  use Basecamp::Dashboard;
  use Basecamp::Info;
  
  my $cgi = Basecamp::UI-&gt;new-&gt;cgi();
  my $dashboard = Basecamp::Dashboard-&gt;new();
  my @html = $cgi-&gt;tab_ext();
  
  #push @html, '&lt;div class="page"&gt;';
  #push @html, newstuff();
  #push @html, '&lt;/div&gt;';
  #print "Hello Hey";
  #system( ' sh  /home/basecamplocal/Perforce/depot/qeutils/basecamp_dev/sample.sh ');
  
  print $cgi-&gt;begin('Basecamp | ext', $dashboard), $cgi-&gt;begin_page();
  print @html;
  print $cgi-&gt;end_page(), $cgi-&gt;begin_footer(), $cgi-&gt;end_footer(), $cgi-&gt;end();
  </code></pre>
  
  <p>shell script is:</p>
  
  <pre><code>#!/bin/bash
  #perl Basecamp.pl &gt; log_sample.txt
  touch log_sample.txt
  
  echo "Good Day"
  </code></pre>
  
  <p>CGI File Function:</p>
  
  <pre><code>=item tab_ext()
  ======================================================================================
  
          DESC:   Generates appropriate tabs for About, about.pl.
          OUT:    Returns array of scalars with html to draw the tabs and any associated
                          subtabs.
  
  ======================================================================================
  =cut
  sub tab_ext
  {
          my ($self) = @_;
          my $tab = $self-&gt;param('tab');
          my @tabs = ('&lt;li&gt;&lt;a href="test1.pl?tab=New"&gt;Status Restart&lt;/a&gt;&lt;/li&gt;');
          my @subtabs = ();
          my @html = ();
  
          $tabs[0] = '&lt;li class="selected"&gt;&lt;a href="#"&gt;Status Restart&lt;/a&gt;&lt;/li&gt;';
  
          @html = ('&lt;ul id="tabs"&gt;', @tabs, '&lt;/ul&gt;');
  
          push @html, ('&lt;ul id="subtabs"&gt;', @subtabs, '&lt;/ul&gt;');
          print "Content-type: text/html\n\n";
          system("sh /full path to shell file /sample.sh ");
  
  
          return @html;
  
  }
  </code></pre>
  
  <p>and I am calling the test1.pl file on a href call html.The whole html content from CGI is being displayed except the execution of shell script.
  A helping hand would be appreciated.</p>