[30026] in Perl-Users-Digest
Perl-Users Digest, Issue: 1269 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 11 03:09:43 2008
Date: Mon, 11 Feb 2008 00:09:08 -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 Mon, 11 Feb 2008 Volume: 11 Number: 1269
Today's topics:
Re: Conditional match similar to IDL's where function <tadmc@seesig.invalid>
different regexp result <stoupa@practisoft.cz>
Re: different regexp result <uri@stemsystems.com>
Re: different regexp result <stoupa@practisoft.cz>
Re: different regexp result <sensorflo@gmail.com>
Re: different regexp result <jurgenex@hotmail.com>
Re: different regexp result <uri@stemsystems.com>
Re: different regexp result <uri@stemsystems.com>
Re: Fail extracting table from .mdb file using DBI modu xhoster@gmail.com
Re: Fail extracting table from .mdb file using DBI modu <lev.weissman@creo.com>
Re: Modules, global variables and such <noreply@gunnar.cc>
Re: Modules, global variables and such <tadmc@seesig.invalid>
new CPAN modules on Mon Feb 11 2008 (Randal Schwartz)
Re: PerlCtrl's IDL and enums <Bruce.Axtens@gmail.com>
pop langs website ranking <xahlee@gmail.com>
Re: Using END and the die function <noreply@gunnar.cc>
Re: Using END and the die function <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 11 Feb 2008 02:33:43 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Conditional match similar to IDL's where function
Message-Id: <slrnfqu3f5.3of.tadmc@tadmc30.sbcglobal.net>
vorticitywolfe@gmail.com <vorticitywolfe@gmail.com> wrote:
> Hello,
>
> I'm been trying to produce a result similar to IDL's where
> function...that returns the indices of where a condition is true.
>
> For example:
> @array=(2,4,7,9,10,16,20,82);
> print where(@array < 20 and @array >= 10);
>
> this should print 4,5 indicating that at index 4 and index 5 this
> condition is true.
>
> previous posts always match if something exists in a string, I want to
> mathematically check a condition
You want to use arithmetic operators rather then the pattern match operator.
>>>"What are the indices of elements that match?", you'll need something like
>>> @indices = grep $array[$_]=~/something/, 0..$#array;
>
> Do you have any ideas for me?
perldoc -f grep
says:
grep BLOCK LIST
grep EXPR,LIST
The code you quoted above uses the EXPR form.
Simple replace the pattern match EXPR with an arithmetic EXPR:
@indices = grep $array[$_] < 20 && $array[$_] >= 10, 0..$#array;
I would prefer the BLOCK form for this instead though:
@indices = grep {$array[$_] < 20 and $array[$_] >= 10} 0..$#array;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 11 Feb 2008 02:21:31 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: different regexp result
Message-Id: <foo869$1n2g$1@ns.felk.cvut.cz>
I have Perl 5.6.1 installed and I use Komodo 3.5 which internaly use Perl 5.8
( I don't know subversion). In Komodo IDE is Regexp Toolkit to test regular
expressions.
When I test this
$x = 'a b c d e f 123';
$x =~s/(\b)\s(\S)/$1$2/g;
print $x;
in Komodo Regexp Tool then I get
abcdef 123
But when I test the same in Perl 5.6.1 then I get
ab cd ef 123
I found a workaround for Perl 5.6.1
1 while($x =~s/(\b)\s(\S)/$1$2/g);
but ... :-) Please can anybody explain me what is wrong?
P.S. Please, don't tell me "Upgrade to perl 5.8/5.10" - I can't.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from
another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>
------------------------------
Date: Mon, 11 Feb 2008 01:56:59 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: different regexp result
Message-Id: <x7ve4wb6hi.fsf@mail.sysarch.com>
>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
PV> I have Perl 5.6.1 installed and I use Komodo 3.5 which internaly use
PV> Perl 5.8 ( I don't know subversion). In Komodo IDE is Regexp Toolkit
PV> to test regular expressions.
PV> When I test this
PV> $x = 'a b c d e f 123';
PV> $x =~s/(\b)\s(\S)/$1$2/g;
that (\b) makes no sense as a word boundary is a zero width assertion
and grabbing that will either be a null string or possibly undef. also
you have the boundary at the beginning where it is always true as the
first char of data is on a word boundary to its left.
PV> in Komodo Regexp Tool then I get
PV> abcdef 123
and if you explain your goal in english and not just with an example of
output you will get better answers. there are several ways to get this
sort of result.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Mon, 11 Feb 2008 07:06:45 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: different regexp result
Message-Id: <fooom1$1u16$1@ns.felk.cvut.cz>
Uri Guttman wrote:
>>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
>
>> I have Perl 5.6.1 installed and I use Komodo 3.5 which internaly use
>> Perl 5.8 ( I don't know subversion). In Komodo IDE is Regexp Toolkit
>> to test regular expressions.
>
>> abcdef 123
>
> and if you explain your goal in english and not just with an example
> of output you will get better answers. there are several ways to get
> this sort of result.
>
OK, I try to explain my goal using my poor english ;-)
I have string (e.g. street name, human name etc.) and some stupid people are
used to put space after aech single character to accentuate this words. I want
to store these string to database but I can tidy-up unnecessary spaces. From:
a b c d e f 123
I deend to get
abcdef 123
In original string where no space should be there is 1 space and where 1 space
should be there are 2 or more spaces.
What is the right regexp to do it in 1 step?
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>
------------------------------
Date: Sun, 10 Feb 2008 23:15:07 -0800 (PST)
From: Florian Kaufmann <sensorflo@gmail.com>
Subject: Re: different regexp result
Message-Id: <e4185f6b-20cf-411c-8c33-001127b88b82@i29g2000prf.googlegroups.com>
> used to put space after aech single character to accentuate this words. I want
> to store these string to database but I can tidy-up unnecessary spaces. From:
I can think of two alternatives, both of which are untested
$x = ($x =~ tr/ \t/ /s); # alternative 1
$x = ($x =~ s/\s+/ /g); # alternative 2
Greetings
Flo
------------------------------
Date: Mon, 11 Feb 2008 07:18:43 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: different regexp result
Message-Id: <citvq3p9f4h252v65p2bra77tqp5m420fe@4ax.com>
"Petr Vileta" <stoupa@practisoft.cz> wrote:
>I have string (e.g. street name, human name etc.) and some stupid people are
>used to put space after aech single character to accentuate this words. I want
>to store these string to database but I can tidy-up unnecessary spaces. From:
>
>a b c d e f 123
>
>I deend to get
>
>abcdef 123
>
>In original string where no space should be there is 1 space and where 1 space
>should be there are 2 or more spaces.
One way: substitute a space followed by whatever character with that
whatever character:
s/ (.)/$1/g;
I am sure other people can come up with smart look-ahead or look-behind
assertions.
jue
------------------------------
Date: Mon, 11 Feb 2008 07:42:08 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: different regexp result
Message-Id: <x7zlu87xdc.fsf@mail.sysarch.com>
>>>>> "FK" == Florian Kaufmann <sensorflo@gmail.com> writes:
>> used to put space after aech single character to accentuate this words. I want
>> to store these string to database but I can tidy-up unnecessary spaces. From:
FK> I can think of two alternatives, both of which are untested
FK> $x = ($x =~ tr/ \t/ /s); # alternative 1
that squeezes multiple space/tabs to single spaces. he wants to delete
single spaces and only squeeze multiples to 1 space
FK> $x = ($x =~ s/\s+/ /g); # alternative 2
that does the same as your previous answer but slower
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Mon, 11 Feb 2008 07:50:28 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: different regexp result
Message-Id: <x7ve4w7wzf.fsf@mail.sysarch.com>
>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
PV> In original string where no space should be there is 1 space and where
PV> 1 space should be there are 2 or more spaces.
PV> What is the right regexp to do it in 1 step?
that is much clearer and it is doable with a regex but not the way you
are going. the problem is that you want the replacement to be a null
string (remove it) if there is exactly one space or a single space if
more than one. so you need a way to control the replacement string and a
plain s/// isn't enough. using the /e option allows for a simple
solution (untested but it should work fine):
s/(\s+)/length $1 == 1 ? '' : ' '/ge ;
i would even use the /x modifier to explain it:
s{
(\s+) # grab 1 or more space chars
}
{
length $1 == 1 ? # see if the number of spaces is exactly one
'' : # yes, replace it with the null string
' ' # no, more than 1 space, replace with 1 space
}gex ; # global, execute, extended options
note that it does exactly what you said in english (however poor it was,
you conveyed the problem clearly). this is a good way to help solve many
problems. always try to explain it in very simple natural language. too
often solutions are way too complex because the problem was never
clearly described.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: 11 Feb 2008 01:08:02 GMT
From: xhoster@gmail.com
Subject: Re: Fail extracting table from .mdb file using DBI module
Message-Id: <20080210200805.315$Hg@newsreader.com>
MoshiachNow <lev.weissman@creo.com> wrote:
> HI,
>
> The following sub extracts data nicely from all tables,just one table
> comes up empty.
With or without warnings/errors/messages?
> Will appreciate ideas on possible issues in the code.
> thanks
> =======================
> sub exportMDB {
> my $database = shift;
> my $driver = "Microsoft Access Driver (*.mdb)";
> print "$database\n";
> print "---------------------------------\n\n";
> my $dsn = "dbi:ODBC:driver=$driver;dbq=$database";
> my $dbh = DBI->connect("$dsn") or warn "Couldn't open database:
> $DBI::errstr; stopped";
If you say "stopped", you should probably actually stop. Using die
instead of warn would accomplish that. Or just setting RaiseError.
>
> my $sth = $dbh->table_info( "", "", "", "TABLE" );
>
> while ( my ($catalog, $schema, $table, $type) = $sth-
> >fetchrow_array() ) {
> if ($table) {
> print "\n$table :\n";
> print "--------\n";
> my $sql = "select * from $table";
>
> # Prepare the SQL query for execution
> my $sth = $dbh->prepare($sql) or warn "Couldn't prepare
> statement:$DBI::errstr; stopped";
>
> # Execute the query
> $sth->execute() or warn "Couldn't execute statement:
> $DBI::errstr; stopped";
>
> # Fetch each row and print it
> while ( my (@row) = $sth->fetchrow_array() ) {
> print "$_\t" foreach (@row);
> print "\n";
> }
You don't check fetchrow_array for errors after it returns the empty
list.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Sun, 10 Feb 2008 22:22:28 -0800 (PST)
From: MoshiachNow <lev.weissman@creo.com>
Subject: Re: Fail extracting table from .mdb file using DBI module
Message-Id: <3026c360-d997-4d89-8e88-bebd3d1102ff@v46g2000hsv.googlegroups.com>
Thanks to Uri for valuable code comments.However,this code I have just
cut&pasted from web ...
Xho - I do not get any errors from the code.
Still I have one table empty ,and no ideas how to continue.
thanks
------------------------------
Date: Sun, 10 Feb 2008 23:49:09 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Modules, global variables and such
Message-Id: <619dbbF1thhq3U1@mid.individual.net>
Ben Morrow wrote:
> Quoth Gunnar Hjalmarsson <noreply@gunnar.cc>:
>> Andreas Pürzer wrote:
>>
>>> whereas with 'our':
>>>
>>> $ perl -Mstrict -Mwarnings -le'
>>> package MyModule;
>>> our $DEBUG = 1;
>>> package Fnurd;
>>> print "Debug on" if $MyModule::DEBUG;
>>> '
>>> Debug on
>>>
>>> But then I don't even have to use the fully qualified name:
>>>
>>> $ perl -Mstrict -Mwarnings -le'
>>> package MyModule;
>>> our $DEBUG = 1;
>>> package Fnurd;
>>> print "Debug on" if $DEBUG;
>>> '
>>> Debug on
>> You do have to use the fully qualified name if you call the variable
>> from somewhere outside the MyModule package.
>
> No, not if you use 'our'. An often-overlooked property of 'our' is that
> it creates a lexical alias to the package variable: in simple terms, you
> can use that variable unqualified for the rest of the lexical scope,
> even if you change package.
Well, yes, but note that this thread was initially about calling the
$DEBUG variable from other modules, which typically are both different
packages and different lexical scopes. So Andreas' statement, that the
fully qualified name isn't necessary, isn't normally applicable to the
situation that was initially discussed.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 11 Feb 2008 02:33:43 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Modules, global variables and such
Message-Id: <slrnfqu2hp.3of.tadmc@tadmc30.sbcglobal.net>
Andreas Pürzer <pue@gmx.net> wrote:
> Abigail schrieb:
>>
>> You seem to have the impression that if you're using a variable
>> $MyModule::DEBUG, you have to have a MyModule.pm, and you have
>> to 'use' that file.
>>
>> That's not true.
>>
>>
>> package Fnurd;
>>
>> use strict;
>> use warnings;
>>
>> say "Hi, I'm a debugging message." if $MyModule::DEBUG;
>>
>>
>> works well.
>>
>>
>> Abigail
>
> For curious lurkers like me, soaking up wisdom from c.l.p.m, I think it
> should be mentioned that $MyModule::DEBUG needs to be declared via 'our'
> for this to work, because:
No it doesn't.
> $ perl -Mstrict -Mwarnings -le'
> package MyModule;
> my $DEBUG = 1;
Change that last line above to:
$MyModule::DEBUG = 1;
and it will work fine.
For package variables, strict vars requires EITHER a declaration (if
you want to use the short version of the name (ie. unqualified))
OR a fully-qualified name.
Note that your version uses a "lexical variable". My mod uses
a "package variable".
> package Fnurd;
> print "Debug on" if $MyModule::DEBUG;
> '
> Name "MyModule::DEBUG" used only once: possible typo at -e line 5.
>
> whereas with 'our':
>
> $ perl -Mstrict -Mwarnings -le'
> package MyModule;
> our $DEBUG = 1;
> package Fnurd;
> print "Debug on" if $MyModule::DEBUG;
> '
> Debug on
Now your code is using a package variable too.
> But then I don't even have to use the fully qualified name:
>
> $ perl -Mstrict -Mwarnings -le'
> package MyModule;
> our $DEBUG = 1;
> package Fnurd;
> print "Debug on" if $DEBUG;
> '
> Debug on
That is because our() is lexically scoped (like it says in perldoc -f our).
In your program above, the our() is scoped to the entire file, so
it is in effect down in the Fnurd package.
> Toying a little more, I find that
>
> $ perl -Mstrict -Mwarnings -le'
> package MyModule;
> my $DEBUG = 1;
> package Fnurd;
> print "Debug on" if $DEBUG;
> '
> Debug on
>
> works equally well.
It would not work if the two packages were in different files,
because lexical variables can NEVER cross file boundaries.
> What am I not understanding?
Most of it seems to the the difference between lexical variables (my)
and package variables (our or fully-qualified). See
perldoc -q "dynamic and lexical"
and
"Coping with Scoping":
http://perl.plover.com/FAQs/Namespaces.html
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 11 Feb 2008 05:42:16 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Feb 11 2008
Message-Id: <Jw27uG.16wB@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Algorithm
http://search.cpan.org/~kenwu/Algorithm/
----
Algorithm-LBFGS-0.13
http://search.cpan.org/~laye/Algorithm-LBFGS-0.13/
Perl extension for L-BFGS
----
Algorithm-Line-Bresenham-C
http://search.cpan.org/~kenwu/Algorithm-Line-Bresenham-C/
it is a C version Algorithm::Line::Bresenham to speed up a bit.
----
Apache2-DirBasedHandler-0.02
http://search.cpan.org/~aprime/Apache2-DirBasedHandler-0.02/
Directory based Location Handler helper
----
Apache2-DirBasedHandler-TT-0.01
http://search.cpan.org/~aprime/Apache2-DirBasedHandler-TT-0.01/
TT hooked into DirBasedHandler
----
CPAN-Reporter-1.0801
http://search.cpan.org/~dagolden/CPAN-Reporter-1.0801/
Adds CPAN Testers reporting to CPAN.pm
----
CPANPLUS-Dist-Mdv-0.3.5
http://search.cpan.org/~jquelin/CPANPLUS-Dist-Mdv-0.3.5/
a cpanplus backend to build mandriva rpms
----
Class-Inspector-1.19_01
http://search.cpan.org/~adamk/Class-Inspector-1.19_01/
Get information about a class and its structure
----
Config-Inetd-0.29
http://search.cpan.org/~schubiger/Config-Inetd-0.29/
Interface inetd's configuration file
----
Cvs-Trigger-0.02
http://search.cpan.org/~mschilli/Cvs-Trigger-0.02/
Argument parsers for CVS triggers
----
DBD-Pg-2.0.0
http://search.cpan.org/~turnstep/DBD-Pg-2.0.0/
PostgreSQL database driver for the DBI module
----
Data-Pageset-1.04
http://search.cpan.org/~llap/Data-Pageset-1.04/
Page numbering and page sets
----
Data-Presenter-1.03
http://search.cpan.org/~jkeenan/Data-Presenter-1.03/
Reformat database reports
----
Email-Fingerprint-0.18
http://search.cpan.org/~budney/Email-Fingerprint-0.18/
Calculate a digest for recognizing duplicate emails
----
Geo-Query-LatLong-0.8011
http://search.cpan.org/~retoh/Geo-Query-LatLong-0.8011/
Uniform interface to query latitude and longitude from a city.
----
KSx-Analysis-StripAccents-0.03
http://search.cpan.org/~sprout/KSx-Analysis-StripAccents-0.03/
Remove accents and fold to lowercase
----
Math-Business-Stochastic-0.03
http://search.cpan.org/~yukinobu/Math-Business-Stochastic-0.03/
Perl extension for calculate stochastic oscillator
----
Math-Complex-1.51
http://search.cpan.org/~jhi/Math-Complex-1.51/
complex numbers and associated mathematical functions
----
NetSuite-1.00
http://search.cpan.org/~jlloyd/NetSuite-1.00/
A perl-based interface to the NetSuite SuiteTalk (Web Services) API
----
PDF-API2-Simple-1.1.4
http://search.cpan.org/~redtree/PDF-API2-Simple-1.1.4/
Simplistic wrapper for the excellent PDF::API2 modules
----
PDF-ReportWriter-1.5
http://search.cpan.org/~dkasak/PDF-ReportWriter-1.5/
----
POE-Component-IRC-Plugin-YouAreDoingItWrong-0.01
http://search.cpan.org/~zoffix/POE-Component-IRC-Plugin-YouAreDoingItWrong-0.01/
show people what they are doing wrong by giving links to http://doingitwrong.com images.
----
POE-Component-WWW-Google-Calculator-0.02
http://search.cpan.org/~zoffix/POE-Component-WWW-Google-Calculator-0.02/
A non-blocking POE wrapper around WWW::Google::Calculator
----
POE-Component-WWW-Google-PageRank-0.03
http://search.cpan.org/~zoffix/POE-Component-WWW-Google-PageRank-0.03/
A non-blocking wrapper for WWW::Google::PageRank
----
POE-Component-WWW-Search-Mininova-0.04
http://search.cpan.org/~zoffix/POE-Component-WWW-Search-Mininova-0.04/
non-blocking POE wrapper for WWW::Search::Mininova
----
Params-Validate-Checks-0.01
http://search.cpan.org/~smylers/Params-Validate-Checks-0.01/
Named checks for use with Params::Validate
----
Params-Validate-Checks-Net-0.01
http://search.cpan.org/~smylers/Params-Validate-Checks-Net-0.01/
Params::Validate checks for functions taking network-related arguments
----
Parley-0.58
http://search.cpan.org/~chisel/Parley-0.58/
Message board / forum application
----
Perl6-Doc-0.35_1
http://search.cpan.org/~lichtkind/Perl6-Doc-0.35_1/
all useful Perl 6 Docs in your command line
----
Perl6-Say-0.12
http://search.cpan.org/~jkeenan/Perl6-Say-0.12/
print -- but no newline needed
----
Rose-DBx-Object-Loader-FormMaker-0.02
http://search.cpan.org/~aprime/Rose-DBx-Object-Loader-FormMaker-0.02/
Automatically create RHTMLO Forms with the RDBO Loader
----
SOAP-WSDL-2.00_31
http://search.cpan.org/~mkutter/SOAP-WSDL-2.00_31/
SOAP with WSDL support
----
Test-Harness-3.09
http://search.cpan.org/~andya/Test-Harness-3.09/
Run Perl standard test scripts with statistics
----
URI-Template-0.12
http://search.cpan.org/~bricas/URI-Template-0.12/
Object for handling URI templates
----
WWW-Search-Mininova-0.05
http://search.cpan.org/~zoffix/WWW-Search-Mininova-0.05/
Interface to www.mininova.org Torrent site
----
Win32-GUITaskAutomate-0.05
http://search.cpan.org/~zoffix/Win32-GUITaskAutomate-0.05/
A module for automating GUI tasks.
----
cpan_bot-0.04
http://search.cpan.org/~zoffix/cpan_bot-0.04/
an IRC CPAN Info bot
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sun, 10 Feb 2008 23:43:45 -0800 (PST)
From: axtens <Bruce.Axtens@gmail.com>
Subject: Re: PerlCtrl's IDL and enums
Message-Id: <b9f99053-0a6e-41e7-af46-8e6aae4b97f6@l32g2000hse.googlegroups.com>
On Feb 11, 4:07 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quothaxtens<Bruce.Axt...@gmail.com>:
>
>
>
> > Is there a way to specify enums in the IDL for a PerlCtrl?
>
> You seem to be asking a lot of questions about ActiveState's PDK. While
> this is a reasonable place to ask, I don't get the impression there are
> a lot of people here who can help you. You may have more luck looking
> for some ActiveState-specific list, or (if you are entitled) asking
> ActiveState support directly.
>
> Ben
Fair comment. Thanks.
Kind regards,
Bruce.
------------------------------
Date: Sun, 10 Feb 2008 16:27:34 -0800 (PST)
From: "xahlee@gmail.com" <xahlee@gmail.com>
Subject: pop langs website ranking
Message-Id: <7153ec1f-8865-46b5-bcff-829c51ce0d68@s19g2000prg.googlegroups.com>
while doing my website's traffic report, i did some research on major
computer lang or tech website ranking. Here's the result ranked by
alexa.com (some non-lang tech sites are given just for comparison):
Php.net 550 (largely due to online doc and forum)
sun.com 900 (java doc and forum)
java.com 1122
slashdot.com 1223 (forum)
Mysql.com 1296 (online doc, forum)
gnu.org 7328 (massive docs, mailing list archives)
wolfram.com 9065 (online doc, mathworld etc)
Python.org 9410 (python doc and prob forums)
Perl.org 26067 (perl doc, forum)
paulgraham.com 48153 (lisp bigwig, but huh?)
Perl.com 49104
xahlee.org 80060 =E2=86=90 Me!
haskell.org 118703
novig.com 130568 (lisp bigwig)
franz.com 292598
lispworks.com 377906 (common lisp doc)
Gigamonkeys.com 529551 (pop common lisp book)
schemers.org 880284
The list is not that surprising.
Many top ones are due to the popularity of the lang, but also because
their site hosts the lang's documentation and discussion forum (or
wiki,blogs). Hosting a web forum are likely to increase traffic some
10 or 100 fold.
Questions:
=E2=80=A2 paulgraham.com is unusually high. What's up with that?
=E2=80=A2 python.org at 9k seems also unusally high, compare that perl.org
with online doc and forum is only 26k. Python.org has mailing list
archives... maybe blogs too but am not sure it has forums... still the
gab seems surprising. Even perl is not much talked about these days,
but i'm guessing its market share is at least still 10 or 100 times of
python...
If any one so wishes, add entries to the above list.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
=E2=98=84
------------------------------
Date: Mon, 11 Feb 2008 00:10:06 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Using END and the die function
Message-Id: <619eijF1ug5bpU1@mid.individual.net>
Graham Drabble wrote:
> On 08 Feb 2008 Tad J McClellan <tadmc@seesig.invalid> wrote in
> news:slrnfqpr0o.96t.tadmc@tadmc30.sbcglobal.net:
>>
>> mkdir($tgt_dir) or warn "Mkdir ($tgt_dir) command failed.\n"
>> and exit 42;
>>
>> Reads like English:
>>
>> make the directory or warn and exit
>
> Can warn() ever return false?
Not AFAIK.
> If it did then your code above wouldn't exit.
To be safe, this is a possibility:
mkdir($tgt_dir) or
do { warn "Mkdir ($tgt_dir) command failed.\n"; exit 42 };
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 11 Feb 2008 01:49:26 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Using END and the die function
Message-Id: <66m485-cr1.ln1@osiris.mauzo.dyndns.org>
Quoth Gunnar Hjalmarsson <noreply@gunnar.cc>:
> Graham Drabble wrote:
> > On 08 Feb 2008 Tad J McClellan <tadmc@seesig.invalid> wrote in
> > news:slrnfqpr0o.96t.tadmc@tadmc30.sbcglobal.net:
> >>
> >> mkdir($tgt_dir) or warn "Mkdir ($tgt_dir) command failed.\n"
> >> and exit 42;
> >
> > Can warn() ever return false?
>
> Not AFAIK.
Make that 'no' :). The warn op unconditionally returns true. It may die,
but in that case the exit doesn't get called anyway.
Ben
------------------------------
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 V11 Issue 1269
***************************************