MkIIISupra
Programmer
Below is the error I get when I try to run a script I am slowly building. I am in the learning process with Perl and this is my 3 script that I have written. The first two were very simple and short. My goal with this script when I finish is to have a CRON job scan a predefined directory and when specific files appear, move (and copy in some cases) the files to a predetermined directory, rename them and in specific cases e-mail a copy of the files to predefined recipients. The intent is to ensure all reports and files are delivered and filed correctly. Please be patient as I am a total newb to Perl, and I do have several books but I am still getting stumped with this one.
Linux: perl Report\ Processor
Argument "Jan" isn't numeric in numeric eq (==) at Report Processor line 15.
Argument "May" isn't numeric in numeric eq (==) at Report Processor line 15.
Guess what! Jan, worked!
Linux:
Here is the code that generates the error above:
One by one the penguins return my sanity, as day by day Microsoft steals my sanity!
OpenSuSE 10.0 kicks fanny!
Linux: perl Report\ Processor
Argument "Jan" isn't numeric in numeric eq (==) at Report Processor line 15.
Argument "May" isn't numeric in numeric eq (==) at Report Processor line 15.
Guess what! Jan, worked!
Linux:
Here is the code that generates the error above:
Code:
#!/bin/bash/perl -w
# This is a rename and move script. The goal is to rename files then move them to their
# appropriate folders, and then e-mail (hopefully) the files to pre-defined people.
use warnings;
use strict;
use Time::Local;
my $date = `date`; # Load $date with system date.
chomp $date; # Clear any trailing spaces
my $mMonth = substr ($date, 4, 3); # Move month into mMonth to be used to perform renames and moves based on the month.
if ($mMonth == "Jan"){
print "Guess what! Jan, worked! \n";
}
elsif ($mMonth == "Feb"){
print "Guess what! Feb, worked! \n";
}
elsif ($mMonth == "Mar"){
print "Guess what! Mar, worked! \n";
}
elsif ($mMonth == "Apr"){
print "Guess what! Apr, worked! \n";
}
elsif ($mMonth == "May"){
print "Guess what! May, worked! \n";
}
elsif ($mMonth == "Jun"){
print "Guess what! Jun, worked! \n";
}
elsif ($mMonth == "Jul"){
print "Guess what! Jul, worked! \n";
}
elsif ($mMonth == "Aug"){
print "Guess what! Aug, worked! \n";
}
elsif ($mMonth == "Sep"){
print "Guess what! Sep, worked! \n";
}
elsif ($mMonth == "Nov"){
print "Guess what! Nov, worked! \n";
}
elsif ($mMonth == "Dec"){
print "Guess what! Dec, worked! \n";
}
else {
print "Oh HELP ME! The date function failed! \n";
}
One by one the penguins return my sanity, as day by day Microsoft steals my sanity!
OpenSuSE 10.0 kicks fanny!