$myline = "192.168.0.1\|run\|C:\\run.com\|"; ($ip, $appid, $apppath, $extra) = split(/\|/, $myline); print "$apppath\n";
This will give you exactly what you want:
C:\run.com
If you don't want to bother with escaping the pipe symbol, avoid using the pipe symbol and pick another character as the field separator instead.
roytc
In reply to Re: split
by Anonymous Monk
in thread surprised by split
by akm2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |