[Wellington-pm] tidying up output from naughty backticked commands?

Grant McLean grant at mclean.net.nz
Sun Sep 12 16:15:04 CDT 2004


On Mon, 2004-09-13 at 09:01, Steve Wray wrote:
> I've found that one of the programs I'm using in backticked expressions 
> in perl scripts returns a bothersome and non obvious format.
> 
> I've enclosed it in angle brackets so that you can see what it looks 
> like. The number is purely an example;
> 
> <4750
> 
> >

You're right, it is non-obvious :-)
Perhaps if you piped the command through xxd or cat -e you might get
some clue about what the extra characters are.

To strip off all space characters including space, tab, carriage
return and line feed just use '\s' in a regex

my $tidy_mode = `svn propget file:mode "$filename"`;
$tidy_mode =~ s/\s+$//s;

Cheers
Grant



More information about the Wellington-pm mailing list