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 TouchToneTommy 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. johndoe3344

    Regarding variable scope within conditionals

    I'm trying to make a program which has a menu doing two things: (1) Read data from an input file (2) Write certain pieces of the most recently read data to an output file (3) Exit The user needs to be able to keep repeating choice 1 for as long as he/she wants, and then use choice 2 to write...
  2. johndoe3344

    Opening a range of files with OPEN

    I have a list of files named 'test1.txt', 'test2.txt', 'test3.txt'... etc to 'test35.txt'. I want perl to open test1, perform some operation, then do the same to test2, and so on. This is my code fragment: ... ... for ($a = 1; $a <=35; $a++) { my $input = "test" . "$a" . ".txt"; open...
  3. johndoe3344

    Need help regarding divisible numbers

    How would I test whether a number is divisible by a certain combination of numbers (say 2 and 3?) The number 4 fits, because it divides by 2, and then by 2. The number 12 fits, because it divides by 3, then by 2 twice. The number 15 doesn't fit because after dividing by 3, 5 is not divisible by...
  4. johndoe3344

    Regarding file outputs to different files

    I have a question on how to print to different files, say, out.1.txt, out.2.txt, etc. If i have open (OUTP, ">out.txt") print OUTP "$_"; in some sort of loop, then out.txt only stores the information in the last iteration of the loop because all the other attempts were overwritten. What I'm...
  5. johndoe3344

    Quick question about filehandles

    The segment of code in question is: Let's say input.txt consists of the lines: file_name_1.txt file_name_2.txt file_name_3.txt What I want the script to do is open each of these files, and invoke a certain subroutine with each one. Would that work?
  6. johndoe3344

    Very short perl script - Why doesn't it work?

    Hi, I'm a newbie to perl. I just started learning it a few days ago. The short script that I made is: The file that it takes as input, sample.txt is something like as follows: What I want the script to do is to display only the numbers containing "KEYWORD" so for this case, I just want it to...

Part and Inventory Search

Back
Top