in reply to Re: Search and replace text
in thread Search and replace text

You're missing
substr $_, 23, 2, sprintf '%02d', rand 100; substr $_, 36, 2, sprintf '%02d', rand 100;
and your int is useless.

Replies are listed 'Best First'.
Re^3: Search and replace text
by BrowserUk (Patriarch) on Jan 26, 2006 at 23:53 UTC

    I kinda assumed that once the OP had seen the idea of reading the data as fixed length records, he could probably work the rest out for himself.

    As for the int being useless here, point taken. but it's a good habit I think to explicitly truncate the return from rand if you are trying to generate an integer result. In this case it will be autotruncated, but in other situations it will not.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.