Solved

$variable passing

Posted on 2009-05-10
7
138 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:StephenMcGowan
  • 3
  • 3
7 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 24350166
How are you calling proteindigest.pl?

0
 
LVL 84

Expert Comment

by:ozo
ID: 24350189
Do you get to write proteindigest.pl?
If not, how does it currently like to receive variables?
0
 

Author Comment

by:StephenMcGowan
ID: 24350212
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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
ID: 24350228
if proteindigest.pl starts with
my($var1,$var2,$var3,$var4,$var5,$var6)=@ARGV;

then you can call
system 'proteindigest.pl', $var1,$var2,$var3,$var4,$var5,$var6;
0
 

Author Comment

by:StephenMcGowan
ID: 24350294
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?
0
 
LVL 84

Expert Comment

by:ozo
ID: 24350311
'./proteindigest.pl'
if proteindigest.pl is in the current working directory.
how was ORFfinder.pl invoked?
0
 

Author Comment

by:StephenMcGowan
ID: 24350333
Thanks ozo,

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
collecting information 2 137
PHP equivalent of opening a com object 5 69
Regex rule to match two different url 5 60
Perl Untar File 1 27
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now