#!/usr/bin/perl -w use strict; use 5.010; use lib "template_stuff"; use html3; sub rndStr{ join'', @_[ map{ rand @_ } 1 .. shift ] } my $new_name = rndStr( 5, 'a'..'z', 1..9); my $ref_to_name = \$new_name; my $return_page = create_page($ref_to_name); say "page is $return_page"; email_link($return_page); sub email_link{ use strict; use 5.014; use Net::SMTP; use config2; my $link = shift; my $sub_hash = "my_ftp"; my $host = $config{$sub_hash}->{'site'}; say "host is $host"; my $phone = $config{$sub_hash}->{'phone'}; say "phone is $phone"; my $smtp = Net::SMTP->new( Host => $host, Debug => 2); $smtp->mail($ENV{USER}); $smtp->to($phone); $smtp->data; $smtp->datasend("Subject: This is your map link"); $smtp->datasend("$link\n"); $smtp->dataend; $smtp->quit; } __END__ #### C:\cygwin64\home\Fred\pages2\plot\alpaca>perl alpaca3.pl cipher is 2sq8b word is 2sq8b you are here / a is . .. pdb1.html images pdb2.html pdb3.html pdb4.html jjgg4w5q1.html 1ty83zib 1.html hwr241.html i1f291.html wfi8z1.html r28zr1.html pn8ns1.html j69a91.html old num is 0 line 70 says html filename is 2sq8b1.html in create html file your data is 2sq8b1.html remote_dir is 2sq8b1 default is a.txt file down here is 2sq8b1.html new file is 2sq8b1.html page is 2sq8b1.html host is www.1and1.com phone is redacted@txt.att.net Can't call method "mail" on an undefined value at alpaca3.pl line 27. #### package config2; use Exporter qw(import); our @EXPORT = qw(%config); our %config = ( my_ftp => { domain => 'www.merrillpjensen.com', username => '...', password => '...', smtp => 'smtp.1and1.com', phone => '...@txt.att.net', site => 'www.1and1.com', }, ); 1;