RE: Scripting Help (was Qmail Toaster Help / Perl Help)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Gilbert T. Gutierrez, Jr.
Date:  
To: 'Main PLUG discussion list'
Subject: RE: Scripting Help (was Qmail Toaster Help / Perl Help)
Eric,
Thanks for the help. I am debating which way to go, perl or shell. Here is
the perl script I wrote using "Empty's" line of perl. I am leaning towards
perl so that I can combine my other perl scripts and make everything one
execution.

Gilbert

#!/usr/bin/perl
# This is a script takes a list of email addresses and
# passwords and formats it into a csv file of
# username, domain, password

# Open file with usernames and passwords
open(REGFILE,"registryfile.txt") || die "Cannot open registryfile.txt\n";

# File to store comma separated values
open(NCSV,">encrypt.csv") || die "Cannot open encrypt.csv!\n";

@myreg = <REGFILE>;

foreach $listitem ( @myreg ) {
  if (grep(/\.net/, $listitem) || grep(/.com/, $listitem)
     || grep(/.org/, $listitem)) {
     $listitem =~ s/\n/,/;
     $listitem =~ s/\@/,/;
  }
  print NCSV $listitem;
}


close (NCSV);
close (REGFILE);

---
[ This E-mail was scanned for viruses by Phoenix Internet ]
[ Phoenix Internet http://www.phoenixinternet.net ]

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss