Chopping strings

2003-02-19 Thread papapep
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 How should I do to split a long string that the only thing I know is that is a multiple of a previous defined number (for example 26). A graphic example:

Re: Chopping strings

2003-02-19 Thread Jenda Krynicky
From: papapep [EMAIL PROTECTED] How should I do to split a long string that the only thing I know is that is a multiple of a previous defined number (for example 26). A graphic example: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr

Re: Chopping strings

2003-02-19 Thread John W. Krahn
Papapep wrote: How should I do to split a long string that the only thing I know is that is a multiple of a previous defined number (for example 26). A graphic example: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz That's four

Re: Chopping strings

2003-02-19 Thread John W. Krahn
Jenda Krynicky wrote: while ($long_string ne '') { my $chunk = substr( $long_string, 0, 26); substr( $long_string, 0, 26) = ''; Or just: my $chunk = substr( $long_string, 0, 26, '' ); But that is inefficient because you modify the beginning of the string on each

RE: Chopping strings

2003-02-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
John W. Krahn wrote: Papapep wrote: How should I do to split a long string that the only thing I know is that is a multiple of a previous defined number (for example 26). A graphic example: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx

Re: Chopping strings

2003-02-19 Thread John W. Krahn
David --- Senior Programmer Analyst --- Wgo Wagner wrote: You might look at sysopen, sysread which allows you to read in max blocks of data and process that data. It would look something like: sysopen(FILEIN,$filein,0) || die unable to open file $filein: $!;