Re: Perfecting index.pl some more!
- From: "Tassilo v. Parseval" <tassilo.von.parseval@xxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 16:03:19 +0200
Also sprach Nikos:
> Tassilo v. Parseval wrote:
You should use quotation marks to indicate which parts I wrote and which
were yours.
> Also i didnt quite understand what are you tryign to say here!
> Can you please clarify it to em some more?
[quotations inserted for clearity]
>> As you want shorter code, here's one way:
>>
>> s/\n/\\n/g,
>> s/"/\\"/g ,
>> tr/\cM//d ,
>> for $data;
This is functionally equivalent to what you've written, which was:
$data =~ s/\n/\\n/g;
$data =~ s/"/\\"/g;
$data =~ tr/\cM//d;
By using 'for $data', $data gets aliased to $_ which is the default
variable that s/// and tr/// act upon. By using 'for' as a
statement-modifier (that is: in postfix notation) no block is needed
which would normally be the case if you wrote:
for ($data) {
s/\n/\\n/g;
s/"/\\"/g;
tr/\cM//d;
}
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
.
- Follow-Ups:
- Re: Perfecting index.pl some more!
- From: Nikos
- Re: Perfecting index.pl some more!
- References:
- Perfecting index.pl some more!
- From: Nikos
- Re: Perfecting index.pl some more!
- From: Tassilo v. Parseval
- Re: Perfecting index.pl some more!
- From: Nikos
- Perfecting index.pl some more!
- Prev by Date: Re: Module file writing problem
- Next by Date: Performance question with a string concat
- Previous by thread: Re: Perfecting index.pl some more!
- Next by thread: Re: Perfecting index.pl some more!
- Index(es):
Relevant Pages
|
|