[25658] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7900 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 21 03:05:42 2005

Date: Mon, 21 Mar 2005 00:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 21 Mar 2005     Volume: 10 Number: 7900

Today's topics:
        Cron Job & Perl <goooo@nospam.net>
    Re: Cron Job & Perl <tadmc@augustmail.com>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
        Encrypting credit card numbers? el_roachmeister@yahoo.com
    Re: Encrypting credit card numbers? <nospam@bigpond.com>
    Re: Encrypting credit card numbers? el_roachmeister@yahoo.com
    Re: Encrypting credit card numbers? el_roachmeister@yahoo.com
    Re: help! Mailer <appumail@gmail.com>
        RE: IORCC Crossword and Wordfind Puzzles iorcc@yahoo.com
        Re:[perl-python] a program to delete duplicate files <xah@xahlee.org>
        Read string from multiple files, output ordered by a 2n <usenet739_yahoo_com_au>
    Re: Read string from multiple files, output ordered by  <noreply@gunnar.cc>
    Re: Script that sends email to text box value <news@chaos-net.de>
    Re: Script that sends email to text box value <noreply@gunnar.cc>
    Re: Script that sends email to text box value <sbryce@scottbryce.com>
    Re: Script that sends email to text box value <tadmc@augustmail.com>
    Re: Script that sends email to text box value <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 21 Mar 2005 11:38:29 +1100
From: "goooo" <goooo@nospam.net>
Subject: Cron Job & Perl
Message-Id: <d1l525$53d$1@news-02.connect.com.au>

I've got a perl script that I'm having problems trying to launch from CRON.

My script deletes UPDATE.INI, checks to see if file DAT version specified in
UPDATE.INI is same in directory. (ie. DAT-4450.ZIP)    If not it deletes old
file and downloads the latest file.

It works perfect when I launch it manually from cmd prompt.   But via CRON.
All it seems to do is delete the UPDATE.INI & DAT files and bombs out.

Heres my cron line -

24     11       *       *       *       /usr/bin/perl
/etc/periodic/naidat_update.pl >/dev/null 2>&1

Heres my script -
#################################################################
#!/usr/bin/perl
 use Net::FTP;
 use Cwd;
   my $dir = "/home/dats";
   my $olddat = "unknown";
   my $newdat = "unknown";

  opendir (DIR, $dir) or die $!;
  my @dir = readdir DIR;
  closedir DIR;

  foreach  (@dir) {
      if(/dat\-/){
      $olddat = substr($_,4,4);}
      }

      print "Old DAT file Version is ","$olddat","\n\n";
      system("rm","-rf","$dir/update.ini");

    print "Downloading latest UPDATE.INI file\n\n";

system("wget","ftp://ftp.nai.com/pub/antivirus/datfiles/4.x/update.ini","-P"
,"/home/dats");

open(FILE, "$dir/update.ini");

while (<FILE>){
     chomp;
     if (/FileName\=/ && /dat\-/ && /\.zip/i){
     $newdat = substr($_,13,4);}
     }
     close FILE;

     print "New DAT file Version is $newdat\n\n";

if($olddat!=$newdat){
     print "Deleting old DAT file $olddat\n\n";
     system("rm","-rf","$dir/dat-$olddat\.zip");
     print "Downloading latest DAT file $newdat\n\n";

system("wget","ftp://ftp.nai.com/pub/antivirus/datfiles/4.x/dat-$newdat\.zip
","-P","/home/dats");

} else{

    print "DAT file Up To Date\n\n";}




------------------------------

Date: Sun, 20 Mar 2005 22:36:03 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Cron Job & Perl
Message-Id: <slrnd3sjpj.iss.tadmc@magna.augustmail.com>

goooo <goooo@nospam.net> wrote:

> It works perfect when I launch it manually from cmd prompt.   But via CRON.


Must be something different in the environment then, cwd, env vars, etc...


> All it seems to do is delete the UPDATE.INI & DAT files and bombs out.


What does "bombs out" mean when you say it?

Get any messages or anything like that?


> #################################################################
> #!/usr/bin/perl

   use warnings;
   use strict;


>   opendir (DIR, $dir) or die $!;


What directory are you in here?


>   foreach  (@dir) {
>       if(/dat\-/){


hyphens are not special in regexes, there is no need to backslash them.


>       $olddat = substr($_,4,4);}
>       }


   $olddat = $ 1 if /dat-(....)/;


>       print "Old DAT file Version is ","$olddat","\n\n";


Hnuh? What's with all the quotes and commas?

   print "Old DAT file Version is $olddat\n\n";


> open(FILE, "$dir/update.ini");


You should always, yes *always*, check the return value from open():

   open(FILE, "$dir/update.ini") or 
      die "could not open '$dir/update.ini' $!";


>      if (/FileName\=/ && /dat\-/ && /\.zip/i){
                    ^          ^
                    ^          ^ more needless backslashing

   if (/FileName=/ && /dat-/ && /\.zip/i){


> if($olddat!=$newdat){


Whitespace is not a scarce resource, feel free to use as much as
you like to make your code easier to read and understand:

   if ( $olddat != $newdat ){

>      system("rm","-rf","$dir/dat-$olddat\.zip");
                                          ^
                                          ^ needless backslashing yet again


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 21 Mar 2005 05:33:55 GMT
From: <jari.aalto <AT> poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1111383170@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto A T poboxes com

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Unix Windows port (for Unix die-hards):
            install http://www.cygwin.com/  which includes native Emacs 21.x.
            and XEmacs port

        o   Pure Native Windows port
            http://www.gnu.org/software/emacs/windows/ntemacs.html
            ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

        o   More Emacs resources at
            http://tiny-tools.sourceforge.net/  => Emacs resource page

Emacs Perl Modules

    Cperl -- Perl programming mode

        http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
        http://math.berkeley.edu/~ilya/software/emacs/
        by Ilya Zakharevich

        CPerl is major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

        http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Grep through all Perl manpages (.pod)
        o   Follow POD references e.g. [perlre] to next pod with RETURN
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.

        o   Update `$VERSION' variable with YYYY.MMDD on save.
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Prepare script (version numbering) and Upload it to PAUSE
        o   Generate autoload STUBS (Devel::SelfStubber) for you
            Perl Module (.pm)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in Tiny Tools Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up dattabases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to to do the search, You can adjust
        recursive grep options, set search case sensitivity, add user grep
        options etc.

        You can find latest `igrep.el' module at
        <http://groups.google.com/groups?group=gnu.emacs.sources> The
        maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.

    TinyCompile -- To Browse grep results in Emacs *compile* buffer

        TinyCompile is a minor mode for *compile* buffer from where
        you can collapse unwanted lines or shorten file URLs:

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->

            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



------------------------------

Date: 20 Mar 2005 20:42:46 -0800
From: el_roachmeister@yahoo.com
Subject: Encrypting credit card numbers?
Message-Id: <1111380166.460082.43600@l41g2000cwc.googlegroups.com>

I have figured out how to encrypt cc' numbers using Perl's
Crypt::Blowfish module. I am trying to I convert the enrypted numbers
into text that can be copy/pasted into a web form.

I was able to use "unpack" to convert the encrypted number into text.
Now I can not figure out how to "pack" the unpacked number into the
same encrypted number?! My code is posted below, which produces this
output:

-shell-2.05b$ perl -t crypt
Original number is: 4242123456789012-March/11-2002
Unpacked number is:
6f162930ad78725a6f162930ad78725a6f162930ad78725a6f162930ad78725a
Decrypted number is: 4242123456789012-March/11-2002
o)0=ADxrZo)0=ADxrZo)0=ADxrZo)0=ADxrZ
8=BA#~=E4S3@B=E9
          08=A18=BA#~=E4S3@B=E9
                       08=A18=BA#~=E4S3@B=E9
                                    08=A18=BA#~=E4S3@B=E9
                                                 08=A1

#############################################################

#!/usr/bin/perl -Tw

use strict;
use warnings;
use diagnostics;

use Crypt::Blowfish;

###########################################

my $key =3D pack("H16", "0123456789ABCDEF");  # min. 8 bytes

our $BLOCKSIZE =3D 8;

my $cc_number =3D'4242123456789012-March/11-2002'; # yes this is made up

my ( $encrypted, $unpacked)=3D &encrypt ($key, $cc_number);
my $decrypted =3D &decrypt ($key, $encrypted);

print "Original number is: $cc_number\n";
print "Unpacked number is: $unpacked\n" ;
print "Decrypted number is: $decrypted\n";

my $packed_from_unpack =3D &pack_number($unpacked);
my $decrypted_from_packed =3D &decrypt ($key, $packed_from_unpack);

print $packed_from_unpack . "\n";
print $decrypted_from_packed . "\n";

#############################################

sub encrypt {

 my ($key,$dat) =3D @_;
 my $encrypted =3D '';
 my $unpacked =3D '';
 my $cipher =3D new Crypt::Blowfish $key;

 if ($BLOCKSIZE > 0) {
  my $l_dat =3D length($dat);
  for (my $i=3D0; $i < $l_dat;$i+=3D$BLOCKSIZE) {
   my $tmp =3D substr($dat,$i,$BLOCKSIZE);
   my $tmp2 =3D sprintf("%-" . $BLOCKSIZE . "s",$tmp); #pad with spaces
   $encrypted .=3D $cipher->encrypt($tmp2);
   $unpacked .=3D unpack ("H16", $encrypted);

  }
 }
 else {
  $encrypted .=3D $cipher->encrypt($dat);
  $unpacked .=3D unpack ("H16", $encrypted);

 }
 return $encrypted, $unpacked;

}

sub decrypt {

 my ($key,$dat) =3D @_;
 my $dec =3D '';
 my $cipher =3D new Crypt::Blowfish $key;

 if ($BLOCKSIZE > 0) {
  my $l_dat =3D length($dat);
  for (my $i=3D0; $i < $l_dat;$i+=3D$BLOCKSIZE) {
   my $tmp =3D substr($dat,$i,$BLOCKSIZE);
   $dec .=3D $cipher->decrypt($tmp);
  }
 }
 else {
  $dec .=3D $cipher->decrypt($dat);
 }
 $dec =3D~ s/\s+$//; #remove trailing spaces
 return $dec;
}

sub pack_number {

 my $dat =3D $_[0];
 my $packed=3D'';
   my ($tmp, $tmp2);

 if ($BLOCKSIZE > 0) {
  my $l_dat =3D length($dat);
  for (my $i=3D0; $i < $l_dat;$i+=3D$BLOCKSIZE) {
   $tmp =3D substr($dat,$i,$BLOCKSIZE);
   $tmp2 =3D sprintf("%-" . $BLOCKSIZE . "s",$tmp); #pad with spaces
   $packed .=3D pack ("H16", $tmp2);

  }
 }
 else {
  $packed .=3D pack ("H16", $tmp2);

 }

 return $packed;

}

1;



------------------------------

Date: Mon, 21 Mar 2005 15:19:58 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Encrypting credit card numbers?
Message-Id: <3a73rvF66g7lqU1@individual.net>

el_roachmeister@yahoo.com wrote:

> I have figured out how to encrypt cc' numbers using Perl's
> Crypt::Blowfish module. I am trying to I convert the enrypted numbers
> into text that can be copy/pasted into a web form.
> 
> I was able to use "unpack" to convert the encrypted number into text.
> Now I can not figure out how to "pack" the unpacked number into the
> same encrypted number?! My code is posted below, which produces this
> output:

I though blowfish & RC4 were symmetric cyphers.

I assume you are storing this information in a relational database.
I would NOT convert to hex, or even use an obvious field name.

gtoomey


------------------------------

Date: 20 Mar 2005 21:27:29 -0800
From: el_roachmeister@yahoo.com
Subject: Re: Encrypting credit card numbers?
Message-Id: <1111382849.449003.131040@g14g2000cwa.googlegroups.com>

ok, i figured it out, I had to change these two lines:

  $encrypted .= $cipher->encrypt($tmp2);
  $unpacked .= unpack ("H16", $encrypted);

to:

  $encrypted .= $cipher->encrypt($tmp2);
my $encrypted_temp = $cipher->encrypt($tmp2);
  $unpacked .= unpack ("H16", $encrypted_temp);

The corrected code is pasted below for anyone who may find it useful:

#!/usr/bin/perl -Tw

use strict;
use warnings;
use diagnostics;

use Crypt::Blowfish;

###########################################

my $key = pack("H16", "0123456789ABCDEF");  # min. 8 bytes

our $BLOCKSIZE = 8;

my $cc_number ='4242123456789012-12-15/1984 Jack Sutton'; # yes this is
made up

my ( $encrypted, $unpacked)= &encrypt ($key, $cc_number);
my $decrypted = &decrypt ($key, $encrypted);

print "Original number is: $cc_number\n";
print "Unpacked number is: $unpacked\n" ;
print "Decrypted number is: $decrypted\n";

my $packed_from_unpack = &pack_number($unpacked);

my $decrypted_from_packed = &decrypt ($key, $packed_from_unpack);

print "Decrypted from packed: $decrypted_from_packed" . "\n";

#############################################

sub encrypt {

 my ($key,$dat) = @_;
 my $encrypted = '';
 my $unpacked = '';
 my $cipher = new Crypt::Blowfish $key;

 if ($BLOCKSIZE > 0) {
  my $l_dat = length($dat);
  for (my $i=0; $i < $l_dat;$i+=$BLOCKSIZE) {
   my $tmp = substr($dat,$i,$BLOCKSIZE);
   my $tmp2 = sprintf("%-" . $BLOCKSIZE . "s",$tmp); #pad with spaces
if string not long enough
   $encrypted .= $cipher->encrypt($tmp2);
   my $encrypted_temp = $cipher->encrypt($tmp2);
   $unpacked .= unpack ("H16", $encrypted_temp);

  }
 }
 else {
  $encrypted .= $cipher->encrypt($dat);
  $unpacked .= unpack ("H16", $encrypted);

 }
 return $encrypted, $unpacked;
}

sub decrypt {

 my ($key,$dat) = @_;
 my $dec = '';
 my $cipher = new Crypt::Blowfish $key;

 if ($BLOCKSIZE > 0) {
  my $l_dat = length($dat);
  for (my $i=0; $i < $l_dat;$i+=$BLOCKSIZE) {
   my $tmp = substr($dat,$i,$BLOCKSIZE);
   $dec .= $cipher->decrypt($tmp);
  }
 }
 else {
  $dec .= $cipher->decrypt($dat);
 }
 $dec =~ s/\s+$//; #remove trailing spaces
 return $dec;
}

sub pack_number {

 my $dat = $_[0];
 my $packed='';
   my ($tmp, $tmp2);

 if ($BLOCKSIZE > 0) {
  my $l_dat = length($dat);
  for (my $i=0; $i < $l_dat;$i+=$BLOCKSIZE) {
   $tmp = substr($dat,$i,$BLOCKSIZE);
   $tmp2 = sprintf("%-" . $BLOCKSIZE . "s",$tmp); #pad with spaces if
string not long enough
   $packed .= pack ("H8", $tmp2);

  }
 }
 else {
  $packed .= pack ("H16", $tmp2);

 }

 return $packed;

}

1;



------------------------------

Date: 20 Mar 2005 21:38:42 -0800
From: el_roachmeister@yahoo.com
Subject: Re: Encrypting credit card numbers?
Message-Id: <1111383522.230139.304790@f14g2000cwb.googlegroups.com>

blowfish is a symmetric cipher. I do not plan to store the key on the
server. The key will only be know to a few people. Those people will
simply type their key and Hex encrypted number into a web form and the
perl script will decrypt the Hex number into a plain text credit card
number. This will all be done with SSL.

Keep in mind this is all being done for some receptionists who are not
the most computer literate. So the key would be something they can
remember. They type it in once in the morning and then I'll use cookies
to store it on their computer for 1-day expiry.

Please criticize away! I am open to any suggestions, particularly if
what I am doing is big no no for security.



------------------------------

Date: Mon, 21 Mar 2005 09:13:51 +0530
From: Murugesh <appumail@gmail.com>
Subject: Re: help! Mailer
Message-Id: <wHr%d.3$FK5.42@news.oracle.com>

David K. Wall wrote:
> Murugesh <appumail@gmail.com> wrote:
> 
> 
>>I tried the following code in Windows after installing
>>Mail::Mailer module 
>>      #!/usr/bin/perl
>>     use Mail::Mailer;
>>           $from_address="map\@abcd.com";
>>          $to_address="rek2345\@yahoo.com";
>>          $subject="hi";
>>         $mailer = Mail::Mailer->new();
>>         $mailer->open({ From    => $from_address,
>>                         To      => $to_address,
>>                         Subject => $subject,
>>                      })
>>             or die "Can't open: $!\n";
>>         print $mailer $body;
>>         $mailer->close();
>>
>>when compiled it shows,
>>Died @C:\perl\site\lib/Mail/Mailer.pm
>>
>>the same program works in Solaris.Could you help what is going on
> 
> 
> Check the docs for Mail::Mailer.  It tries to send mail using 
> sendmail or qmail, neither of which is likely to exist on a Windows 
> system, or by using an SMTP server, but you didn't specify one.
    I ran the program with --smpt <server-name> option.But it didnt work 
but hangs.What could be wrong?


------------------------------

Date: 20 Mar 2005 20:48:13 -0800
From: iorcc@yahoo.com
Subject: RE: IORCC Crossword and Wordfind Puzzles
Message-Id: <1111380493.323051.141400@l41g2000cwc.googlegroups.com>

Hello Fellowist Rubyist (and scripters of all flavor)

Here is a neat Ruby-centric 84 word crossword puzzle.  To follow will
be the word find for solution words.  Its not too hard, but a good
strong search engine and some knowledge of Ruby helps.  I found all but
10 or so words/questions online.  Some are more obscurely worded and
hints are mostly available if you read the clues carefully.

   http://iorcc.dyndns.org/2005/puzzles/crossword/2005.xword.png

Q17 of the Official IORCC FAQ

   http://iorcc.dyndns.org/faq.html

spells out the prize setup for this little 'fun' sub-event.


Cheers,

Todd Nathan
IORCC Founder/Judge
irc://irc.freenode.net/iorcc (SeaForth)
http://iorcc.dyndns.org/ 
"What you talkin about Willis?" - GC



------------------------------

Date: 20 Mar 2005 15:28:27 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: Re:[perl-python] a program to delete duplicate files
Message-Id: <1111361307.620254.234540@f14g2000cwb.googlegroups.com>

Sorry i've been busy...

Here's the Perl code. I have yet to clean up the code and make it
compatible with the cleaned spec above. The code as it is performs the
same algorithm as the spec, just doesn't print the output as such. In a
few days, i'll post a clean version, and also a Python version, as well
a sample directory for testing purposes. (The Perl code has gone thru
many testings and is considered correct.)

The Perl code comes in 3 files as it is:

Combo114.pm
Genpair114.pm
del_dup.pl

The main program is del_dup.pl. Run it on the command line as by the
spec. If you want to actually delete the dup files, uncomment the
"unlink" line at the bottom. Note: the module names don't have any
significance.


Note: here's also these python files ready to go for the final python
version. Possibly the final propram should be just a single file...

Combo114.py
Genpair114.py


Here're the files: del_dup.zip
-----
to get the code and full detail with latest update, please see:
http://xahlee.org/perl-python/delete_dup_files.html

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html


Claudio Grondi wrote:
> >> I'll post my version in a few days.
> Have I missed something?
> Where can I see your version?
> 
> Claudio



------------------------------

Date: Mon, 21 Mar 2005 15:51:55 +1100
From: "Scott Bass" <usenet739_yahoo_com_au>
Subject: Read string from multiple files, output ordered by a 2nd file
Message-Id: <423e52ed$0$26167$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

Hi,

Say I have 100 files, f1 - f100.  Say the first line is "Table 1.1.1  <a
bunch of whitespace> Page 1 of x"

What I need perl to spit out is:

f1        /* Table 1.1.1              */
f2        /* Table 1.1.2              */
f3        /* Table 1.1.3.1.5          */

etc.

In pseudocode:  "take columns 1-30 from line 1 from 100 separate files, and 
spit out the filename, two tabs, slash asterisk, the text from columns 1-30, 
asterisk slash"

However, I would also like the output sorted by the data in a 2nd file.  So, 
if that 2nd file is:

Table 1.1
Table 1.5
Table 2.1
Table 3.1
Table 1.2
Table 2.2
Table 3.2
etc.

then I would like the output sorted by the order as found in that 2nd file.

Any ideas?

Thanks,
Scott





------------------------------

Date: Mon, 21 Mar 2005 05:57:51 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Read string from multiple files, output ordered by a 2nd file
Message-Id: <3a7352F65ahk6U2@individual.net>

Scott Bass wrote:
> Say I have 100 files, f1 - f100.  Say the first line is "Table 1.1.1  <a
> bunch of whitespace> Page 1 of x"
> 
> What I need perl to spit out is:
> 
> f1        /* Table 1.1.1              */
> f2        /* Table 1.1.2              */
> f3        /* Table 1.1.3.1.5          */
> 
> etc.
> 
> In pseudocode:  "take columns 1-30 from line 1 from 100 separate files, and 
> spit out the filename, two tabs, slash asterisk, the text from columns 1-30, 
> asterisk slash"
> 
> However, I would also like the output sorted by the data in a 2nd file.  So, 
> if that 2nd file is:
> 
> Table 1.1
> Table 1.5
> Table 2.1
> Table 3.1
> Table 1.2
> Table 2.2
> Table 3.2
> etc.
> 
> then I would like the output sorted by the order as found in that 2nd file.
> 
> Any ideas?

You could write a program that does it.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Mon, 21 Mar 2005 00:33:25 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Script that sends email to text box value
Message-Id: <slrnd3s225.5p7.news@maki.homeunix.net>

C. David Rossen wrote :
> Hello:
>
> I am looking for a script that will send an email to whatever address is
> entered into the text box. I usually use formmail.pl, but with that, the
> recipient is a hidden field and is specified in the html code. I want to use
> that, but I want the email to also be sent to the address that is entered in
> the email text box. Any help would be greatly appreciated.  Thanks.

There are several modules on CPAN to support sending mail i. e.
Mail::Internet

HTH
Martin

-- 
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'


------------------------------

Date: Mon, 21 Mar 2005 00:29:55 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Script that sends email to text box value
Message-Id: <3a6fpeF69bb4eU1@individual.net>

C. David Rossen wrote:
> I am looking for a script that will send an email to whatever address is
> entered into the text box. I usually use formmail.pl, but with that, the
> recipient is a hidden field and is specified in the html code. I want to use
> that, but I want the email to also be sent to the address that is entered in
> the email text box.

Even if this is not the right place to look for ready-to-go scripts, I 
can't help notice that the CPAN module CGI::ContactForm meets your 
somewhat vague specification.

     http://www.gunnar.cc/contactform/readme.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Sun, 20 Mar 2005 21:13:07 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Script that sends email to text box value
Message-Id: <Ttudnd5HAcBW1KPfRVn-og@comcast.com>

C. David Rossen wrote:

> I am looking for a script that will send an email to whatever address is
> entered into the text box. I usually use formmail.pl, but with that, the
> recipient is a hidden field and is specified in the html code. I want to use
> that, but I want the email to also be sent to the address that is entered in
> the email text box. Any help would be greatly appreciated.  Thanks.

My apologies if I'm wandering off topic, but doesn't that create an open 
relay? It seems that a spammer could exploit the script and use it to 
send spam through your mail server.


------------------------------

Date: Sun, 20 Mar 2005 22:40:07 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Script that sends email to text box value
Message-Id: <slrnd3sk17.iss.tadmc@magna.augustmail.com>

C. David Rossen <cdrossen@cdrmarketing.com> wrote:

> I am looking for a script


We discuss *writing* programs here.

Are you having trouble writing a Perl program that does what you want?


> I usually use formmail.pl, 


Gulp.


> I want to use
> that, 


Bad, bad idea!


> Any help would be greatly appreciated.


This is more helpful than you are likely to realize:

   Don't use Matt's formmail.pl !


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 21 Mar 2005 05:52:39 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Script that sends email to text box value
Message-Id: <3a72r9F65ahk6U1@individual.net>

Scott Bryce wrote:
> C. David Rossen wrote:
>> I am looking for a script that will send an email to whatever address is
>> entered into the text box. I usually use formmail.pl, but with that, the
>> recipient is a hidden field and is specified in the html code. I want 
>> to use that, but I want the email to also be sent to the address that is 
>> entered in the email text box.
> 
> My apologies if I'm wandering off topic, but doesn't that create an open 
> relay? It seems that a spammer could exploit the script and use it to 
> send spam through your mail server.

I pointed the OP to a module I wrote which does just that, and I believe 
the keyword is "also". A message sent via the module goes both to a 
pre-destinated recipient and the entered address (which normally is the 
real sender...). That, together with the fact that the originating IP 
address is stated in one of the message headers, should reasonably make 
the module unattractive for spamming.

Actually, the reason I wrote CGI::ContactForm was to make it more 
difficult for spammers (it allows you to very easily replace 
mailto-links with contact forms), and I'm convinced it serves that 
purpose. During the two years the module has been available I have never 
heard of any occurrence of abusing it for spamming.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7900
***************************************


home help back first fref pref prev next nref lref last post