CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
temp file

 



ttpong80
stranger

Nov 9, 2001, 11:30 AM

Post #1 of 2 (775 views)
temp file Can't Post

Originally, I get a page from a url and save it in a temp file called ABC. Then I read each line from ABC and do some operations (check regular pattern). But I am afriad that if there are some uers run my cgi program at the same time, some ABC files will create (but they should be different!!)
so how can I solve the problem?
is it possible that no temp file need to make? And directly can read each line from $page?
my code:
use LWP::Simple;
$page=get("$full_url");
open (OUTPUT, ">ABC") || die ("Could not open file \n");
print OUTPUT $page;
close(OUTPUT);
open (INPUT, "ABC") || die ("Could not open 7 \n");
$j=0;
while(<INPUT>){
.......}



vallely
Novice

Nov 10, 2001, 4:52 PM

Post #2 of 2 (765 views)
Re: temp file [In reply to] Can't Post

You could put your lines into an array.

$page = get("URL");
@lines = split(/\n/,$page);







 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives