![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl -write values in a file to @array in perl | meghana | Shell Programming and Scripting | 12 | 07-17-2008 01:38 PM |
| [PERL] Running unix commands within Perl Scripts | userix | Shell Programming and Scripting | 1 | 05-28-2008 03:06 PM |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 3 | 02-06-2007 08:17 PM |
| Perl: Run perl script in the current process | vino | Shell Programming and Scripting | 10 | 12-09-2005 07:45 AM |
| Replace Perl Module name in all Perl scripts | rahulrathod | Shell Programming and Scripting | 2 | 12-01-2005 10:00 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
help in perl
Hi,
I have a small doubt regarding my program. Hope you will help me in solving that. Example: $a="agaaaagavvgglggy" $b=<STDIN>; let the input seq is "ttttttttttagaaaagavtttggyttttttt"; here the input matches with $a only with the letters in bold : ttttttttttagaaaagavtttggyttttttt i want to know what we can do to give input showing both matches and mismatches in the input.(mismatch shold me shown as a hiphen) That means the output should be like this: The given sequence matches with the pattern at - - - - - - - - - - agaaaagav- - -ggy - - - - - - - Hope you will help me in solving out this. Thanks in advance, siri |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Jus try out this . I am trying "aga" as the string to match.
#!/usr/bin/perl -w $a="aga"; print "input string : \n"; $b=<STDIN>; if ( $b=~/($a)/ ) { print "matched part: $1 \n"; print " part before matched $` \n"; print " part after matched $' "; } |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|