I have this weird problem with split is that it is not a default split into a default array.
Below is the toy code.
#!/usr/bin/perl $A="A:B:C:D"; split (":",$A); print $_[0];
It doesn't print anything. However, if I explicitly broke into a default array, for example
#!/usr/bin/perl $A="A:B:C:D"; @_=split (":",$A); print $_[0];
It prints correctly A. My version of perl is v5.22.1.
source share