![]() |
Beginner Perl help Please
Hi I am trying to generate random names using perl script.
First let me post my code Code:
#!/usr/bin/perl My problem is I dont want it to generate the way it is doing now. here is the output if i give limit as 6 PeTFDyCo PeTFDyCotpeZftCG PeTFDyCotpeZftCGCztEldLf PeTFDyCotpeZftCGCztEldLfdULnsqvx PeTFDyCotpeZftCGCztEldLfdULnsqvxhYNMboqM PeTFDyCotpeZftCGCztEldLfdULnsqvxhYNMboqMXIDiwnOw Here it generates 6 names, but I have two issues here 1) I dont want the previous name to be appended(prefix) to the next name 2) I want all the names to be of same length Please help me. Thank you. |
Re: Beginner Perl help Please
the letters are appended to $name through out the until loop. Thats why you are getting previous name to be appended and length of the name increases.
add $name="" in the first line of the until loop |
Re: Beginner Perl help Please
Code: Perl
Output: Code:
[pradeep@home-dev test]# ./rand.pl |
| All times are GMT +5.5. The time now is 22:12. |