Referencing Perl

This blog is created to share perl resources all round the world and to explore the same.

Name:
Location: Chennai, TamilNadu, India

A Computer Freak, interested in programming open source

Thursday, November 17, 2005

string common to 2 strings



The solution



sub common {
if ( $_[0] eq $_[1] ) {
return( $_[0], "", "" );
} else {
use bytes;
my ( $pos, $len0, $len1 ) = ( 0, length($_[0]), length($_[1]) );
# find the offset of the first byte that differs
while ( vec($_[0], $pos, 8) == vec($_[1], $pos, 8) ) {
$pos++;
last unless ( $pos < $len0 && $pos < $len1 ); }

return( unpack("a${pos}", $_[0]),
unpack("x${pos}a*", $_[0]),
unpack("x${pos}a*", $_[1]), ); } }


Another Solution is



sub common {
my ($a,$b)=@_;
my ($long,$short);
if (length ($a) <= length ($b))
{
($long,$short) = ($b,$a); }
else {
($long,$short) = ($a,$b); }
my $i=0;
my $common="";
while ($i < str =" substr($short,$i,1);"
t="$i;"
long="~/$str/);" long="~/$str/)"
uni =" substr($short,$t,1));" long="~m/$str$uni/);" common =" $str">



--Prasanna.K


14 Comments:

Blogger edericks05995142 said...

Make no mistake: Our mission at Tip Top Equities is to sift through the thousands of underperforming companies out there to find the golden needle in the haystack. A stock worthy of your investment. A stock with the potential for big returns. More often than not, the stocks we profile show a significant increase in stock price, sometimes in days, not months or years. We have come across what we feel is one of those rare deals that the public has not heard about yet. Read on to find out more.

Nano Superlattice Technology Inc. (OTCBB Symbol: NSLT) is a nanotechnology company engaged in the coating of tools and components with nano structured PVD coatings for high-tech industries.

Nano utilizes Arc Bond Sputtering and Superlattice technology to apply multi-layers of super-hard elemental coatings on an array of precision products to achieve a variety of physical properties. The application of the coating on industrial products is designed to change their physical properties, improving a product's durability, resistance, chemical and physical characteristics as well as performance. Nano's super-hard alloy coating materials were especially developed for printed circuit board drills in response to special market requirements

The cutting of circuit boards causes severe wear on the cutting edge of drills and routers. With the increased miniaturization of personal electronics devices the dimensions of holes and cut aways are currently less than 0.2 mm. Nano coats tools with an ultra thin coating (only a few nanometers in thickness) of nitrides which can have a hardness of up to half that of diamond. This has proven to increase tool life by almost ten times. Nano plans to continue research and development into these techniques due to the vast application range for this type of nanotechnology

We believe that Nano is a company on the move. With today�s steady move towards miniaturization we feel that Nano is a company with the right product at the right time. It is our opinion that an investment in Nano will produce great returns for our readers.

Online Stock trading, in the New York Stock Exchange, and Toronto Stock Exchange, or any other stock market requires many hours of stock research. Always consult a stock broker for stock prices of penny stocks, and always seek proper free stock advice, as well as read a stock chart. This is not encouragement to buy stock, but merely a possible hot stock pick. Get a live stock market quote, before making a stock investment or participating in the stock market game or buying or selling a stock option.

8:59 PM  
Blogger matthewprehiem3539 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

7:06 AM  
Blogger davidmiller9479708216 said...

While you read this, YOU start to BECOME aware of your surroundings, CERTIAN things that you were not aware of such as the temperature of the room, and sounds may make YOU realize you WANT a real college degree.

Call this number now, (413) 208-3069

Get an unexplained feeling of joy, Make it last longer by getting your COLLEGE DEGREE. Just as sure as the sun is coming up tomorrow, these College Degree's come complete with transcripts, and are VERIFIABLE.

You know THAT Corporate America takes advantage of loopholes in the system. ITS now YOUR turn to take advantage of this specific opportunity, Take a second, Get a BETTER FEELING of joy and a better future BY CALLING this number 24 hours a day.
(413) 208-3069

10:21 PM  
Anonymous Anonymous said...

Good day !.
You re, I guess , perhaps curious to know how one can reach 2000 per day of income .
There is no initial capital needed You may commense earning with as small sum of money as 20-100 dollars.

AimTrust is what you thought of all the time
The company incorporates an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

Its head office is in Panama with structures everywhere: In USA, Canada, Cyprus.
Do you want to become an affluent person?
That`s your choice That`s what you really need!

I feel good, I began to take up real money with the help of this company,
and I invite you to do the same. It`s all about how to choose a correct companion utilizes your money in a right way - that`s AimTrust!.
I take now up to 2G every day, and what I started with was a funny sum of 500 bucks!
It`s easy to get involved , just click this link http://jifobizi.kogaryu.com/otufahut.html
and go! Let`s take this option together to feel the smell of real money

8:13 PM  
Anonymous Anonymous said...

Hi there!
I would like to burn a theme at this forum. There is such a thing, called HYIP, or High Yield Investment Program. It reminds of financial piramyde, but in rare cases one may happen to meet a company that really pays up to 2% daily not on invested money, but from real profits.

For several years , I earn money with the help of these programs.
I'm with no money problems now, but there are heights that must be conquered . I get now up to 2G a day , and I started with funny 500 bucks.
Right now, I'm very close at catching at last a guaranteed variant to make a sharp rise . Visit my blog to get additional info.

http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

8:06 AM  
Anonymous Anonymous said...

Good day, sun shines!
There have been times of troubles when I didn't know about opportunities of getting high yields on investments. I was a dump and downright pessimistic person.
I have never imagined that there weren't any need in big starting capital.
Nowadays, I feel good, I started to get real income.
It's all about how to choose a correct partner who utilizes your money in a right way - that is incorporate it in real business, and shares the profit with me.

You may ask, if there are such firms? I have to tell the truth, YES, there are. Please get to know about one of them:
http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

6:58 PM  
Anonymous Anonymous said...

reside in numbing this gratis [url=http://www.casinoapart.com]casino[/url] perk at the unsurpassed [url=http://www.casinoapart.com]online casino[/url] criterion with 10's of all the transmit on [url=http://www.casinoapart.com]online casinos[/url]. guide to the utmost on before [url=http://www.casinoapart.com/articles/play-roulette.html]roulette[/url], [url=http://www.casinoapart.com/articles/play-slots.html]slots[/url] and [url=http://www.casinoapart.com/articles/play-baccarat.html]baccarat[/url] at this [url=http://www.casinoapart.com/articles/no-deposit-casinos.html]no tip off casino[/url] , www.casinoapart.com
the finest [url=http://de.casinoapart.com]casino[/url] pro UK, german and all on climax of the world. so after the insigne [url=http://es.casinoapart.com]casino en linea[/url] discontinuity us now.

7:03 AM  
Anonymous Anonymous said...

When your stomach is crying out for food, it's all you're going
to have the ability to take into consideration
so by having the urge for food suppressant there that can assist you treatment this,
it is possible for you to to turn your focus and focus back
to other areas of your life your profession, your training, and your
relationships. It is produced of numerous ingredients that perform independently to assist you shed bodyweight quickly
and successful, but is Phen375 secure for human usage. Next to shedding
weight, here are additional effects essential to Phen375
fat burner like effectiveness of product, general safety and many more.
Here is my blog :: phen375 reviews 2012

4:51 PM  
Anonymous Anonymous said...

Condoms and femidoms can slip or tear and even a long-term partner can.
And "do you ever think" means "would you obtain involved again inside a relationship, even though you ended it. The webs hottest live sex chat cam girls.

Feel free to surf to my website english xxx

6:52 PM  
Anonymous Anonymous said...

Fantastic website you have here but I was curious about if you knew of any discussion boards that cover the
same topics talked about here? I'd really like to be a part of community where I can get feed-back from other knowledgeable people that share the same interest. If you have any suggestions, please let me know. Kudos!

Here is my page small buisness listings

5:20 AM  
Anonymous Anonymous said...

In addition to the, metabolism accelerators may also be a great help.
The other plus to replacing the same with fat burning is that it can appear far more enjoyable.
Phen375 is really a pharmaceutical grade fat burning supplement that synthesizes your hormones to burn off fat faster leading to an elevation in energy and mental alertness as well.


Also visit my page - phen375 fat burner
My web page - phen375 fat burner

9:23 PM  
Anonymous Anonymous said...

Most performers who spend about 20 hours online earn at least $500-1,000+ per
week. During free chat, models are usually scantily clad.
If you have a bit of exibitionist side, it might be
a perfect match for you.

Here is my web site: free xxx webcams

9:41 PM  
Anonymous Anonymous said...

This gives you the assurance that the supplement is safe and of high quality.
You need to come up with a diet plan that can keep you eating
the proper volume of calories each day. For that reason what negative
effects could Phen375 have.

Check out my blog phen375 reviews 2012

1:01 AM  
Anonymous Anonymous said...

You have made some good points there. I checked on the internet for additional information about the issue and
found most individuals will go along with your views on this web site.


Feel free to visit my homepage bmi chart for men

11:44 AM  

Post a Comment

<< Home