That is a bad idea.
If he is reading a lot of these strings from a file then it implies that there are a lot of records in the file.
What your code is doing is first reading the entire file into the memory and after that starting to process it.
Also: you can combine both maps just fine.
That is: map { chomp; split m{\|}, $_, 2 }
In reply to Re^2: Removing digits until you see | in a string
by Animator
in thread Removing digits until you see | in a string
by kevyt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |