keesturam has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, After a gap I am resuming to learn perl. Can you please help me why using @ with split doesn't give desired output.
$input = "ab,cd,efghi,jkl"; @input = split(/,/,$input); $len = @input; print "$input[$len-1]"; # splits properly into 4 $input = "ab,cd,efghi,jkl"; @input = split(/@/,$input); $len = @input; print "$input[$len-1]"; # splits into 2!
Is there anything special that I haven't read about using @?
Cheers!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split and @
by davido (Cardinal) on Jan 07, 2013 at 18:40 UTC | |
|
Re: split and @
by AnomalousMonk (Archbishop) on Jan 07, 2013 at 21:28 UTC | |
|
Re: split and @
by ww (Archbishop) on Jan 07, 2013 at 18:54 UTC | |
|
Re: split and @
by dbuckhal (Chaplain) on Jan 07, 2013 at 19:34 UTC |