Hi All,
Thanks for the ideas you gave which made me to make some satisfiable code ( of course to me alone and does not matches your standards )
Here is my modiefied version which tells how many iterations is the code taking to reach from start to the letter typed.
print"key in any 4 alpha char :";
chomp($string_name=<STDIN>);
for($i='aaaa',$c=0;$i le $string_name;++$i,++$c){}
print"$string_name is the $c th value starting from a\n";
Please run this piece and let me know how do I make it generic instead of constraining it to four alpachar alone as in the above code.
Regards
prad 2005-09-13 Retitled by holli, as per Monastery guidelines Original title: 'Modified : String Increment'
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|