J
John
There must be something that I have ignored in PERL.
To split a string with delimiter "|", sometimes, I need to give "\",
sometimes it works for "\\" only.
Here are the details.
The String is " 0000|Null".
And the ways I have tried to do split are:
1. my @columns = split('\|', $String);
2. my ( $proj, $desc) = split('\|', $String);
3. my ( $proj, $desc) = split('\\|', $String);
Case 1 and Case 3 are good. But Case 2 failed, both $proj and $desc
receive an empty string .
What was wrong with case 2 , I thought if Case 1 works, Case2 should
be working also, Right ? I am using perl 5.6.1 on linux box.
Thanks a lot for the tips.
John.
To split a string with delimiter "|", sometimes, I need to give "\",
sometimes it works for "\\" only.
Here are the details.
The String is " 0000|Null".
And the ways I have tried to do split are:
1. my @columns = split('\|', $String);
2. my ( $proj, $desc) = split('\|', $String);
3. my ( $proj, $desc) = split('\\|', $String);
Case 1 and Case 3 are good. But Case 2 failed, both $proj and $desc
receive an empty string .
What was wrong with case 2 , I thought if Case 1 works, Case2 should
be working also, Right ? I am using perl 5.6.1 on linux box.
Thanks a lot for the tips.
John.