Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: Re: Aging Script

by OzzyOsbourne (Chaplain)
on Aug 10, 2001 at 22:34 UTC ( #103991=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Aging Script
in thread Aging Script

With this code, you are looking for the d option twice. If you use the -d option (agecmd.pl -d90) at all, the code will die. Are you running the code with the d option? If not, you don't really need the whole getopt section. Do you have the Getopt::Std module installed?

-OzzyOsbourne

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Aging Script
by Seema (Novice) on Aug 11, 2001 at 01:14 UTC
    I was aware that I was looking at the -d option twice. Though when I ran the script that you had orginally gave me, I got an error stating: that -h option was only used once. I think thats why I changed it..and now I am confused.
    I want to use the -d option..but don't know how to go around the error I am getting. No, I dont' have Getopt::Std module installed. I am very new to cron..so if you don't mind explaining that bit...that would be great. Thanx!
    ~Seema

      Option 1:In order to use the otions in the script, you have to have getopt::Std installed (use Getopt::Std) as mentioned at the top of the script. Read here for more info. This should solve your issue.

      Option 2:Wipe out all of the options, and setting $agedays=$ARGV[0] which would be the same as running agecmd.pl days. This requires no additional modules, but you'd have to rewrite the error checking so that the argument is a number and not "xfl" or something equally incorrect. Here is a thread referencing this option.

      Option 3: Or you can wipe out the whole options section at the top and just simply set $agedays to whatever number of days you require.

      -OzzyOsbourne

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103991]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2023-12-03 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?