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

Re: [BUG] Inconsistent $r->print() behavior with references

Expand Messages
  • Rafael Garcia-Suarez
    ... At first sight, a = looks more correct here -----------^^ ... your call :) (I wasn t ever aware of this magical dereference thing) -- Reporting bugs:
    Message 1 of 35 , Dec 2, 2003
    • 0 Attachment
      Geoffrey Young wrote:
      > I think the issue is that after your manipulations $dataref is no longer a
      > plain PV. I used Devel::Peek to look at $dataref before and after and it
      > changes from a PV to PVMG. where this trips up mod_perl is in
      > Apache::write_client:
      >
      > SV *sv = SvROK(ST(i)) && (SvTYPE(SvRV(ST(i))) == SVt_PV) ?

      At first sight, a >= looks more correct here -----------^^

      > (SV*)SvRV(ST(i)) : ST(i);
      >
      > so, if the scalar reference to be printed isn't of type SVt_PV it does not
      > get dereferenced.
      >
      > I suppose we could change that to a SvPOK check instead, but I'm really not
      > inclined to change anything here - doug has said several times that the
      > magical dereferencing in $r->print() was a bad idea and should be considered
      > deprecated. it's not in 2.0 either, so you'll need to dereference yourself
      > in order to port your code (someday :)

      your call :) (I wasn't ever aware of this magical dereference thing)

      --
      Reporting bugs: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
    • Jonathan Field
      Thanks, all, for the prompt attention. I will update my coding habits accordingly :) Cheers ... -- Reporting bugs: http://perl.apache.org/bugs/ Mail list
      Message 35 of 35 , Dec 10, 2003
      • 0 Attachment
        Thanks, all, for the prompt attention. I will update my coding habits
        accordingly :)

        Cheers

        On Wed, 10 Dec 2003, Stas Bekman wrote:

        > I've pinged Doug and the final verdict is this:
        >
        > The print-a-scalar-reference feature is now deprecated. There are
        > known bugs when using it and it's not supported by mod_perl 2.0. If
        > you have a scalar reference containing a string to be printed,
        > dereference it before sending it to print.
        >
        > It's now documented as such.
        >
        > Jonathan, please adjust your code to dereference the scalar references before
        > sending them to print.
        >
        > __________________________________________________________________
        > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        > http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        > mailto:stas@... http://use.perl.org http://apacheweek.com
        > http://modperlbook.org http://apache.org http://ticketmaster.com
        >


        --
        Reporting bugs: http://perl.apache.org/bugs/
        Mail list info: http://perl.apache.org/maillist/modperl.html
      Your message has been successfully submitted and would be delivered to recipients shortly.