Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
How about this code alternative:
use strict; use File::Basename; my ($name,$path,$suffix) = fileparse($ARGV[0], '\.html?'); unless (($suffix) && (-e $ARGV[0])) { complain() } rename ($ARGV[0], $path . $name . ".asp") && print "File converted to ASP!" or complain(); sub complain { print "Error: Check and try again"; exit; }
Admittedly the error checking could be better and we should use a GetOpt::* module to get the input filename but I think it does the job.

Basically, ignore my previous post because even though you are converting a static htm file to ASP, it will still be slower than regular html on IIS 5 because you are adding unnecessary Response.Write statments. You don't need them at all. You can display static HTML as static html with an ASP extension, you don't need to enclose it all in <% tags. You're making the webserver do more work by having to process the file with asp.dll even on IIS5

Does this make sense?
Update: I don't intend this post to sound harsh, but you are making the HTML very ugly and hard to maintain because each line will be wrapped between Response.Write(?). I also think it will break if you have any text on multiple lines that are between <pre> tags and multi-line text boxes - you'll have an extra carriage return in there, plus vbNewLine - written out.

$code or die
$ perldoc perldoc

In reply to Re: HTML To ASP Converter by $code or die
in thread HTML To ASP Converter by patgas

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-19 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found