Garanixx has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE:I was making quite the bad mistakes i see.. i did check the documentation, but unfortunately i didnt grasp it too well, its just that i'm only about 2 weeks into programming and all of this still hurts my head a little.. i will learn, thank you all very much for your replies#!/usr/bin/perl -w $DEBUG=1; #this is my random password generator project open(FILE ,"/dev/urandom") or die "could not open the file: $!"; $index=0; print "how many characters in length should the password be?\n"; $input=<STDIN>; chomp($input); while($index < $input) { $character=getc FILE; chomp($character); print "### DEBUG: \$character is $character\n" if $DEBUG; if(chr $character =~ m/[55-90]/) { push(@array ,$character); $index++; } } print reverse(@array); close FILE;
20050209 Edit by castaway: Changed title from 'Why won't this program work?'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching alphanumeric characters from urandom
by VSarkiss (Monsignor) on Feb 07, 2005 at 21:03 UTC | |
|
Re: Matching alphanumeric characters from urandom
by RazorbladeBidet (Friar) on Feb 07, 2005 at 20:52 UTC | |
|
Re: Matching alphanumeric characters from urandom
by cowboy (Friar) on Feb 07, 2005 at 20:57 UTC | |
by dragonchild (Archbishop) on Feb 07, 2005 at 21:03 UTC | |
|
Re: Matching alphanumeric characters from urandom
by Fletch (Bishop) on Feb 07, 2005 at 21:01 UTC |