in reply to Re: One liner: split fixed-width field into equal length chunks...
in thread One liner: split fixed-width field into equal length chunks...

Whenever you find yourself numbering individual variables instead of giving them names, you should recognise that what you ought to be using is an array.
Obligatory reading for more of such fundamental advice: Mark-Jason Dominus' excellent Program Repair Shop and Red Flags article series on Perl.com.

Makeshifts last the longest.

  • Comment on Re^2: One liner: split fixed-width field into equal length chunks...

Replies are listed 'Best First'.
Re: Re^2: One liner: split fixed-width field into equal length chunks...
by mr. jaggers (Sexton) on Mar 25, 2003 at 05:11 UTC
    Yes, I realize this. I guess I've been programming in languages where dynamic arraying is impractical for so long that I forget that perl has such flexibility.

    I didn't want to declare an array of a fixed size... and if I did, I didn't want to use an explicit for-loop (not sure why not, but the little voice in the back of my head said "hey, this is perl... you probably don't need a for loop to do that... it can probably happen in one line... it's probably a really short line, you idiot!")

    Thanks for the resources, I'll read up on them! (couldn't wait, read the first... wow... so many of my programs to unbreak)