Thanks for your replies, I'm new to Perl so I'm not fit with that abbreviated syntax, e.g. "s/\s+\z//". I guess I'll stick with telling chomp how to handle arguments. I thought about something like:
if (uc($^O)=~"WIN") {$/="\r\n"}
| [reply] [Watch: Dir/Any] [d/l] |
s/\r\n\z//;
# or
$line =~ s/\r\n\z//;
| [reply] [Watch: Dir/Any] [d/l] |
It's been a year, but I still don't get that abbreviated syntax. For example, today I found out that I can easily split strings at each point using
@foo=split(/\./,$bar);
But to split at whitespace I can use
@foo=split(" ",$bar);
Why is that and what does it mean? I really don't get it, why doesn't
@foo=split(".",$bar);
work? | [reply] [Watch: Dir/Any] [d/l] [select] |