nysus has asked for the wisdom of the Perl Monks concerning the following question:
$line =~ s/[ \011]*\015$//; # Chop trailing whitespace and DOS CRs
I'm pretty familiar with regular expressions but this just makes no sense to me. I don't see how the pattern to be replaced translates to whitespaces and carriage returns. Are the '011' and '015' ascii codes? It looks like they are escaped, too. Still, this makes no sense to me, especially because these 011 is a vertical tab and 015 is a 'shift in'. Can someone please explain? Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Quickie code question
by arturo (Vicar) on Mar 28, 2001 at 21:46 UTC | |
|
Re: Quickie code question
by marius (Hermit) on Mar 28, 2001 at 21:41 UTC | |
|
Re: Quickie code question
by converter (Priest) on Mar 28, 2001 at 21:49 UTC | |
by arhuman (Vicar) on Mar 28, 2001 at 21:55 UTC | |
by converter (Priest) on Mar 28, 2001 at 22:08 UTC | |
by arturo (Vicar) on Mar 28, 2001 at 22:13 UTC | |
|
Re: Quickie code question
by nysus (Parson) on Mar 29, 2001 at 02:19 UTC |