in reply to Strange substr Problem

I'd just do this:
my $valstring = join("|", @valarray); my @elems; push @elems, substr($valstring, 0, 100, "") while length $valstring;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: Re: Strange substr Problem
by c0bra (Acolyte) on Mar 13, 2003 at 16:20 UTC
    Well that's certainly a lot less code, but if there is a problem existing between substr and the data that is going in won't I still get errors?