That's why i was thinking of Split function. so that whereever it matches \ it stores the values in an array and i can mak use of only the desired 0th array
element.
Hi Shalili,
I understand your approach, but it's not even close to the best method. One thing you'll learn pretty quickly about perl is that it is excellent at text processing. You can almost always accomplish something with a direct method instead of something indirect like using split. Split is used for just what it says, splitting a string into an array. Unless that's really what your ultimate goal is, you best bet is to stick with a regular expression.
Kevin's example spells out exactly what you'll need. Use it, and if you find the time, try to understand it as well. Start reading perldoc and the introductions to regular expressions. It's information that will serve you very well.
- Miller