pulling out the value from rows

Hi,

I'm trying to pull all occurrence of value , for example "xy1234" from several rows, out of a file. The file might as well contain other different type of rows.

20100121 04:00:02 37a00452 <ABCN:ABXC> From MV Modify <uid=xy1234,ou=Internal2,ou=people,dc=abc,dc=example1,dc=com> 

I am trying to write a perl script. Although, i can utilize "split" functionality, but i'm not able to come up a using a delimeter.

Please help.

Thanks, Prince

echo '20100121 04:00:02 37a00452 <ABCN:ABXC> From MV Modify <uid=xy1234,ou=Internal2,ou=people,dc=abc,dc=example1,dc=com>' | sed 's/.*uid=\([^,][^,]*\).*/\1/'

are you sure you want to do it using only perl.. because sed might help you..

Another one with sed:

sed 's/.*uid=\([^,]*\).*/\1/'

or with awk:

awk -F"uid=|," '{print $2}'

Thanks for all your reply.

I will be configuring this script on a window server, and there we don't have awk or sed utility installed.

Also, this is just a one of the several things, i have intended to do using a Perl script. So, i want to do this using perl utility like "split" etc.

Thanks, Prince