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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by netrookie

  1. netrookie

    Perl - should I use array or hash of hashes?

    Hi, Annihilannic. When you say, log rotated, you mean like the log is renamed? or refreshed? I have a separate script that is pulling the logfile remotely. I am maintaining the same name, but the next it copies could be a file with new records. So the file would change in that sense.
  2. netrookie

    Perl - should I use array or hash of hashes?

    My Perl friends! Thank you for your recent help on this parse log script. There are some changes I need to make on the logic of my code. Instead of filtering on date, I need to somehow keep track of the last record I parsed. I am basically pulling a copy of the log file on an hourly basis and...
  3. netrookie

    Perl - should I use array or hash of hashes?

    @xhonzi - thanks for your input. As for my data. Its not random. Although for every backup set I have, I am looking for particular attributes. But on occasion for some rows, the value will not be there. What I would like to do is create as csv type datafile with this if possible. Thanks.
  4. netrookie

    Perl - should I use array or hash of hashes?

    @Annihilannic - Thanks for the suggestion. I am using @ARGV for this.
  5. netrookie

    Perl - should I use array or hash of hashes?

    @Franco - Thank you! This is great. You basically nailed what I've been trying to figure out as in understanding the structure of this. Yes, the $server has to be constant since I am mining all the backup values for each given log from $server. I added that key for that and wasn't sure if that...
  6. netrookie

    Perl - should I use array or hash of hashes?

    Perl newbie here. I have some working code I strung up together with help from others along the way. I am still quite unclear of how I should approach this problem with using an array of hash, hash refs. Right now it works using hashes, but I was also advised I can use an array for thise too. As...
  7. netrookie

    shell script help - using find

    I have the following shell script: #!/bin/bash find /db1/sgl/backup/ -name "*sgl*" -mtime +20 -print | cut -c21-28 | while read RECORD do echo "ls -ltr *$RECORD*" >> listfiles.sh done The output file would look like this: ls -ltr *sgl_p814* But there are instances where the filename has...
  8. netrookie

    Help - redirect screen output into a open file handle/logfile

    Thank you Annihilannic! That's much shorter code. No, I didn't realize I can just call this. I'm still learning a lot on how to use perl. Thanks for the tip.
  9. netrookie

    Help - redirect screen output into a open file handle/logfile

    This seems to work, as I think I understand this correctly: my $chkenv = `/bin/env`; Then within, the open handle and a successful check, printed it out to the filehandle. open (MYLOG, ">>/home/mylog") || die "cannot append $!"; my $rc = system ($runrc); #runs the command...
  10. netrookie

    Help - redirect screen output into a open file handle/logfile

    I am trying to capture output that I need, thus creating my own logfile after script execution. I am using the system() command to execute (2) programs. The first one is calling another perl script, the second one is a simple printout of the environment, using 'env', but I want it to be...
  11. netrookie

    How to add perl module using CPAN on macosx 10.5.8

    I want to add and use a perl module called Finance::Quote using CPAN. This is the first module that I had tried to add using CPAN. I am doing this on my mac book pro that is running perl version 5.8 on mac osx (10.5.8, 2.4Ghz Intel Dual Core 2 Duo) I am getting the following errors, try to...
  12. netrookie

    variable interpolation - help

    I found out my problem. It works now. I used qx and build the filename from that. my $datecnf = qx(date '+%Y%m%d'."cnf"); # Build system command to execute my $get_cmd = "scp $hostname:/home/y/etc/my.cnf $datecnf";
  13. netrookie

    variable interpolation - help

    So far I have this script running, but what I want to do is create a timestamped file, getting from date and then call it for example 20100319.cnf I am having problems though trying to get the date part to append to the ".cnf" name. I tried using "." to concatenate it. Apparently I don't...
  14. netrookie

    How to execute oracle utility within perl script

    Thanks Kevin, got it to work!
  15. netrookie

    How to execute oracle utility within perl script

    So, comment out the my declaration for this and replace with a quote? Like this? my $expdp='/home/oracle/product/11.1.0.6.0/bin/expdp parfile=/home/oracle/param/TST.par'; if (($checkrpc1 == 1) && ($checkrpc2 == 1)) { print qq (\nBoth NFS rpc daemons are UP. $date); send_email("Both NFS...

Part and Inventory Search

Back
Top