You are missing a semi-colon at the end of line 2, and remove the comma
between the filehandle and $string in line 6.

That should sort your problems.

The Perl Cookbook is one of series of books on Perl published by O'Reilly.
www.oreilly.com, generally well respected and very popular. If you start
with Learning Perl you can't go far wrong IMHO.


Jim

-----Original Message-----
From: '[EMAIL PROTECTED]' [mailto:[EMAIL PROTECTED]]
Sent: 25 November 2002 16:58
To: [EMAIL PROTECTED]
Subject: Re: random string


Hi,
Thanks for the mail.
> Just copy-paste the following in a file and save it with the extension .pl
I am giving the script I put in my file. I have removed all comments and
adjusted the lines. The script now reads,

#!/usr/local/bin/perl
open PASWDFILE , ">pswdfile"
my @chars = ( 'a' .. 'z', 'A' .. 'Z', 0 .. 9 );
my $string = join '', map $chars[ rand @chars ], 1 .. 8;
print $string;
print PASWDFILE , $string;

#perl random1.pl
syntax error at random1.pl line 3, near "my "
No comma allowed after filehandle at random1.pl line 6.

> Miss P > and when I didn't receive any concrete answers I was led to
believe
> that it cannot be accomplished in perl easily even by advanced users.
> Me > hope your belief has been belied :)
Not really. I still cannot get the above solution working. (though I have 2 
working solutions)

> Me > ... only if you write real *beautiful* code and have read the perl
> *Cook*book  :D  
Perl Cookbook? What is that?

Thanks and bye.
-Payal
-- 
-------------------------------------------------------------------
Contact :-                              Linux Success Stories : -
<payal at hotpop dot com>               www.geocities.com/rpayal99
-------------------------------------------------------------------


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

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

Reply via email to