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 Wanet Telecoms Ltd 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 StormMedic85

  1. StormMedic85

    Easy way to pass in previous array element?

    Thank you VERY much! You're awesome!
  2. StormMedic85

    Easy way to pass in previous array element?

    Thanks! That's extremely helpful and exactly what I want! I'm just having difficulties in incorporating it into my for loop... for ($i=0; $i<$size; $i++){ $thickness = &layer($altitude[$i],$altitude[$#altitude-1]); } I can't do $altitude[$i][$#altitude[$i-1] or I get a syntax error. :-\...
  3. StormMedic85

    Easy way to pass in previous array element?

    Within a subroutine, I need to pass in two parameters...a current value (which will be passed in from the value array), and the previous value (the element in the value array BEFORE the current element). I need it to do this for every function call. Any suggestions? The array length varies each...
  4. StormMedic85

    Passing in a previous value into subroutine...

    I have something like the following but its obviously not correct. It also seems circular. The initial value for $prevalt should be 0, then should be rewritten with the previous altitude that was passed into the subroutine each time it's called. I think the way I have it now $prevalt is...
  5. StormMedic85

    Passing in a previous value into subroutine...

    I'd like to write a subroutine that performs an average of a variable over a specific layer of the atmosphere. In order to do the averaging, I need to pass in the values I wish to average (that part's easy), the current altitude (also easy), but then I also need the previous altitude since I am...
  6. StormMedic85

    Add files to a new directory in Perl?

    Got it working now! Thanks!
  7. StormMedic85

    Add files to a new directory in Perl?

    I'm able to get the program to create the directory, but I can't get it to stick the files in it. I have something like... mkdir "dirname"; opendir (dir, dirname); open (file, >'/dirname/filename.txt'); print file "testing 123"; That's off the top of my head so there may be a syntax error...
  8. StormMedic85

    Printing data out in columns?

    Thanks for all the suggestions! A current method I tried that seems to work is something along the lines of doing it within a for loop... for ($i=0; $i<$size; $i++) { print "$pressure[$i]\t$temperature[$i]\t$rh[$i]\t$uwind[$i]\t$vwind[i]\n"; }
  9. StormMedic85

    Printing data out in columns?

    Yes, exactly! --Josh
  10. StormMedic85

    Printing data out in columns?

    Anyone have any suggestions of how to print numerical data out to a file in neatly organized columns? I've seen it done with a for loop, but I'm thinking formatted print. Any ideas? Thanks!
  11. StormMedic85

    stupid question involving for loops

    Ahhhh, ok I understand now. That makes sense. Thanks very much!
  12. StormMedic85

    stupid question involving for loops

    Stupid question...but how come in the loop if I print the array all the numbers in range show up, but outside of the loop only the last one (2454378) does? I'd like to be able to store all of these numbers (julian dates) into an array that I can manipulate the elements of later. Any ideas...
  13. StormMedic85

    Proper Way To Use Grep?

    The year, month, day, and time...as inputted by the user.
  14. StormMedic85

    Proper Way To Use Grep?

    Within an array of files, I'd like to search for files with a specific pattern. All the files follow a standard format (for example, abc123.YEAR.MONTH.DAY.abc.TIME). I'm trying to use grep but I think my implementation may be incorrect. Here's an example of how I'm trying to do things...
  15. StormMedic85

    Perl Subroutine Question Involving Arrays...

    I can't seem to figure out why the subroutine is only returning the 3 values for the last element in the array I am passing to it in the foreach statement. The array @juliandate contains two elements, so I'd like to perform the calculation for both elements. Can anyone enlighten me as to where...

Part and Inventory Search

Back
Top