Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem in calling an external script with system() 1

Status
Not open for further replies.

aSDDSasdas

Programmer
Jul 12, 2006
19
AT
Hello everyone i have the following script (extract.pl)
#!/usr/bin/perl

# Purpose : This Program is used to extract a substring from a String
#use warnings;

scalar @ARGV ==2 or die "usage : There must be only 2 arguments";

my ($eingabe,$muster) = @ARGV;



my $index = index($eingabe,$muster);

$portion= substr($eingabe,0,$index-1);

print $portion;


and now i have another script(temp.pl) trying to call extract.pl . somehow the system call doesnt seem to work..in this case it should atleast return an error statement which it doesnt give. Does anyoone know where the problem here exactly is ?

#!/usr/bin/perl

#use strict;

system('extract.pl');

thank u in advance
 
perhaps try with full path name:
system('/path/to/extract.pl');
 
i tried it out with the absolute path and it doesnt seem to work either.
 
I copied and pasted your script and tried. Your original version did not work for me either.
It did work when I added full path name.
[ponder]
May I suggest you double-check for typos? Or maybe missing permissions?
 
yeah thank u...the permissions were missing thats y it wasnt working

thank u
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top