My script can not work system using source.
That's because "source" isn't a valid command in your perl's default shell. Use "." instead and it should work fine, as demonstrated below. Although, since you are shelling out there is not really any practical difference between sourcing the script with "." and just executing it (but that's a different question and is likely the X in your XY Problem)
$ cat script.sh echo Woo-hoo! $ cat yang.pl #!/usr/bin/env perl use strict; use warnings; system '. ./script.sh'; $ ./yang.pl Woo-hoo! $
In reply to Re: system & exec
by hippo
in thread system & exec
by dideod.yang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |