[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Thu Jan 20 16:16:16 2005 -->
- <!--x-from-r13: xrvgu.jngfba ng tgev.tngrpu.rqh (Yrvgu D. Ingfba) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Perl Split Question -->
- <li><em>date</em>: Thu Jan 20 16:16:16 2005</li>
- <li><em>from</em>: keith.watson at gtri.gatech.edu (Keith R. Watson)</li>
- <li><em>in-reply-to</em>: <<a href="msg00826.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Perl Split Question</li>
Assuming your not doing word wrapping in Perl
#!c:\perl\bin\perl.exe -w
use strict;
my $string ='1a2b3c4d5e6f7g8h9i';
my $string_length = length ($string);
my $segment_size = 3;
my $segment;
for (my $offset = 0; $offset <= $string_length; $offset += $segment_size) {
$segment = substr ($string, $offset, $segment_size);
print ($segment, "\n");
}
keith
-------------
Keith R. Watson GTRI/ISD
Systems Support Specialist III Georgia Tech Research Institute
keith.watson at gtri.gatech.edu Atlanta, GA 30332-0816
404-894-0836
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00828" href="msg00828.html">[ale] Perl Split Question</a></strong>
<ul><li><em>From:</em> keith.watson at gtri.gatech.edu (Keith R. Watson)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00826" href="msg00826.html">[ale] Perl Split Question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00826.html">[ale] Perl Split Question</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00828.html">[ale] Perl Split Question</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00826.html">[ale] Perl Split Question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00828.html">[ale] Perl Split Question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00827"><strong>Date</strong></a></li>
<li><a href="threads.html#00827"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>