Avatar of new_perl_user
new_perl_user

asked on 

Automating Perl Script

Hi,

I want to automate a  Perl script to run daily. Right now I am executing it from the command line as

uniserver:/usr/qa/Scripts/files> ./test.pl  filename

where test.pl is the script and the filename is the file it has to process.(like input file)


but when automating how can I call the script with the filename.

I tried it wrap it up in another script as:

#!/usr/bin/perl

do '/usr/qa/Scripts/files> ./test.pl  filename'      

and call the above script in Cron  but it is not working.

Perl

Avatar of undefined
Last Comment
parparov
Avatar of magento
magento

why cant u hard code the variable inside the script..

instead of $1 ..use this my $filename=filename
Avatar of new_perl_user
new_perl_user

ASKER

i DID IT JUST NOW AND WAS ABOUT TO REPLY.

ASKER CERTIFIED SOLUTION
Avatar of Nem Schlecht
Nem Schlecht
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of new_perl_user
new_perl_user

ASKER


I tried earlier the second one but it did not work. will try the first option and will update.
Avatar of parparov
parparov
Flag of United States of America image

Did the cron job fire? Did the script start?

If the cron job fired and script started but failed, or script proved unstartable root would get a mail about the problem.
Perl
Perl

Perl is a high-level, general-purpose, interpreted, dynamic programming languages with over 25 years of development. Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large-scale development projects. Perl gained widespread popularity as a Common Gateway Interface (CGI) scripting language, in part due to its regular expression and string parsing abilities. In addition to CGI, Perl is used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications.

26K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo