[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Sheflug] Quick PERL job
> #!/usr/bin/perl
>
> $x = "hello\000\000\000 world";
>
> print length($x) . ":" . $x . "\n";
> $x =~ s/[^[:print:]]//g;
> print length($x) . ":" . $x . "\n";
> ## end of script
Thanks, Chris.
$x =~ s/\x00//;
...seems a little shorter. I can't however comment on the benefits of
one versus t'other, although your version is a bit more general, n'est
pas?
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.