Forum Moderators: coopster

Message Too Old, No Replies

Php/perl

         

ktsirig

11:14 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



hi all!

I have the following problem: I have a form containing a textarea.
In the textarea, the user supplies his/her data in the form of

>seq1
MGTKGTIGTGRTKGTRGKTRKGTGKTRG

>seq2
RTRTGRGRTGTRGTRGTGTGTRGTVTGTGTRGTRT

etc

I want to pass each pair (containing of >seq and a sequence under it) into variables for a perl script.
Is there a way to do it via PHP? How do you call the perl script in order to feed it the data?

coopster

11:29 pm on Sep 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you are going to pass the data to a perl script, why not just create the form and the process in the same perl script?

In PHP you can take the textarea value and parse it using a regular expression.

$seq = preg_split [php.net]("/\n?>seq\d+\n/", trim($textarea), -1, PREG_SPLIT_NO_EMPTY);