Re: using HTML::Template effectively

Discussion in 'Perl Misc' started by J. Gleixner, Jun 26, 2012.

  1. J. Gleixner

    J. Gleixner Guest

    On 06/26/12 14:31, Cal Dershowitz wrote:
    > I've been using perl scripts to mechanize oft-repeated tasks for my
    > website. I tell my friend what I'm doing and he says, "oh you need
    > HTML::Template."

    Have your friend help you first and do we need to know what your friend

    >What I hope to do with this thread is re-write it with
    > modules, as well as providing a utility to make my choice of filenames
    > less obvious, but still within the organizational scheme that will be
    > this site.
    > First, though, I want to go back just a bit and clear up my last few
    > difficulties with what has gone before:

    First though, this has nothing to do with the Subject!!!!!!!! Folks
    who know a lot about HTML::Template just wasted their time reading
    your post.

    > Q1) I continue to have difficulties combining the syntax of lexical
    > variables and RE's:
    > my $word = "ceiling";
    > my @matching = map /ceiling_(\d+)\.html/, @remote_files;
    > my $html_file = "ceiling_$newnum1.html";
    > How would I write those last 2 lines of code with $word instead of
    > "ceiling?"

    This is all you needed to post. Code showing the issue and
    your question.

    Use ${word} where you want it to occur, instead of $word.

    my $html_file = "${word}_$newnum1.html";

    Since you could have a variable $word_, you need to show
    that you really only want it to use $word.

    > Q2) There's a huge amount of reading out there on this topic, which I'm
    > grateful for. Anyone have a link that they think is particularly
    > effective at studying up on this?
    > Q3) This one's a little out there. Right after the unlink statement up
    > there, or better yet, just before the close statement, what would happen
    > if you wrote:
    > open( my $gh, '>', or die("Can't open for
    > writing: $!");

    No need for () there..
    die "Can't open for writing: $!"

    > where the name of the script itself is,and then attempted to
    > write from $gh to $fh linewise? I know it's illegal in C, so I don't
    > want to just try it and see what happens.

    Bye bye

    Think about it.....
    What do you think '>' will do?
    Why do you think you want do to that?
    Actually, I'm not sure what you're asking.. How do you 'write from $gh
    to $fh'?

    You can answer this yourself. Be sure to have a copy of
    first though.

    > It's too much work cleaning up...

    Do you think anyone will continue reading your post if put in
    more garbage???..
    J. Gleixner, Jun 26, 2012
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Makholm

    Re: using HTML::Template effectively

    Peter Makholm, Jun 27, 2012, in forum: Perl Misc
    Peter Makholm
    Jun 27, 2012
  2. Rainer Weikusat

    Re: using HTML::Template effectively

    Rainer Weikusat, Jun 27, 2012, in forum: Perl Misc
    Ivan Shmakov
    Jul 7, 2012
  3. Rainer Weikusat

    Re: using Template effectively

    Rainer Weikusat, Aug 21, 2012, in forum: Perl Misc
    Rainer Weikusat
    Aug 21, 2012
  4. Rainer Weikusat

    Re: using Template effectively

    Rainer Weikusat, Aug 21, 2012, in forum: Perl Misc
    Rainer Weikusat
    Aug 21, 2012
  5. Peter J. Holzer

    Re: using Template effectively

    Peter J. Holzer, Aug 21, 2012, in forum: Perl Misc
    Rainer Weikusat
    Aug 23, 2012

Share This Page