Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > Perl

Perl Discussion for the PERL language - Practical Extraction and Reporting Language, is a programming language often used for creating CGI programs.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-21-2006, 02:51 PM
Cosmet Cosmet is offline
Learning Programmer
 
Join Date: Oct 2006
Posts: 58
Rep Power: 8
Cosmet is on a distinguished road
Default PERL - Split by Character

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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-23-2006, 10:56 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,228
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

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);
}
Hope that helps.
__________________
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-30-2006, 02:03 PM
falco85 falco85 is offline
Programmer
 
Join Date: Apr 2006
Posts: 105
Rep Power: 10
falco85 is on a distinguished road
Default

Is perl still being used??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT -5. The time now is 03:55 PM.

Contest Stats

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

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads