From fblack at docucorp.com Thu Sep 5 14:08:32 2002 From: fblack at docucorp.com (Black, Franklin) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Installing perl-5.8.0 Message-ID: <60F043336182D3118E930050041891973D7264@BED1CN02> Is there a way to install it in someplace other than c:\perl? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/nh-pm/attachments/20020905/fa1fa110/attachment.htm From kena at well.com Thu Sep 5 22:27:43 2002 From: kena at well.com (Ken Ambrose) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Pesky darn hashes... In-Reply-To: <60F043336182D3118E930050041891973D7264@BED1CN02> Message-ID: It's been a while since I used hashes, so I'm probably doing something woefully wrong. But, why doesn't: while (<>){ [...] %addresses = ($biggaddr => $_); } foreach $key (sort keys %addresses){ print "$key = $addresses{$key}\n"; } work? $bigaddr is an integer, if that makes any difference, and the "foreach" section was swiped bodily out of a Perl book o' mine. Thanks! -Ken From erikprice at mac.com Thu Sep 5 23:15:33 2002 From: erikprice at mac.com (Erik Price) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Pesky darn hashes... In-Reply-To: Message-ID: <49D3EF28-C14F-11D6-BDA3-00039351FE6A@mac.com> On Thursday, September 5, 2002, at 11:27 PM, Ken Ambrose wrote: > It's been a while since I used hashes, so I'm probably doing something > woefully wrong. But, why doesn't: > > while (<>){ > [...] > %addresses = ($biggaddr => $_); > } > > foreach $key (sort keys %addresses){ > print "$key = $addresses{$key}\n"; > } > > work? $bigaddr is an integer, if that makes any difference, and the > "foreach" section was swiped bodily out of a Perl book o' mine. I think what's happening is that the value of your hash is being reassigned at each point through your while loop. Does this work better for you: my %addresses; while(<>) { [...] $addresses{$bigaddr} = $_; } But I might be totally out of touch with what you're trying to do, in which case I apologize. Erik -- Erik Price email: erikprice@mac.com jabber: erikprice@jabber.org From jim.mcginness at att.net Thu Sep 5 23:11:02 2002 From: jim.mcginness at att.net (jim.mcginness@att.net) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Re: Pesky darn hashes... Message-ID: <20020906041103.CWKE11091.mtiwmhc22.worldnet.att.net@webmail.worldnet.att.net> In response to Ken Ambrose: > %addresses = ($biggaddr => $_); This statement replaces the entire hash each time with a new hash containing just one element. Perhaps you would like to do $addresses{$bigaddr} = $_; From morbus at disobey.com Tue Sep 10 08:18:32 2002 From: morbus at disobey.com (Morbus Iff) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH Message-ID: Hey there. New member of the list. I'm from Concord, NH, and you can find more trivial facts at http://www.disobey.com/about/morbus.shtml. My latest efforts have been writing for O'Reilly and Apple, and coding the pure-perl AmphetaDesk [1], which works on Mac, Windows and Linux. Perl doesn't need to be installed for the Mac or Windows version. It's unique enough that I've been commissioned to do a Perl.com article on it... Anyways. Yup. [1] http://www.disobey.com/amphetadesk/ -- Morbus Iff ( think about the good things that I did for you ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus From erikprice at mac.com Tue Sep 10 09:04:26 2002 From: erikprice at mac.com (Erik Price) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: Message-ID: <37A0386A-C4C6-11D6-A54B-00039351FE6A@mac.com> On Tuesday, September 10, 2002, at 09:18 AM, Morbus Iff wrote: > Hey there. New member of the list. I'm from Concord, NH, and you can > find > more trivial facts at http://www.disobey.com/about/morbus.shtml. My > latest > efforts have been writing for O'Reilly and Apple, and coding the > pure-perl > AmphetaDesk [1], which works on Mac, Windows and Linux. Perl doesn't > need > to be installed for the Mac or Windows version. It's unique enough that > I've been commissioned to do a Perl.com article on it... > > Anyways. Yup. Hey. I really liked your article on installing Perl 5.8.0 for Mac OS X. (Actually I've enjoyed quite a few of your articles, and gamegrene too.) Though I haven't actually installed it yet. I haven't needed to... yet. Erik -- Erik Price (zombies roam) email: erikprice@mac.com jabber: erikprice@jabber.org From morbus at disobey.com Tue Sep 10 10:42:59 2002 From: morbus at disobey.com (Morbus Iff) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: <37A0386A-C4C6-11D6-A54B-00039351FE6A@mac.com> References: <37A0386A-C4C6-11D6-A54B-00039351FE6A@mac.com> Message-ID: >Hey. I really liked your article on installing Perl 5.8.0 for Mac OS >X. (Actually I've enjoyed quite a few of your articles, and gamegrene >too.) Though I haven't actually installed it yet. I haven't needed Aaaah, Erik! Fancy meeting you here. Cool :) ... -- Morbus Iff ( strive for mediocrity ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus From numberwhun at attbi.com Tue Sep 10 16:34:02 2002 From: numberwhun at attbi.com (Jefferson Kirkland) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: Message-ID: <5.1.0.14.0.20020910173334.00b8ae50@mail.attbi.com> Greetings weary traveler. Relax and be welcome. #jlk At 09:18 AM 9/10/2002 -0400, Morbus Iff wrote: >Hey there. New member of the list. I'm from Concord, NH, and you can find >more trivial facts at http://www.disobey.com/about/morbus.shtml. My latest >efforts have been writing for O'Reilly and Apple, and coding the pure-perl >AmphetaDesk [1], which works on Mac, Windows and Linux. Perl doesn't need >to be installed for the Mac or Windows version. It's unique enough that >I've been commissioned to do a Perl.com article on it... > >Anyways. Yup. > >[1] http://www.disobey.com/amphetadesk/ > >-- >Morbus Iff ( think about the good things that I did for you ) >Culture: http://www.disobey.com/ and http://www.gamegrene.com/ >Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog >icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus >_______________________________________________ >Nh-pm mailing list >Nh-pm@mail.pm.org >http://mail.pm.org/mailman/listinfo/nh-pm From meplists at earthlink.net Wed Sep 11 06:01:56 2002 From: meplists at earthlink.net (Mark Polhamus) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH References: Message-ID: <3D7F22A4.3030003@earthlink.net> Morbus Iff wrote: > Hey there. New member of the list. I'm from Concord, NH, and you can find > more trivial facts at http://www.disobey.com/about/morbus.shtml. My latest > efforts have been writing for O'Reilly and Apple, and coding the pure-perl > AmphetaDesk [1], which works on Mac, Windows and Linux. Perl doesn't need > to be installed for the Mac or Windows version. It's unique enough that > I've been commissioned to do a Perl.com article on it... > > Anyways. Yup. > > [1] http://www.disobey.com/amphetadesk/ > Morbus: I enjoyed reading your history of Amphetadesk at http://www.disobey.com/amphetadesk/history.htm. I played with DailyUpdate about the time it was becoming NewsClipper, even did a prototype portal page for a paying project. (of course when they did the "real" portal they used Java and a lot of expensive commercial software). Anyway I think your history is classic for open source: finding solutions that didn't quite make it, then "scratching that itch" and doing it yourself. I'll definitely give it a try, maybe it will save some of the time I spend wandering around my bookmarks each day. I also enjoyed (from AmphetaDesk.pl): > # Dedicated to all the companies who wait until a large user base becomes > # dependant on their freeware, then shafting said happy campers with > # mandatory payment for continued usage. I spit on your grave. Amen! Welcome (but I just got here myself), -- Mark From fblack at docucorp.com Wed Sep 11 08:17:06 2002 From: fblack at docucorp.com (Black, Franklin) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] win32::Gui Message-ID: <60F043336182D3118E930050041891973D7269@BED1CN02> I have had problems loading win32::Gui. 502 has no makefile.pl. 490 has one but when I try to run it in the dos window, the file names get truncated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/nh-pm/attachments/20020911/69a592fb/attachment.htm From morbus at disobey.com Wed Sep 11 08:24:46 2002 From: morbus at disobey.com (Morbus Iff) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] win32::Gui In-Reply-To: <60F043336182D3118E930050041891973D7269@BED1CN02> Message-ID: <5.1.1.6.2.20020911092237.00ae2538@red.totalnetnh.net> >I have had problems loading win32::Gui. 502 has no makefile.pl. 490 has >one but when I try to run it in the dos window, the file names get truncated. You're trying to build it from source? Or from a PPM? PPM is the easiest, but the Win32::GUI PPM package available on ActiveState isn't the latest, the one at http://sourceforge.net/projects/perl-win32-gui is. Download it, extract it, and run "ppm install .ppm". -- Morbus Iff ( i'm the droid you're looking for ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Please Me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus From morbus at disobey.com Wed Sep 11 18:25:07 2002 From: morbus at disobey.com (Morbus Iff) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: <3D7F22A4.3030003@earthlink.net> References: <3D7F22A4.3030003@earthlink.net> Message-ID: >http://www.disobey.com/amphetadesk/history.htm. I played with DailyUpdate >about the time it was becoming NewsClipper, even did a prototype portal page >for a paying project. (of course when they did the "real" portal they used >Java and a lot of expensive commercial software). As usual. The hardest problem to conquer with open source isn't quality or documentation or ease-of-use, but rather "free". Too many businesses are used to paying for crap, and getting something better for free is a "pipe-dream" that died back in Ford's day. >definitely give it a try, maybe it will save some of the time I spend >wandering around my bookmarks each day. Cool, be sure to let me know how it works for ya. >I also enjoyed (from AmphetaDesk.pl): > > > # Dedicated to all the companies who wait until a large user base becomes > > # dependant on their freeware, then shafting said happy campers with > > # mandatory payment for continued usage. I spit on your grave. > >Amen! Heh, heh. There are two easy examples for that one: - Radio Userland, an aggregator just like an AmphetaDesk (as the history page states, it inspired AmphetaDesk). Got a huge userbase, then turned into a 30-day forced-shareware. - BookmarkSync, a bookmark synchronizer for any OS. I'd been using it for free for about two years, when suddenly, bam!, a pay piece of software. Inspired me to start working on the now- wallowing Syncasaurus (which, if I had the time, I'd still be working on). [1] http://www.sf.net/projects/syncasaurus/ http://www.disobey.com/syncasaurus/ -- Morbus Iff ( The power of Grayskull compels you! ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus From kclark at CetaceanNetworks.com Thu Sep 12 12:13:44 2002 From: kclark at CetaceanNetworks.com (Kevin D. Clark) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: References: Message-ID: Morbus Iff writes: > My latest > efforts have been writing for O'Reilly and Apple, and coding the pure-perl > AmphetaDesk [1] Very, *very* cool! I also worked on DailyUpdate a long time ago, and, like you, I got frustrated with it. In the very small amount of spare time I've had, I've been looking for something to augment my "My Yahoo" portal. I knew that I wanted a portal that grok'd RSS, but I hadn't yet gotten around to getting something working. AmphetaDesk looks like it fits the bill *very* nicely! Regards, --kevin PS In your install instructions, I think that you might want to add that that AmphetaDesk depends upon Compress::Zlib -- Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA) cetaceannetworks.com!kclark (GnuPG ID: B280F24E) alumni.unh.edu!kdc From morbus at disobey.com Thu Sep 12 18:24:28 2002 From: morbus at disobey.com (Morbus Iff) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Introduction: Concord, NH In-Reply-To: References: Message-ID: >Very, *very* cool! Thanks! >AmphetaDesk looks like it fits the bill *very* nicely! Cool! If you play with it, I'll be uberInterested to hear what you think, and any improvements. There's a huuuge TODO list, and I've got a few more features to add before I call it a 1.0 product, but it's been out for nearly 2 years now and is heartily stable. >PS In your install instructions, I think that you might want to add > that that AmphetaDesk depends upon Compress::Zlib Actually, you can comment that out, if you wish . I added it in because I didn't want to recreate the binary packages when I actually did use Compress::Zlib (for compressed, streaming updates), but I realized that I'm going to have to anyways, as I'm adding Digest::MD5 in the next version (for unique ids), and that's XS as well. -- Morbus Iff ( i am the horrible hogglewart ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus From fblack at docucorp.com Fri Sep 13 11:53:25 2002 From: fblack at docucorp.com (Black, Franklin) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] RE: Nh-pm digest, Vol 1 #8 - 2 msgs Message-ID: <60F043336182D3118E930050041891973D726B@BED1CN02> Does anyone have a program which builds a tree of a file system? Or any hints. -----Original Message----- From: nh-pm-request@mail.pm.org [mailto:nh-pm-request@mail.pm.org] Sent: Friday, September 13, 2002 12:00 PM To: nh-pm@mail.pm.org Subject: Nh-pm digest, Vol 1 #8 - 2 msgs Send Nh-pm mailing list submissions to nh-pm@mail.pm.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.pm.org/mailman/listinfo/nh-pm or, via email, send a message with subject or body 'help' to nh-pm-request@mail.pm.org You can reach the person managing the list at nh-pm-admin@mail.pm.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Nh-pm digest..." Today's Topics: 1. Re: Introduction: Concord, NH (Kevin D. Clark) 2. Re: Introduction: Concord, NH (Morbus Iff) --__--__-- Message: 1 To: Morbus Iff Cc: nh-pm@mail.pm.org Subject: Re: [Nh-pm] Introduction: Concord, NH From: kclark@CetaceanNetworks.com (Kevin D. Clark) Date: 12 Sep 2002 13:13:44 -0400 Morbus Iff writes: > My latest > efforts have been writing for O'Reilly and Apple, and coding the pure-perl > AmphetaDesk [1] Very, *very* cool! I also worked on DailyUpdate a long time ago, and, like you, I got frustrated with it. In the very small amount of spare time I've had, I've been looking for something to augment my "My Yahoo" portal. I knew that I wanted a portal that grok'd RSS, but I hadn't yet gotten around to getting something working. AmphetaDesk looks like it fits the bill *very* nicely! Regards, --kevin PS In your install instructions, I think that you might want to add that that AmphetaDesk depends upon Compress::Zlib -- Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA) cetaceannetworks.com!kclark (GnuPG ID: B280F24E) alumni.unh.edu!kdc --__--__-- Message: 2 Date: Thu, 12 Sep 2002 19:24:28 -0400 To: kclark@cetaceannetworks.com (Kevin D. Clark) From: Morbus Iff Subject: Re: [Nh-pm] Introduction: Concord, NH Cc: nh-pm@mail.pm.org >Very, *very* cool! Thanks! >AmphetaDesk looks like it fits the bill *very* nicely! Cool! If you play with it, I'll be uberInterested to hear what you think, and any improvements. There's a huuuge TODO list, and I've got a few more features to add before I call it a 1.0 product, but it's been out for nearly 2 years now and is heartily stable. >PS In your install instructions, I think that you might want to add > that that AmphetaDesk depends upon Compress::Zlib Actually, you can comment that out, if you wish . I added it in because I didn't want to recreate the binary packages when I actually did use Compress::Zlib (for compressed, streaming updates), but I realized that I'm going to have to anyways, as I'm adding Digest::MD5 in the next version (for unique ids), and that's XS as well. -- Morbus Iff ( i am the horrible hogglewart ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus --__--__-- _______________________________________________ Nh-pm mailing list Nh-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/nh-pm End of Nh-pm Digest -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/nh-pm/attachments/20020913/dae069c6/attachment.htm From kclark at CetaceanNetworks.com Fri Sep 13 12:15:53 2002 From: kclark at CetaceanNetworks.com (Kevin D. Clark) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] RE: Nh-pm digest, Vol 1 #8 - 2 msgs In-Reply-To: <60F043336182D3118E930050041891973D726B@BED1CN02> References: <60F043336182D3118E930050041891973D726B@BED1CN02> Message-ID: "Black, Franklin" writes: > Does anyone have a program which builds a tree of a file system? Or any hints. The stick --------- Could you please *NOT* include the entire message digest at the end of your email? Don't topquote. The carrot ---------- perl -l -MFile::Find -e 'find(sub{print $File::Find::name}, ".")' Hope this helps, --kevin -- Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA) cetaceannetworks.com!kclark (GnuPG ID: B280F24E) alumni.unh.edu!kdc From fblack at docucorp.com Fri Sep 20 13:12:43 2002 From: fblack at docucorp.com (Black, Franklin) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Dirtree Message-ID: <60F043336182D3118E930050041891973D7280@BED1CN02> Assuming 'require Tk::LabEntry;' at remv.pl line 11 Tk::Error: Can't set -directory to `.' for Tk::DirTree=HASH(0x2780c50): Entry "D:/LDRIVE/perl/remv" not found at L:/perl56/site/lib/Tk.pm line 217. Tk callback for .frame.dirtree Tk::Derived::configure at L:/perl56/site/lib/Tk/Derived.pm line 306 Tk::Widget::new at L:/perl56/site/lib/Tk/Widget.pm line 196 Tk::Widget::__ANON__ at L:/perl56/site/lib/Tk/Widget.pm line 247 Tk::Widget::Scrolled at L:/perl56/site/lib/Tk/Widget.pm line 1111 main::proc_file at remv.pl line 23 Can't set -directory to `.' for Tk::DirTree=HASH(0x2780c50): Entry "D:/LDRIVE/perl/remv" not found at L:/perl56/site/lib/Tk.pm line 217. I get this error whenever I try to create a TK/Dirtree. The Code is below. It's ActiveState Perl 5.6 use Tk; use Cwd; use Tk::DialogBox; use Tk::DirTree; my $directory='s:\\'; my $top = new MainWindow; $top->DirTree(); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/nh-pm/attachments/20020920/98244025/attachment.htm From jim.mcginness at att.net Fri Sep 20 14:44:42 2002 From: jim.mcginness at att.net (jim.mcginness@att.net) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] Dirtree Message-ID: <20020920194443.PSRU27953.mtiwmhc21.worldnet.att.net@mtiwebc17> Franklin Black wrote: > use Tk; > use Cwd; > use Tk::DialogBox; > use Tk::DirTree; > my $directory='s:\\'; > my $top = new MainWindow; > $top->DirTree(); I tried to get the same error you did, but could not; everything worked okay for me once I made some adjustments. $tree = $top->DirTree( -directory=>$directory); $tree->pack(-fill=>'both'); MainLoop; At the point where you stopped, I didn't see how you were going to get your $directory variable into the DirTree object, now how you intended to hold onto its handle for doing the needed 'pack'. I believe the most relevant error message is the one about "Can't set -directory to `.' for Tk::DirTree...". It looks like you have some fancy aliasing going on for drive L that perl isn't happy with when it tries to fill in a default for the -directory value. By supplying your own, you should be able to get around this problem. I can't promise that there won't be more problems down the road. From pll at lanminds.com Mon Sep 30 11:46:58 2002 From: pll at lanminds.com (pll@lanminds.com) Date: Mon Aug 2 21:33:06 2004 Subject: [Nh-pm] mypasswd Message-ID: <20020930164658.2C2F0F777@tater> Hi all, I was digging through my ~/bin dir this morning, and came across this gem which I wrote quite some time ago. Basically, it's a passwd generating program similar to /bin/passwd, except it's written in perl and doesn't actually operate on the /etc/passwd file. It also has a few features which I evidently needed at some point in time :) Here's a rough list of what it can do: - take a clear text string and encypt it - encrypt a clear text string X number of times - encrypt a clear text string using a specific 2 digit salt - take a list of clear text strings and encrypt them The list feature can either be a named file, or read from STDIN. The code is pretty straightforward, but feel free to ask if I did something you don't understand. Don't ask me *why* I wrote this, or when. I'm sure at the time I had an itch to scratch :) You could in theory use this as a password generator for a web page, but it would likely need some work. Also, it doesn't yet do md5 based passwords, though, that's not hard, using the MD5 perl module. This is released under the GPL, and please criticize/suggest better ways of doing this. I hope someone finds this useful! Seeya, Paul -------------- next part -------------- #!/usr/bin/perl use Getopt::Long; # use the getopt routine # parse command line opts $result = GetOptions ('h', # show help 'f=s', # take passwds from a file 'c=i', # create # of passwds specified 'p=s', # encrypt *this* string 's=s'); # use *this* salt if ($opt_h) {&usage;} # They need some help if ($opt_f) { # Reading from a file open (PWFILE, "<$opt_f") || die "$!\n"; @pwfile = ; chomp (@pwfile); close (PWFILE); foreach $passwd (@pwfile) { encode ($passwd) unless ($passwd =~ /^$/); # don't encrypt a blank line } } elsif ($opt_p) { # Specifying on the command line encode ($opt_p); } else { # Entering interactively and going to ask twice system "stty -echo"; $tries = 0; $okay = 0; while (! $okay) { $okay = 1; print "Enter password: "; chomp($password1 = <>); print "\n"; print "Enter password again: "; chomp($password2 = <>); print "\n"; if (($password1 ne $password2) and ($tries != 2)){ message ("Error: Password mismatch"); $okay = 0; } elsif ((length ($password1) < '6') and ($tries != 2)) { message ("Error: Password too short"); $okay = 0; } if ($tries == 2) { message ("Error: Too many tries","1"); } $tries++; } system "stty echo"; encode ($_); } sub encode { my ($passwd) = shift; my ($count); my ($salts) = $opt_s; my (@s) = (a..z, A..Z, 0..9, ".", "/"); # Valid character sets for salt # create a random salt, gotta be 2 characters, store it # in an array (@salts), then use them to create the encrypted passwords. # Finally, print them out. if ($opt_c) { for ($count = 0; $count < $opt_c; $count++) { $salts = $s[rand(@s)] . $s[rand(@s)] unless ($opt_s); my ($encrypted) = crypt($passwd, $salts); print ("$encrypted\n"); } } else { $salts = $s[rand(@s)] . $s[rand(@s)] unless ($opt_s); $encrypted = crypt($passwd, $salts); print ("$encrypted\n"); } } sub message { my ($message) = shift; my ($exit) = shift; if ($exit) { system ("stty echo"); die "$message\n"; } else { print STDERR("$message\n"); } } sub usage { # get the basename of the program being run. This should work fine # and I want this to be fast, so I don't want to use File::Basename ($prog = $0) =~ s/.*\/(\w+)/$1/; # Here's the old HERE Doc thingy. I like this better than a bunch of prints. # with prints you need to worry that the tabs won't line up, besides, this is # easier to edit ;) # Oh yeah, since this is technically an error, send it where it's supposed # to go like a good little program :) print STDERR < | -p ] [-c \# ] [-s ] ] $prog creates encrypted passwords based on cleartext input -h This message -c How many passwords you want to create -f Use a file containing all the cleartext passwords -p Encrypt this string -s Use this string as the 2 digit salt END exit; } -------------- next part -------------- Seeya, Paul -- It may look like I'm just sitting here doing nothing, but I'm really actively waiting for all my problems to go away. If you're not having fun, you're not doing it right!