Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. craigmcl

    Adding days to a date.

    use Date::Calc qw(:all); ($new_year, $new_month, $new_day) = Add_Delta_Days($year, $month, $day, $Dd); ... where $new_year,... etc are the results, $year, $month, $day is your arbitrary starting date, and $Dd is the "delta" (the number of days difference). $Dd can be either positive...
  2. craigmcl

    Internal redirection w. Apache

    Apologies if I'm missing something obvious; I've been up a long, long time. :) Is there a reason you can't use mod_perl's internal_redirect_handler? Basically, you'd set up a module as a PerlTransHandler in your httpd.conf, and that module would have some way of knowing what "real&quot...
  3. craigmcl

    how to send HTML email?

    You don't need to change the code above, just change the contents of $message to include your HTML. If the mail reader supports HTML email, it'll work... if not, it will still work (from your end), but will display the raw HTML to the user. For example: $message = &quot;<HTML><BODY><P...
  4. craigmcl

    Find Current Date with Perl

    Date::Calc will do the job, honest! Just use the Today() function: ($year,$month,$day) = Today([$gmt]); ... and then parse the results. Alternately, you can use the &quot;Swiss Army Knife&quot; of date manipulation, Date::Manip. Here's a little snippet that gets the current date and prints...
  5. craigmcl

    Using PERL to access MainFrame tables?

    Anything is possible. :) The real question would be: where is the perl script living, what is the nature of the database on the big iron, and how do the two talk? There are many database interfaces available in perl, for a variety of databases. Check...
  6. craigmcl

    Time modules

    I'm not entirely clear on what you're trying to accomplish... it sounds like you have a list of deltas (differences between two dates) and you're trying to find the average of those. Take a look at the Date::Manip package on CPAN (http://search.cpan.org). There are all kinds of date comparing...
  7. craigmcl

    Unix Programming in Perl

    fagga -- system() forks off a new process, runs the specified program, then returns to the calling program, which has been patiently waiting for the return. Your calling program can check return codes, look for errors, etc. exec(), on the other hand, replaces your current process with the new...
  8. craigmcl

    Digest::SHA1 and sha1sum disagreements

    Anyone know why sha1sum and the following script which uses Digest::SHA1 would generate different output? Am I misusing Digest::SHA1 in some weird way? #!/usr/bin/perl -w use Digest; sub hash_msg { my $hashed = Digest->new(&quot;SHA-1&quot;); $hashed->add($_[0]); return...

Part and Inventory Search

Back
Top