Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: open a file and print out to webbrowser

by Sidhekin (Priest)
on Oct 30, 2007 at 19:15 UTC ( #648089=note: print w/replies, xml ) Need Help??


in reply to open a file and print out to webbrowser

Ah. PerlScript. :)

One problem is with your filename string:

my $sitelist_file="<c:\supportweb\content\sitelist.txt" print $sitelist_file; __END__ <c:supportwebntentsitelist.txt

Double-quoted strings treat backslash as starting escape sequences. Use single quotes instead:

my $sitelist_file='<c:\supportweb\content\sitelist.txt'; print $sitelist_file; __END__ <c:\supportweb\content\sitelist.txt

A more fundamental problem is that you're not checking if your open succeeded. A standard check would have revealed this problem to you:

open DATA, $sitelist_file or die "Cannot open '$sitelist_file': '$!'";

... that is, if you know where to find the error log. It's been too long since I looked at ASP and PerlScript.

Oh, and you have a syntax error. Typo? for each should be foreach, or simply for:

for my $line (@lines){ $response->write($line); }

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://648089]
help
Chatterbox?
[Corion]: ambrus: Yeah, at least that's what I think I'll start with. A timer and potentially the dummy IO function that never is ready
[ambrus]: That only lets you invoke the main loop from Prima->run;, not from AnyEvent->condvar- >recv; but that shouldn't matter
[Corion]: ambrus: Details ;)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2016-12-08 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.