[26431] in Perl-Users-Digest
Perl-Users Digest, Issue: 8600 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 3 03:08:43 2005
Date: Thu, 3 Nov 2005 00:08:03 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 3 Nov 2005 Volume: 10 Number: 8600
Today's topics:
Re: Bug in &= (bitwise or) <nospam-abuse@ilyaz.org>
Re: dynamically adding member sub to object? <stan.remove@bremove.lz.hmrprint.com>
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: Emacs modules for Perl programming Ben Wa
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 3 Nov 2005 00:56:20 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Bug in &= (bitwise or)
Message-Id: <dkbn7k$1mir$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Tassilo v. Parseval
<tassilo.von.parseval@rwth-aachen.de>], who wrote in article <3srj9jFpot6oU1@news.dfncis.de>:
> > Moreover, IMO, it is important to support variables which are not
> > \0-terminated as wide as possible. E.g., this way one could do
> > substr() with copy-on-modify semantic.
> Is that the current state of the affairs or rather an item on the
> wishlist.
It is one of those things perl *must* have to be considered a serious
string-manipulation language. Without efficient and flexible "string
type" many operations which would be easy to do in many other
languages would take centuries in Perl (linear algorithms become
quadratic in Perl).
I do not expect that 5.9 has it (although this particular part would
be easy to implement). Please surprise me. ;-)
> >> $ perl -MDevel::Peek -e 'my $a = 'aa' & 'a'; Dump($a)'
> >> SV = PV(0x814cf20) at 0x814cc6c
> >> REFCNT = 1
> >> FLAGS = (PADBUSY,PADMY,POK,pPOK)
> >> PV = 0x815c0e8 "a"\0
> >> CUR = 1
> >> LEN = 2
> >
> > Here 'aa' & 'a' is a temporary; most probably not \0-terminated. Now
> > the assignment operator fills $a from the values in the temporary; as
> > any well-behaved Perl operator, it does not care whether there is a
> > trailing \0. So it does not know that the temporary is "buggy".
> That can't be the explanation
However, it is. ;-)
> because:
I do not see why you think your examples contradict my argument. All
of them inspect results of assignment operator. In all of them the
result is fine (as my explanation implies).
Hope this helps,
Ilya
------------------------------
Date: Wed, 2 Nov 2005 19:16:17 -0800
From: "Stan R." <stan.remove@bremove.lz.hmrprint.com>
Subject: Re: dynamically adding member sub to object?
Message-Id: <1130987953_1909@spool6-east.superfeed.net>
John Bokma wrote:
> "Eckstein C." <casabianca@suplitein.junk.de.net.org.com> wrote:
>
>> John Bokma wrote:
>>> "Eckstein C." <casabianca@suplitein.junk.de.net.org.com> wrote:
>>>
>>>> Is this possible? (Without using eval, as the scripts in this app
>>>> seem to be wrapped in a eval behind the scenes, evident when theres
>>>> an error in the code, in the error mesages. )
>>>
>>> I would inherit from "SomeClass", and use AUTOLOAD.
>>
>> I wanted to avoid that, and I wanted to loop through the "properties"
>> (hash items) and dynamically generate a method for that class on the
>> fly, but I can't find any info anywhere (perldoc, google, etc.)
>
> use strict;
> use warnings;
>
>
> package SomeClass;
>
> sub new {
>
> my $class = shift;
> my $self = {
>
> 'foo' => 42,
> 'bar' => 13,
> };
>
> bless $self, $class;
> return $self;
> }
>
>
>
> package main;
>
> {
> package SomeClass;
>
> use Carp;
>
> sub AUTOLOAD {
>
> my $self = shift;
> my $type = ref $self;
> my $autoload = our $AUTOLOAD;
> my $name;
> ( $name = $autoload ) =~ s/.*://;
>
> exists $self->{ $name }
> or croak "Can't access '$name' in class $type";
>
> @_ and return $self->{ $name } = shift;
>
> return $self->{ $name };
> }
> }
>
>
> my $sc = new SomeClass;
>
> print $sc->foo, "\n";
> $sc->foo( $sc->bar );
> print $sc->foo, "\n";
>
> HTH,
>
> (PS: I don't recommend to do this, use inheritance instead)
What aout this?
In the main package:
BEGIN { package SomeClass; sub SomeProp : lvalue {
$_[0]->{'SomeProp'}; } }
I'm sure this can be worked into a loopable version, assuming it's a
good way to do it. IT worked in my little test (I was able to call
$SomeObj->SomeProp, returning the expected value, while trying to call
it before the BEGIN would yield an error.
--
Stan
------------------------------
Date: 03 Nov 2005 05:30:53 GMT
From: <jari.aalto <AT> poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1130995808@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto A T poboxes com
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Unix Windows port (for Unix die-hards):
install http://www.cygwin.com/ which includes native Emacs 21.x.
and XEmacs port
o Pure Native Windows port
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/ => Emacs resource page
Emacs Perl Modules
Cperl -- Perl programming mode
http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
http://math.berkeley.edu/~ilya/software/emacs/
by Ilya Zakharevich
CPerl is major mode for editing perl files. Forget the default
`perl-mode' that comes with Emacs, this is much better. Comes
standard in newest Emacs.
TinyPerl -- Perl related utilities
http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Grep through all Perl manpages (.pod)
o Follow POD references e.g. [perlre] to next pod with RETURN
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o Update `$VERSION' variable with YYYY.MMDD on save.
o Load source code into Emacs, like Devel::DProf.pm
o Prepare script (version numbering) and Upload it to PAUSE
o Generate autoload STUBS (Devel::SelfStubber) for you
Perl Module (.pm)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in Tiny Tools Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up dattabases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to to do the search, You can adjust
recursive grep options, set search case sensitivity, add user grep
options etc.
You can find latest `igrep.el' module at
<http://groups.google.com/groups?group=gnu.emacs.sources> The
maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.
TinyCompile -- To Browse grep results in Emacs *compile* buffer
TinyCompile is a minor mode for *compile* buffer from where
you can collapse unwanted lines or shorten file URLs:
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: Wed, 02 Nov 2005 21:52:00 -0800
From: Ben Wa
Subject: Re: Emacs modules for Perl programming
Message-Id: <ss8jm1db0gkvdsouj7m5ndvh8eb1l6f721@4ax.com>
"I'd buy that for a dollar" - the SUX2000
Hey dude, where do I send the check?
Emacs.... Hells bells man, didn't that used to be the,
in its day Cadillac of finger contortion keyboard hard
control code, ascii, split screen, et all editor. With
macros and a 5 page help screen of ALT+A....Z, 0..9
and thats without SHIFT or CTRL. Didn't GUI and intellisense
replace that madness? Fuck man, emacs 25 years old. What
the fuck is it now?
Posted in 3 newsgroups..... fuck. It can only be used by
Unix assholes I'm sure!
On 03 Nov 2005 05:30:53 GMT, <jari.aalto <AT> poboxes.com> (Jari
Aalto+mail.perl) wrote:
>Archive-name: perl-faq/emacs-lisp-modules
>Posting-Frequency: 2 times a month
>URL: http://tiny-tools.sourceforge.net/
>Maintainer: Jari Aalto A T poboxes com
>
>Announcement: "What Emacs lisp modules can help with programming Perl"
>
> Preface
>
> Emacs is your friend if you have to do anything comcerning software
> development: It offers plug-in modules, written in Emacs lisp
> (elisp) language, that makes all your programmings wishes come
> true. Please introduce yourself to Emacs and your programming era
> will get a new light.
>
> Where to find Emacs/XEmacs
>
> o Unix:
> http://www.gnu.org/software/emacs/emacs.html
> http://www.xemacs.org/
>
> o Unix Windows port (for Unix die-hards):
> install http://www.cygwin.com/ which includes native Emacs 21.x.
> and XEmacs port
>
> o Pure Native Windows port
> http://www.gnu.org/software/emacs/windows/ntemacs.html
> ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
>
> o More Emacs resources at
> http://tiny-tools.sourceforge.net/ => Emacs resource page
>
>Emacs Perl Modules
>
> Cperl -- Perl programming mode
>
> http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
> http://math.berkeley.edu/~ilya/software/emacs/
> by Ilya Zakharevich
>
> CPerl is major mode for editing perl files. Forget the default
> `perl-mode' that comes with Emacs, this is much better. Comes
> standard in newest Emacs.
>
> TinyPerl -- Perl related utilities
>
> http://tiny-tools.sourceforge.net/
>
> If you ever wonder how to deal with Perl POD pages or how to find
> documentation from all perl manpages, this package is for you.
> Couple of keystrokes and all the documentaion is in your hands.
>
> o Instant function help: See documentation of `shift', `pop'...
> o Show Perl manual pages in *pod* buffer
> o Grep through all Perl manpages (.pod)
> o Follow POD references e.g. [perlre] to next pod with RETURN
> o Coloured pod pages with `font-lock'
> o Separate `tiperl-pod-view-mode' for jumping topics and pages
> forward and backward in *pod* buffer.
>
> o Update `$VERSION' variable with YYYY.MMDD on save.
> o Load source code into Emacs, like Devel::DProf.pm
> o Prepare script (version numbering) and Upload it to PAUSE
> o Generate autoload STUBS (Devel::SelfStubber) for you
> Perl Module (.pm)
>
> TinyIgrep -- Perl Code browsing and easy grepping
>
> [TinyIgrep is included in Tiny Tools Kit]
>
> To grep from all installed Perl modules, define database to
> TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
> how to set up dattabases for Perl5, Perl4 whatever you have
> installed
>
> TinyIgrep calls Igrep.el to to do the search, You can adjust
> recursive grep options, set search case sensitivity, add user grep
> options etc.
>
> You can find latest `igrep.el' module at
> <http://groups.google.com/groups?group=gnu.emacs.sources> The
> maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.
>
> TinyCompile -- To Browse grep results in Emacs *compile* buffer
>
> TinyCompile is a minor mode for *compile* buffer from where
> you can collapse unwanted lines or shorten file URLs:
>
> /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
> /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
>
> -->
>
> cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
> file1:NNN: MATCHED TEXT
> file1:NNN: MATCHED TEXT
>
>End
------------------------------
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 8600
***************************************