in reply to Passing data from one script to another

Everything you need is in the @argv array, but the best way to access that array IMHO is using 'shift'. Here's a quick test I created to show a script accepting command line parameters:
#!/usr/bin/perl -w # # This script is set up to accept *3* parameters: # >./perl_argv.pl abc 123 xyz use strict; my $arg1 = shift; my $arg2 = shift; my $arg3 = shift; if (! $arg1) { print "Didn't get 1st argument!\n"; } else { print "1st argument = $arg1\n"; } if (! $arg2) { print "Didn't get 2nd argument!\n"; } else { print "2nd argument = $arg2\n"; } if (! $arg3) { print "Didn't get 3rd argument!\n"; } else { print "3rd argument = $arg3\n"; }
HTH.

Replies are listed 'Best First'.
Re: Re: Passing data from one script to another
by hmerrill (Friar) on May 02, 2003 at 15:24 UTC
    For the MD5 part, I did a google search for 'perl encrypt md5' and found this link:

    http://www.cpan.org/modules/by-module/Digest/Digest-Perl-MD5-1.5.readme

    I haven't used it, but looks like perl module Digest::MD5::Perl does what you want.

    HTH.
Re: Re: Passing data from one script to another
by Anonymous Monk on May 02, 2003 at 15:48 UTC
    I have just taken a look at Digest:MD5 and it looks fairly simple to use _if you know how_. How would i pass somethign like $password containing a plain text password thru Digest:MD5 and output the encrypted password as $encr_pass?