1

I want to call the perl script through the another perl script. I have used,

system('/home/arun/title_verifier.pl');

but it throws,

sh: 1: /home/arun/title_verifier.pl: Permission denied

So how can i make it...

4
  • Do you (or the perl script executing) have +x right on the .pl file? Commented Nov 22, 2012 at 6:37
  • "+x" means, cant get you? sorry. Commented Nov 22, 2012 at 6:39
  • 1
    Each linux file has file permissions (do ls -al to see them). The basic ones are +rwx, meaning "read permission", "write permission", "execute permission". If a file has +x, you can execute it (call it using its filename, /home/arun/title_verifier.pl. If it does not have +x, you cannot execute it as a program, but you can have another program use it as input for executing, in this example with perl /home/arun/title_verifier.pl Commented Nov 22, 2012 at 7:47
  • Thank you...its a good learning to me. Commented Nov 23, 2012 at 5:33

2 Answers 2

11

Make sure the Perl script has execute permission

chmod +x /home/arun/title_verifier.pl

or invoke the script with perl

system('perl /home/arun/title_verifier.pl');
Sign up to request clarification or add additional context in comments.

Comments

0

Also you may run it not with environment perl, but with perl your script was run

system($^X, "/home/arun/title_verifier.pl") == 0 or die "$!";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.