|
||||||
| Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Is there a way to split by character in perl?
Say if I read a file and have only one line but I need to get 0-128 as one line, 129-256 as next, etc... Is there a way to do this? |
| Sponsored Links |
|
|
|
|||||
|
You will have to use the substr function to get all 128
Code:
@array_here;
for ($i=0; $i<length(string);$i++)
{
push(@array_here, substr(string,128*i,128);
}
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| printing out into notepad from the html using perl | lichy | Perl | 8 | 12-14-2007 02:06 PM |
| Perl is Dead. Long live Perl. | Kernel | Programming News | 3 | 08-10-2007 11:49 AM |
| need help in counting a specify character in a string. | lichy | Perl | 2 | 06-27-2007 11:03 PM |
| Left Fill in Perl? | Cosmet | Perl | 4 | 02-12-2007 07:19 PM |
| Perl Tutorial Course for Windows | priorityone | Perl | 22 | 02-11-2007 01:57 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%