Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] CGI question

Expand Messages
  • Octavian Rasnita
    Try using $| = 1; Teddy s Center: http://teddy.fcc.ro/ Mail: orasnita@home.ro ... From: Sean Correia To:
    Message 1 of 5 , Aug 7, 2002
    • 0 Attachment
      Try using $| = 1;

      Teddy's Center: http://teddy.fcc.ro/
      Mail: orasnita@...

      ----- Original Message -----
      From: "Sean Correia" <sean.correia@...>
      To: <perl-beginner@yahoogroups.com>
      Sent: Wednesday, August 07, 2002 4:00 PM
      Subject: RE: [PBML] CGI question


      > Michael,
      >
      > I do not think this is possible. The way the browsers parse HTML is the
      limitation. Netscape for instance will not show you a damn thing until it
      reaches the final </table> tag. It's a browser issue, so there's nothing you
      can do in Perl that will help you.
      >
      > - sean
      >
      > > I am trying to execute a perl CGI script and have all script
      > > output streamed to the browser window
      > > as the script proceeds. I don't want to wait until the
      > > script finishes to see the output. I want
      > > it to be displayed real time. Any help is appreciated.
      > >
      > > -Michael
      >
      >
      > Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
    • Michael McQuarrie
      I know it is possible because I ve seen it. Specifically an application called SiteScope (browser based) does it. The application is available from
      Message 2 of 5 , Aug 7, 2002
      • 0 Attachment
        I know it is possible because I've seen it. Specifically an application called SiteScope (browser
        based) does it. The application is available from www.sitescope.com. I've seen it in other
        places but I cannot see the source code. The SiteScope application contacts a server, logs in,
        then executes some commands. The output is streamed to the browser line by line.

        -Michael

        --- Sean Correia <sean.correia@...> wrote:
        > Michael,
        >
        > I do not think this is possible. The way the browsers parse HTML is the limitation. Netscape for
        > instance will not show you a damn thing until it reaches the final </table> tag. It's a browser
        > issue, so there's nothing you can do in Perl that will help you.
        >
        > - sean
        >
        > > I am trying to execute a perl CGI script and have all script
        > > output streamed to the browser window
        > > as the script proceeds. I don't want to wait until the
        > > script finishes to see the output. I want
        > > it to be displayed real time. Any help is appreciated.
        > >
        > > -Michael
        >


        __________________________________________________
        Do You Yahoo!?
        Yahoo! Health - Feel better, live better
        http://health.yahoo.com
      • frankie
        Hi again people, Sorry for being such a pain lately.. I have after much searching, I found a regex I need in another program... and modified it slightly to
        Message 3 of 5 , Aug 7, 2002
        • 0 Attachment
          Hi again people,

          Sorry for being such a pain lately..

          I have after much searching, I found a regex I need in another program...
          and modified it slightly to work for my application...

          This is the regex,, its a biggie..

          $line =~ s/
          # First look for an a, img, or area, followed later by an href or src
          (<\s*(?:a|img|area)\b[^>]*(?:href|src)\s*=\s*
          # Then an optional quote
          ['"]?)
          # Then the interesting part
          ([^'"> ]+)
          # Then another optional quote
          (['"]?
          # And the left-overs
          [^>]*>)
          /
          # Then construct the new link from the prefix and suffix
          $1.sprintf("%s",URI->new($2)->abs($images_url)).$3
          /segix;

          right now, it successfully replaces all relative image urls in a html
          document with the one I want to replace them with.. it does that just fine.

          However, I need it to replace ALL the image paths with my new one.. not just
          relative paths..

          at the moment, the results of this script are that all images except those
          that were relative in the first place have the wrong src attribute...
          (absolute paths are left untouched as they don't match the regex.. but I
          don't know how to make it match all of them, not just relative src.)


          Can anyone tell me why this thing only works on relative paths? and what I
          can do to rectify that?


          As always, I am really appreciative of any help.



          regards


          Frank
        • amitmorson
          Michael, That s what you do: As the script is triggered, the browser will be redirected to an html file. The output of the script file will be parsed into that
          Message 4 of 5 , Aug 7, 2002
          • 0 Attachment
            Michael,

            That's what you do:

            As the script is triggered, the browser will be redirected to an html
            file. The output of the script file will be parsed into that same
            html file as the sript progresses. At the head of the html you put:
            <META HTTP-EQUIV="Refresh"
            CONTENT="1;URL=http://www.somesite.org/somefile.html"> which will
            refresh and reload the file every one second. At the end of the
            script you remove the META tag so the file will stop refreshing when
            the script is done. This will give the user the "illusion" that
            he/she see's the script progress in real time.

            I think this is as best as it goes.

            Amit




            --- In perl-beginner@y..., "Octavian Rasnita" <orasnita@h...> wrote:
            > Try using $| = 1;
            >
            > Teddy's Center: http://teddy.fcc.ro/
            > Mail: orasnita@h...

            >
            > > Michael,
            > >
            > > I do not think this is possible. The way the browsers parse HTML
            is the
            > limitation. Netscape for instance will not show you a damn thing
            until it
            > reaches the final </table> tag. It's a browser issue, so there's
            nothing you
            > can do in Perl that will help you.
            > >
            > > - sean
            > >
            > > > I am trying to execute a perl CGI script and have all script
            > > > output streamed to the browser window
            > > > as the script proceeds. I don't want to wait until the
            > > > script finishes to see the output. I want
            > > > it to be displayed real time. Any help is appreciated.
            > > >
            > > > -Michael
            > >
            > >
            > > Unsubscribing info is here:
            > http://help.yahoo.com/help/us/groups/groups-32.html
            > >
            > > Your use of Yahoo! Groups is subject to
            http://docs.yahoo.com/info/terms/
            > >
            > >
            > >
          Your message has been successfully submitted and would be delivered to recipients shortly.