[25951] in Perl-Users-Digest
Perl-Users Digest, Issue: 8170 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 13 18:05:31 2005
Date: Mon, 13 Jun 2005 15:05:05 -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 Mon, 13 Jun 2005 Volume: 10 Number: 8170
Today's topics:
Re: (Ilya?) cperl-mode.el and strings like ||""$foo""|| <rh62121@yahoo.com>
ANNOUNCE: Data::PABX::ParseLex V 1.00 <ron@savage.net.au>
ANNOUNCE: DBIx::Admin::BackupRestore V 1.06 <ron@savage.net.au>
ANNOUNCE: Image::Magick::Chart V 1.01 <ron@savage.net.au>
Re: chown recursively <zawrotny@jaguar.sb.fsu.edu>
Re: Glob Q <john@castleamber.com>
Re: Glob Q <skuo@psi.nsc.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 13 Jun 2005 22:20:58 +0200
From: "Radomir Hejl" <rh62121@yahoo.com>
Subject: Re: (Ilya?) cperl-mode.el and strings like ||""$foo""|| *within a string*?
Message-Id: <d8kpra$4or$1@ns.felk.cvut.cz>
>>Type C-h v cperl-mode, at least for my GNU emacs 21.3.1 on windows.
>>Or through menu Perl/Micro-docs/CPerl version.
>>
>>Radek H.
>>
>>
>
> Thanks!
>
>
>
> I do that, and get these 4 possible completions (to cperl-mode-)
> cperl-mode-{abbrev-table,map,hook,syntax-table} --
> nothing for just plain cperl-mode.
>
> For those four, C-h v finds nothing like a version-number -- just
> that I can customize it, etc.
>
> David
>
Sorry for misleading, it should've read C-h v cperl-version.
Radek H.
------------------------------
Date: Sun, 12 Jun 2005 10:35:23 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: Data::PABX::ParseLex V 1.00
Message-Id: <II1CqH.5yL@zorch.sf-bay.org>
The pure Perl module Data::PABX::ParseLex V 1.00
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
An extract from the docs:
1.00 Sun Jun 12 20:37:29 2005
This module reads the output file from the 'lex a e' (List Extensions, All
Extensions) command given to a PABX of type iSDC.
Method parse(file name) returns a hash ref keyed by extension.
Each of these keys points to another hash ref with keys as per the docs.
------------------------------
Date: Sun, 12 Jun 2005 05:03:25 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: DBIx::Admin::BackupRestore V 1.06
Message-Id: <II1Cqp.22zt@zorch.sf-bay.org>
The pure Perl module DBIx::Admin::BackupRestore V 1.06
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
An extract from the docs:
1.06 Fri May 20 15:45:00 2005
- Correct docs discussing the value 2 for the fiddle_timestamp option, which
said timestamp and should have said datetime.
- Add an FAQ to the docs
- Add method restore_in_order(), which lets you specify the order in which
tables are restored. This allows you to define a column with a clause such as
'references foreign_table (foreign_column)', and to populate the foreign_table
before the dependent table.
But mutually-dependent and self-referential tables are still not catered for.
- Add method split(), which reads an XML file output by backup() and splits out
into a separate file each table you are not skipping. The file names are the
tables' names, including schema if any, and with an extension of 'xml'. The
output files have headers and footers so they are identical in structure to
the file output by backup(). Hence they can be fed back in to restore() and
restore_in_order().
This method helps circumvent the drawback of restore_in_order(), which reads
its input file once per table.
Since this is a file-to-file operation, the dbh parameter to new() is no
longer mandatory.
See examples/split-xml.pl and all-tables.xml for a demo.
- Change methods backup(), restore() and the new restore_in_order() and
split(), to use lower case XML tags 'dbi', 'resultset', and 'row', as they
should have been in the first place.
- Methods restore() and split() will read a file containing upper or lower case
tags.
- Warning: restore_in_order() only handles lower case tags, due to the way
XML::Records works.
- This module now requires these modules, installed in this order:
o XML::Parser
o XML::TokeParser
o XML::Records
------------------------------
Date: Mon, 13 Jun 2005 02:36:04 GMT
From: Ron Savage <ron@savage.net.au>
Subject: ANNOUNCE: Image::Magick::Chart V 1.01
Message-Id: <II1Cpx.22uH@zorch.sf-bay.org>
The pure Perl module Image::Magick::Chart V 1.01
is available immediately from CPAN,
and from http://savage.net.au/Perl-modules.html.
On-line docs, and a *.ppd for ActivePerl are also
available from the latter site.
An extract from the docs:
1.01 Mon Jun 13 12:19:00 2005
- No code changes
- Various documentation fixes and clarifications
------------------------------
Date: 13 Jun 2005 16:40:54 GMT
From: Michael Zawrotny <zawrotny@jaguar.sb.fsu.edu>
Subject: Re: chown recursively
Message-Id: <slrndardov.7r3.zawrotny@localhost.localdomain>
Tim O'Donovan <timodonovan@localhost.com> wrote:
Abigail <abigail@abigail.nl> wrote:
> > Well, if the directory is large, I bet shelling out the chown is *faster*
> > than doing it in Perl. The system call doesn't handle the -R functionality,
> > and I bet the C-implementation of traversing a directory tree in chown is
> > faster than most, if not every, Perl solution using File::Find.
[ snip ]
>
> Thanks for the alternative angle, excellent stuff. I'm considering using
> the original system() function now because of what you said about speed.
Don't worry about the speed. I used the following setup on my
workstation (3 GHz P4 running Ubuntu linux):
directory with 10 sub-directories
each with 10 sub-sub-directories (100 at this level)
each with 10 sub-sub-sub-directories (1000 at this level)
each with 10 files (10000 at this level)
chown -R took about 0.05 seconds, calling Perl's builtin chown on each
file/directory took 0.13 seconds, and building a large list of
files/directories and feeding that to one call to Perl's chown took
0.15 seconds.
The thrown-together-in-a-few-minutes perl with path, uids, and gids
hard coded is:
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
my @list;
sub wanted1 {
chown(1000, 1588, $_);
}
sub wanted2 {
push @list, $File::Find::name;
}
# dirs is the name of the directory to recursively chown
if ( $ARGV[0] == 1 ) {
find(\&wanted1, 'dirs');
} elsif ( $ARGV[0] == 2 ) {
find(\&wanted2, 'dirs');
chown(1000, 1588, @list);
}
__END__
Mike
--
Michael Zawrotny
Institute of Molecular Biophysics
Florida State University | email: zawrotny@sb.fsu.edu
Tallahassee, FL 32306-4380 | phone: (850) 644-0069
------------------------------
Date: 13 Jun 2005 18:18:38 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Glob Q
Message-Id: <Xns96748762169E3castleamber@130.133.1.4>
Shawn Corey wrote:
> John Bokma wrote:
>> J Krugman wrote:
>>
>>
>>>Why is it that I find globs so mysterious? Am I alone in this?
>>>Or is it a common thing?
>>>
>>>Anyway, my question is this: what's the difference between $x, $y,
>>>and $z in
>>>
>>>my $x = *VAR;
>>>my $y = local *VAR;
>>>my $z = do { local *VAR };
>>
>>
>> Don't use wrong tech lingo. I wouldn't call any of those a glob.
>>
>
> What he is talking about are type globs, to be confused with file globs.
> File globs are used with the function glob().
Ouch, yeah, I read file globs :-D. Apologies to the OP.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Mon, 13 Jun 2005 12:18:00 -0700
From: Steven Kuo <skuo@psi.nsc.com>
Subject: Re: Glob Q
Message-Id: <Pine.LNX.4.60.0506131214320.17211@psi.nsc.com>
On Sun, 12 Jun 2005, J Krugman wrote:
> Why is it that I find globs so mysterious? Am I alone in this?
> Or is it a common thing?
>
> Anyway, my question is this: what's the difference between $x, $y,
> and $z in
>
> my $x = *VAR;
> my $y = local *VAR;
> my $z = do { local *VAR };
>
> Thanks!
>
> jill
Imagine replacing that typeglob with corresponding package-scoped
variables. Your declaring a local scope to the typeglob is virtually
the same as localizing package-scoped variables (or redefining a
function).
Tyepglobs allow you to reference entries in the symbol table; the
lexical variables in your example become references to scoped package
variables. It's really nothing more than that.
Compare:
#!/usr/bin/perl
use strict;
use warnings;
use vars qw(*VAR);
my $x = *VAR;
$$x = "bar";
@$x = ( "FOOBAR\n");
my $z = do { local *VAR };
@$z = ("HELLO", "WORLD");
{
my $y = local *VAR;
$$y = "foo";
print $VAR;
}
print $VAR, "\n";
print @VAR;
print "@$z\n";
########################################################################
#!/usr/bin/perl
use strict;
use warnings;
use vars qw(@VAR $VAR);
my $x = \$VAR;
my $x2 = \@VAR;
$$x = "bar";
@$x2 = ( "FOOBAR\n");
my $z = do { local @VAR; \@VAR };
@$z = ("HELLO", "WORLD");
{
local $VAR;
my $y = \$VAR;
$$y = "foo";
print $VAR;
}
print $VAR, "\n";
print @VAR;
print "@$z\n";
--
Hope this helps,
Steven
------------------------------
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 8170
***************************************