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!!
Back to
Seekers of Perl Wisdom