in reply to Re: Parsing strings into @ARGV
in thread Parsing strings into @ARGV
Yes, I saw that, here is my fix:
$lines[$#lines] =~ s{(\\.)?\s*$}{defined $1 ? $1 : ''}e;I don't really like it but it passes my tests.:
#!/usr/bin/perl -w use strict; use Test::More qw(no_plan); while( <DATA>) { my( $input, $expected)= m{^'(.*?)'\s*=>\s*'(.*?)'}; (my $trimmed= $input)=~ s{(\\.)?\s*$}{defined $1 ? $1 : ''}e; is( $trimmed, $expected, "'$input'"); } __DATA__ 't' =>'t' 't ' =>'t' 't\ ' =>'t\ ' 't\ ' =>'t\ ' 't\ \ '=>'t\ \ '
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing strings into @ARGV
by Abigail-II (Bishop) on Apr 23, 2004 at 16:45 UTC | |
by mirod (Canon) on Apr 23, 2004 at 17:39 UTC |