Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
# HTML2ASP # By patgas # April 30, 2001 # # Takes an HTML file, and converts it into a # Response.Write command for an ASP page. # # Usage: # perl [input_file] [output_file] (command_indent) (HTM +L_indent) # # input_file and output_file are required. # command_indent inserts whitespace before the actual Response.Writ +e command. # HTML_indent inserts whitespace in the string argument to Response +.Write. my ($infile, $outfile, $indentCommand, $indentHTML) = @ARGV; die "Missing required argument: $!" if (!$infile || !$outfile); $indentCommand ||= "2"; $indentHTML ||= "0"; open(IN, $infile) or die "Can't open input file: $!"; open(OUT, ">$outfile") or die "Can't open output file: $!"; print "Starting... "; select(OUT); print "<%\n\n"; $indentCommand = ' ' x $indentCommand; $indentHTML = ' ' x $indentHTML; my @lines = <IN>; my $writeCommand = 1; while (@lines) { chomp(my $line = shift @lines); print $indentCommand; if ($writeCommand == 1) { print "Response.Write("; $writeCommand = 0; } else { print " "; } print $indentHTML; if ( $line ) { $line =~ s/\"/\"\"/g; print "\"$line\" & "; } print "vbNewLine"; if (@lines) { print " & _"; } else { print ")\n"; } print "\n"; } print "%>"; print STDOUT "Done."; close IN or die "Can't close input file: $!"; close OUT or die "Can't close output file: $!";

In reply to HTML To ASP Converter by patgas

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (3)
    As of 2020-10-26 22:57 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (254 votes). Check out past polls.