in reply to Re: complex sort
in thread complex sort
You can chomp <DATA> straight away before passing it to the sort routine. [...]<DATA> is immutable, so you cannot chomp it (chomp actually tries to modify what it gets - it returns the number of removed characters, not a list of chomped strings).
[...]
sort part_sort chomp <DATA>;
#!/usr/bin/perl print chomp <DATA>; __DATA__ This piece of code will trigger the following compilation error: Can't modify <HANDLE> in chomp at - line 2, near "<DATA>;" Execution of test aborted due to compilation errors.
|
|---|