Try this and modify it for what you are doing:
use strict;
my $db = 'yourfilehere.txt';
open(DATA, "$db") || die "Can not open: $!\n";
my @dat = (<DATA>);
close(DATA);
open(DATA, ">$db") || die "NO GO: $!\n"...
Try this:
open STDERR, "> /dev/null" || die "Cant redirect standard error: $!";
=================
Bad Company Music
=================
Try smtp in a hash:
{
my %mail = ( To => 'to_email_address',
From => 'from_email_address',
Subject => "Bad Company with Paul Rodgers",
Message => "Message you want in your email message",
);
$mail{smtp} = '111.222.3.44'; #your smtp ip address
sendmail(%mail) ||...
Did you put in all your Header info?
use Net::SMTP;
$smtp->datasend("From: $Fromaddresshere\n");
$smtp->datasend("To: $Toaddresshere\n");
$smtp->datasend("Subject: MySubject\n");
$smtp->datasend("\n");
=================
Bad...
I would use a Perl module called Email::Valid for validating email addresses.
use Email::Valid;
unless (Email::Valid -> address($email_addr))
{
warn "Not valid Email address\n";
return;
}
=================
Bad Company Music
=================
Here is another way you can try. I am just giving you an example here without proxy address part. As you can see I chose to print out all data and then extract specifically "last modification data". For content-type you use the "0" index and for content-length you use...
Try these:
if (($dirname eq "bass_tabs") || ($dirname eq "drum_tabs"))
For your directory check use !-s.
Meaning File or directory exists and has nonzero size, so you need the opposite as my example shows. =================
Bad Company Music
=================
Try this below:
use Net::FTP;
use strict;
use warnings;
my $ftp = Net::FTP->new("servername.here.com", Debug => 0) or die "cant connect: $@\n";
$ftp->login("myname", "mypassword");
$ftp->cwd("/yourdirectorypathhere/directory")...
vikul,
Subroutines keep their internal variables private and pass information in and out with parameters and values and oop helps perl scriptss hide complexities of programs' low level details and helps keep you from touching the messy stuff.
For example on use of LWP::Simple where you can use...
Try this example as something to work with when setting up your Perl mail script:
[/tt]
{
#use hash
my %mail = ( To => 'to_email_address',
From => 'from_email_address',
Subject => "Rough Diamonds",
Message => "Message you want in your...
I run my winnt/tasks/add scheduled tasks daily with a Net ping script to a text file with no problems. Just set your times according to how often you want to run the script similiar to unix cron.
=================
Bad Company Music
=================
Two major types of error conditions are internal errors (command problems or invalid information given by user) and external errors that the shell procedure must respond to properly. External errors are sent to the shell with a signal sent by the system telling you that some system-level event...
chdir is used in Unix Bourne and C Shell AND NT so you are okay with it here.
ls is used in Unix shells but NOT NT so you should use dir instead for your script.
pwd is used for Unix and cd should be used for NT current working directory.
Example:
$ls = `ls $file`; #unix
$ls = `dir $file`...
Try the Task Scheduler on NT. Then browse for your scripts and schedule your jobs as needed.
The path: Winnt\Tasks\Add Schedule Task =================
Bad Company Music
=================
Your missing a beginning tick here:
#base directory where user would like to search from
$basedir = /10.10.13.103:101/cgi-bin/ONE';
should be:
#base directory where user would like to search from
$basedir = '/10.10.13.103:101/cgi-bin/ONE'; =================
Bad Company Music
=================
On Unix you will need a path to the interpreter something like:
#!/usr/bin/perl or where yours is located.
Also pay attention to system command differences between OS.
Example: "dir" on NT
"ls -l" on Unix
Other things such as module location and if...
Here is a quick example:
$db = 'basicdata.txt';
open(DAT, "$db") or die ("Can not open $db: $!\n");
@data = (<DAT>); #Read file into an array.
close(DAT);
open(DAT, ">$db") or die ("Can not open $db: $!\n");
foreach $line (@data)
{
if ($line =~...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.