On Sat, Nov 23, 2002 at 08:02:00AM +0530, [EMAIL PROTECTED] wrote:
> Hi,
> > why would you want to use Perl in the first place? no other alternatives?
> Maybe, But I am not a coder at all.
> > your problem is straight forward and if you are not familiar with Perl, you 
> > might want to go with another language. i don't think it will be that hard 
> > right? c/c++? java? shell script?
> hehehehee, if I knew that then i would have made it myself. I know a bit
> of shell scripting, but I never knew that one can generate random string
> in shell.
> Can you help me do it in perl?
> My requirement is very very simple. To write a program which will
> generate *just* a random string of say 8 characters. Characters allowed
> will be - [a-z] [A-Z] [0-9]. Can it be done?

By now you will probably have worked out that this community is very
happy to help people of any ability to improve their Perl skills, but is
rather reluctant just to hand out ready-made solutions.  This is as it
should be - if you want someone to do work for you you generally pay
them in some way.  Most of the regular posters on this list could
probably knock up a simple solution and post it with very little effort.
I could certainly do so in a fraction of the time it will take to write
this mail.  So why hasn't anyone just done that?

Well, I suppose it comes down to the payment aspect.  Perl is free, as
are all the modules on CPAN.  For many of us Perl has made our lives
considerably easier and more fun.  How do we repay the people who have
created Perl?  Some pay money - https://donate.perl-foundation.org/
Some help to work on Perl development.  Some contribute to CPAN.  Some
help others to learn in fora such as this.  Some don't.

In your particular situation things started off well.

On Fri, Nov 22, 2002 at 04:01:39PM +0530, [EMAIL PROTECTED] wrote:
> I am not at all familar to perl. I want to write a small perl script

That's great.  You want to write the script, but need help.  You'll find
plenty here.  And you got a reply:

On Fri, Nov 22, 2002 at 03:10:47AM -0800, John W. Krahn wrote:
> # character set to choose from as per your example
> my @chars = ( 'a' .. 'z', 'A' .. 'Z', 0 .. 9 );
> # pick eight random characters from the array
> my $string = join '', map $chars[ rand @chars ], 1 .. 8;

But then things took a turn for the worse.  You told us that you didn't
know what to do with the advice and just wanted a solution.  I decided
to ignore your request, but since you were persistent I poked around
your web site, and that's what has prompted me to reply.

It looks as though you have already taught yourself a number of skills,
including the ability to set up and maintain linux systems, networking,
mail, vi and others.  It seems that Perl could be a useful tool for you,
and that you are willing and have the ability to work things out for
yourself.

It's been a while since I learnt Perl, and the resources now available
weren't then, so I thought I'd see how easy it is for a determined
beginner to learn Perl.  Based on the name of this list, my first stop
was www.perl.org.  Right at the top is a like to learn.perl.org, and the
first line there points us to perlintro.  This is a nice document which
will get you started.

This document, along with John's reply will get you to where you want to
be, at least for now.  After a brief introduction you will learn how to
run a Perl program, the basics of syntax, variable types and a little
more.

So, read that document, and make sure you know how to run a Perl
program, if you don't already.

Then look at John's reply.  This will form the bulk of your program.  It
would be good to understand it, especially if you are using it to
generate passwords, but for now you might just want to cut-and-paste it.

After those two lines, you will have the password in $string.  Now you
just need to print it.  You will find how to do that near the top of
perlintro.

If all goes well, you should have written your first Perl program.  This
might be the start of a wonderful journey for you.  There is a lot to
learn, but it doesn't have to be learnt all at once - or even at all.
There are plenty of resources available, and this list will be happy to
help if you can show that you are willing to help yourself.  With any
luck you will improve yourself and will later be able to contribute back
to the community in some way.

Come back to the list with any questions, or let us know of your
success.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to