[27845] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9209 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 28 14:05:55 2006

Date: Fri, 28 Apr 2006 11:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 28 Apr 2006     Volume: 10 Number: 9209

Today's topics:
        [RDBO] ANNOUNCE: Rose::DB::Object 0.722 released <siracusa@mindspring.com>
        How to display image from RAM with some text around <no@thanks.com>
        Simulating 'use vars' <bol@adv.magwien.gv.at>
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <adamk@cpan.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 28 Apr 2006 00:25:27 GMT
From: John Siracusa <siracusa@mindspring.com>
Subject: [RDBO] ANNOUNCE: Rose::DB::Object 0.722 released
Message-Id: <IyFoMv.pD9@zorch.sf-bay.org>

The "inheritance actually works now" release.  The Clone::PP dependency is
gone, replaced with Clone.  Scalar::Util::Clone will be used if installed,
but is not strictly required.  (It is recommended, however.)  More info and
an example can be found in the "Inheritance" section of the Rose::DB::Object
documentation.

Files sent to CPAN and on SF.net

http://sourceforge.net/project/showfiles.php?group_id=147570

(I screwed up the 0.721 release by forgetting to expunge a few uses of
Clone::PP.  Sorry about that...)

-John

0.722 (04.27.2006) - John Siracusa <siracusa@mindspring.com>

    * Really remove Clone::PP this time...

0.721 (04.27.2006) - John Siracusa <siracusa@mindspring.com>

    * Improved and documented metadata inheritance behavior.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object




------------------------------

Date: Fri, 28 Apr 2006 15:29:00 +0200
From: Asterbing <no@thanks.com>
Subject: How to display image from RAM with some text around
Message-Id: <MPG.1ebc370a2d9de606989824@news.tiscali.fr>

Hello,

I would like to display a serial of tiny images (as the one here in $img 
of 55 bytes) from RAM, without to go through any temporary disk file 
(unless if possible to create a ramdisk with some lines of Perl ;-)). 
So, I've tried this :

#!/usr/bin/perl -T
use strict;
use warnings;

my $img = pack("C*", 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x08, 0x00, 
0x08, 0x00, 0x91, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xA6, 0xCA, 0xF0, 0x2A, 
0x5F, 0xFF, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 
0x08, 0x00, 0x00, 0x02, 0x10, 0x8C, 0x7F, 0xA2, 0x3B, 0xB1, 0xEC, 0x9E, 
0x68, 0x72, 0xC6, 0x47, 0x65, 0x1B, 0xBC, 0x8F, 0x02, 0x00, 0x3B);

print "Content-type: text/html\n\n";
print "<p>This is an image :</p>";
print $img;
print "<p>That's all !</p>";
exit 0;

If I remove the "... This is an image ..." line, the image is well shown 
in browser, but the last line of text is ignored.

If I let the "... This is an image ..." line, I get the sentence, 
then the image content as text and the last line "That's all".

Maybe ideal would be to go through something like "print <img 
src="display_image_value.cgi"></img>"; with POSted image (while 
impossible to pass image data through GET in url itself), but how to 
"simulate" a POST without any form and its action ?

Am I on the wrong way(s) ? How to do ?


------------------------------

Date: Fri, 28 Apr 2006 15:14:06 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Simulating 'use vars'
Message-Id: <1146230047.619873@proxy.dienste.wien.at>

Hi,

while trying around with XS code, I also looked at vars.pm just for
curiosity to see what happens when one says "use vars qw($test);".

Shortly spoken, it's a

BEGIN {
*main::test = \$main::test;
}

But when trying this myself and later want to acces $test
(unqualified), with "use strict", it fails with the messages

'Variable "$test" is not imported at x.pl line 10.'
'Global symbol "$test" requires explicit package name at x.pl line 10.'

(where line 10 just contains "$test = 2;").

However, all works well when  a

package X;

is included immediately following the BEGIN.

Why does it work with the "package" command, but not without it?

Greetings, Ferry
--

Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at




------------------------------

Date: Sat, 29 Apr 2006 03:12:06 +1000
From: Adam Kennedy <adamk@cpan.org>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <44524d84$1_1@news.iprimus.com.au>

Dr.Ruud wrote:
> Ilya Zakharevich schreef:
>> Dr.Ruud:
> 
>>>> I would expect to get 0/75 for Left, and 0/91 for Shift-F8.
>>> Is the code below good enough for that test?
>>>
>>>    perl -MTerm::ReadKey
>>>          -le "binmode STDIN or die $!;
>>>               ReadMode 5, STDIN;
>>>               while(1) {
>>>                 $_ = getc STDIN;
>>>                 print length($_).q{:}.ord;
>>>                 last if 3==ord
>>>               }; ReadMode 0, STDIN"
>>>
>>> The lengths always come out as 1, as expected.
>> On a "correctly set up" read() from "DOS console", pressing `Left'
>> should generate two characters, 0 and 75; likewise for other special
>> keys.
> 
> perl was run from a Win2000 CMD.EXE console. I am not aware of anything
> special on this system.
> 
> 
>>>>> In the code in my previous post, the first-13-gets-eaten-bug is not
>>>>> there, as long as you leave USE_GETC at 0.
>>>>> With SET_BINMODE 1, there are no eaten or delayed 13s, even if
>>>>> USE_GETC is 1 and/or USE_CONIN is 0.
>>>> I assume this is with some pre-5.6.0 Perl, right?
>>> No, in the Win32-corner I only have a perl, v5.8.8 built for
>>> MSWin32-x86-multi-thread (AciveState) here.
>> Then I have no idea what it is you write about in the part quoted with
>> "> >>"...  And the fault of PerlIO is not yet proven...
> 
> I am retrying the USE_GETC options ... yes, confirmed what was written
> there. The source that I used:
> 
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> use constant             # Unix # Win32 #
> { USE_CONIN    => 0      #  0   #   1   #
> , USE_GETC     => 0      #  -   #   -   #
> , SET_BINMODE  => 0      #  0   #   1   #
> , SET_READMODE => 4      #  5   #  4/5  #
> };
> 
> use Term::ReadKey; # if defined SET_READMODE;
> 
> sub my_getc {
>   my $in = @_ ? shift : <STDIN>;
>   return getc $in  if USE_GETC;
>   my $buf;
>   return -1  if read($in, $buf, 1) < 1;
>   return substr($buf, 0, 1);
> }
> 
> my $fname = USE_CONIN ? 'CONIN$' : '-';
> 
> open my $con, "+< $fname"  or  die "Can't open '$fname': $!";
> 
> if (defined SET_READMODE) {
>   ReadMode SET_READMODE, $con;
> }
> 
> if (SET_BINMODE) {
>   binmode $con  or  die "Can't binmode '$fname': $!";
> }
> 
> while ( defined($_ = my_getc($con)) ) {
>   my $ord = ord;
>   print "Esc "   if $ord == 27;
>   print "|$_| "  if $ord >= 32;
>   print "<", $ord, ">\n";
>   last  if $ord == 3;
> }
> 
> if (defined SET_READMODE) {
>   ReadMode 0, $con;
> }
> 
> close $con;
> __END__
> 
> This produces a burst of three <13>s, once the third Enter is hit. So
> the <13>s get delayed, but none gets eaten.
> With USE_GETC set to 1, I need to hit Enter four times, after which a
> burst of three <13>s is displayed. So one gets eaten.

To add more data points to this, I can report the following on Win2K 
Vanilla Perl 5.8.8.

Lines (in round braces) represent my actions, other lines are as 
printed, all occur in the order listed.

C:\Documents and Settings\adam\My Documents>perl terminal.pl
(press 'b' key)
|b| <98>
(press 'enter' key)
(press 'c' key)
<13>
|c| <99>
(press 'enter' key)
(press 'enter' key)
(press 'd' key)
<13>
<13>
|d| <100>
(press 'enter key')
(press 'enter key')
(press 'enter key')
<13>
(press 'e' key)
<13>
<13>
|e| <101>
(ctrl-c to quit)
<3>

Adam K


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9209
***************************************


home help back first fref pref prev next nref lref last post