in reply to Re: How can I print all lines instead of 1 random?
in thread How can I print all lines instead of 1 random?

Thanks for the response. I can't get your suggestion to work. I don't want to print out all lines randomly, I would like each line printed one at a time, in order they are listed in the banners.dat file. I keep track of my sponsors in the banners.dat file including their link|image|width|height|alt tags I use the script (the one I posted) to show a random banner at the top of each page. I want to be able to show all my current sponsors on a separate page. Hope that makes sense.
  • Comment on Re: Re: How can I print all lines instead of 1 random?

Replies are listed 'Best First'.
Re^3: How can I print all lines instead of 1 random?
by CheeseLord (Deacon) on Aug 20, 2001 at 07:37 UTC

    Okay, in that case, my code should still work about the same way... just change the splice line to this:

    @lines = <LINE>;

    And inside the for loop, you'll want to just print out the sponsors' links (or images, or whichever field(s) you want to print out), as opposed to printing out the complete set of information for each sponsor. If that fails for some other reason (say, "Cheesy wrote bad code") then tell me what errors you're getting and I'll give it another shot. Hope that helps!

    Note: If this file is big, you'll likely want to process each one individually with a while loop, instead of a for.

    His Royal Cheeziness