Link to home
Start Free TrialLog in
Avatar of StephenMcGowan
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.
Avatar of Tintin
Tintin

How are you calling proteindigest.pl?

Do you get to write proteindigest.pl?
If not, how does it currently like to receive variables?
Avatar of StephenMcGowan

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?
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, so at the very end of ORFfinder.pl i've put:

system 'proteindigest.pl', $longorf1,$longorf2,$longorf3,$longorf4,$longorf5,$longorf6;

and for proteindigest.pl:

# Initialise variables

my($longorf1,$longorf2,$longorf3,$longorf4,$longorf5,$longorf6)=@ARGV;

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?
Thanks ozo,

It's worked a charm.. I had it as ./'proteindigest.pl'; with ./ outside the quotations.