StephenMcGowan
asked on
$variable passing
Hi,
Sorry, it's probably a simple, straight forward question, but one i haven't found the answer to yet.
I'm basically trying to pass six variables created from one script "ORFfinder.pl", to another program "proteindigest.pl". I'd assume it'd be a similar method to passing a variable to a subroutine? if it is at all possible?
Thanks in advance.
Sorry, it's probably a simple, straight forward question, but one i haven't found the answer to yet.
I'm basically trying to pass six variables created from one script "ORFfinder.pl", to another program "proteindigest.pl". I'd assume it'd be a similar method to passing a variable to a subroutine? if it is at all possible?
Thanks in advance.
How are you calling proteindigest.pl?
Do you get to write proteindigest.pl?
If not, how does it currently like to receive variables?
If not, how does it currently like to receive variables?
ASKER
Hi ozo,
Yeah basically what i'm doing is from the programme i wrote before with the longest dna sequences ($longorf1, $longorf2 etc etc), i'm now trying to pass these to a script "proteindigest.pl" which will then call a sub-routine and convert them from dna to protein sequence before doing some more stuff to the sequences.
If i can't transfer the variables from one script to another i should be ok with creating a sub-routine to carry out the same function. Just not sure if script.pl -> script.pl is possible or not?
Yeah basically what i'm doing is from the programme i wrote before with the longest dna sequences ($longorf1, $longorf2 etc etc), i'm now trying to pass these to a script "proteindigest.pl" which will then call a sub-routine and convert them from dna to protein sequence before doing some more stuff to the sequences.
If i can't transfer the variables from one script to another i should be ok with creating a sub-routine to carry out the same function. Just not sure if script.pl -> script.pl is possible or not?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok, so at the very end of ORFfinder.pl i've put:
system 'proteindigest.pl', $longorf1,$longorf2,$longo rf3,$longo rf4,$longo rf5,$longo rf6;
and for proteindigest.pl:
# Initialise variables
my($longorf1,$longorf2,$lo ngorf3,$lo ngorf4,$lo ngorf5,$lo ngorf6)=@A RGV;
but receive the error message:
Can't exec "proteindigest.pl": No such file or directory at ORFfinder.pl line 77.
is there a way of telling it to automatically look in the same directory, if both scripts are in the same directory?
system 'proteindigest.pl', $longorf1,$longorf2,$longo
and for proteindigest.pl:
# Initialise variables
my($longorf1,$longorf2,$lo
but receive the error message:
Can't exec "proteindigest.pl": No such file or directory at ORFfinder.pl line 77.
is there a way of telling it to automatically look in the same directory, if both scripts are in the same directory?
'./proteindigest.pl'
if proteindigest.pl is in the current working directory.
how was ORFfinder.pl invoked?
if proteindigest.pl is in the current working directory.
how was ORFfinder.pl invoked?
ASKER
Thanks ozo,
It's worked a charm.. I had it as ./'proteindigest.pl'; with ./ outside the quotations.
It's worked a charm.. I had it as ./'proteindigest.pl'; with ./ outside the quotations.