Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Retrieving a single line

How to retrieve a single line for script variable



7:11 am on Jan 2, 2001 (gmt 0)

5+ Year Member

I have a simple link rotation script I want to use and have been modifying it ith my limited knowledge of Perl.

My question is how can I get a single line from a text "database" of URLs and send it along with the LOcation: command?

Here is what I have so far, but it doesn't work. I also need to "strip" the return and blank space at end of line.
open (LINKS, "$linkfile");

$lines=@file=<LINKS>; # inhale file & get # of lines

foreach $line (@lines) {
chop ($line) if ($line =~ /\n$/);

print "Location: [goingplatinum.com...]

close (LINKS);


Any snippet would be appreciated


8:03 pm on Feb 28, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Better late than never... I'd probably do it this way:

open (LINKS, "$linkfile");
close (LINKS);


...and then use $gpmember in your "Location: " line.

Featured Threads

Hot Threads This Week

Hot Threads This Month