in reply to A little C code converted to Perl *HELP*
Maybe you should tell us what the code *does*. I'd have a *much* easier time writing Perl code from scratch given a description in English of what it's supposed to do. I've taken a shot at reading the C, but my C is marginal in the extreme, so I very well could get something wrong here...
As near as I can determine, all this code does is seed the random number generator. Correct me if I am mistaken (did I mention my C is marginal?), but that is the only effect I think it has. If that is the case, you can translate it into a comment that indicates that Perl does this automatically.
If the C code is doing something more substantial, you'll have to tell us what it's doing, before we can tell you how to do that in Perl. We're _Perl_ gurus; many of us don't know any C at all. If you need help with C, this really isn't the best place to get it.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A little C code converted to Perl *HELP*
by regnab (Initiate) on Nov 03, 2003 at 04:34 UTC | |
by jonadab (Parson) on Nov 03, 2003 at 04:42 UTC | |
by bbfu (Curate) on Nov 03, 2003 at 17:54 UTC | |
by regnab (Initiate) on Nov 03, 2003 at 04:49 UTC | |
by regnab (Initiate) on Nov 03, 2003 at 04:53 UTC | |
by jonadab (Parson) on Nov 03, 2003 at 05:00 UTC |