views:

91

answers:

1

How to use Operating System Commands in Catalyst Controller?

For example. I want to use Perl system command in Controller .it’s not working ..

Any idea?

In Controller module

 my $cmd = "/temp/useradd.sh $username_st1 $_ $log_file &";

 system ($cmd );
A: 

The common problems Ive faced were, permission problems. My development server would normally be running as root and web server would be www-data. it would work normally in development server but not over apache/FCGI.

I agree with Robert that its a baad idea to run commands like that. normally there are Perl packages that do most operations you'd want to do through a system.

ninja