in reply to splitting line without split

Meanwhile you have received several examples of splitting without using split, proof of the fact that TIMTOWTDI!

But, why can't you use split in your code?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: splitting line without split
by Anonymous Monk on Nov 08, 2009 at 22:34 UTC
    Hi CountZero,
    Yes, like I mentioned, I always receive excellent suggestions from here. That is what makes this website a great place to learn from others' experiences.
    Unfortunately, the placed I work for is not that friendly to Perl or Linux usage. My workplace has some other old utilities/methodologies and people here have no interest in learning another new tool - Perl or knowing the much better solutions Perl offers. Long story short, I just have to have an alternative ready to show that Perl can do what our internal tool can do (with out having to use split)
    J.
      I know the feeling -- same thing here!

      But just because of that, I like to show the power of Perl and split is such a wonderful function: simple yet powerful and everybody can understand how it works, even without knowing Perl (of course if you do not go too deep into details).

      Even PHP now has deprecated their split function in favour of preg_split which is a Perl Compatible Regular Expression split! Take that PHP. Perhaps they can go one step further and deprecate the whole of PHP and replace it by Perl. :-)

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James