[31036] in Perl-Users-Digest
Perl-Users Digest, Issue: 2281 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 18 03:10:21 2009
Date: Wed, 18 Mar 2009 00:09:08 -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 Wed, 18 Mar 2009 Volume: 11 Number: 2281
Today's topics:
Re: capturing multiple statement, which starts with "ms <guru.naveen@gmail.com>
Re: FAQ 5.16 Why do I sometimes get an "Argument list t <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Most efficient way to do set-comparison sln@netherlands.com
new CPAN modules on Wed Mar 18 2009 (Randal Schwartz)
Perl Packager - Free to wrong pool error google@markginsburg.com
Re: Perl Packager - Free to wrong pool error <ben@morrow.me.uk>
Re: Perl Packager - Free to wrong pool error sln@netherlands.com
Re: perl/postscript csv->labels HERE-PROGRAM <nospam-abuse@ilyaz.org>
Re: perl/postscript csv->labels HERE-PROGRAM <someone@example.com>
Re: perl/postscript csv->labels HERE-PROGRAM <hjp-usenet2@hjp.at>
Re: perl/postscript csv->labels HERE-PROGRAM <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Mar 2009 21:07:21 -0700 (PDT)
From: guru <guru.naveen@gmail.com>
Subject: Re: capturing multiple statement, which starts with "msg_pri"
Message-Id: <8ff95534-0267-499e-b6f5-726ffcc9dc73@p11g2000yqe.googlegroups.com>
On Mar 13, 10:17=A0am, "John W. Krahn" <some...@example.com> wrote:
> guru wrote:
>
> > I have one requirement where I need to capture statement beginning
> > with "msg_pri". This may span multiple lines.
>
> > Cases
> > 1. msg_pri (........................);
> > 2. msg_pri (........................)
> > 3. msg_pri (........................) \
>
> > other cases
> > same as above , but they may span multiple lines.
>
> > 4. msg_pri (........................,
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0..............);
>
> > Below perl script convert multiple line msg_pri in to single line and
> > handling case 1 and case 2, 4.
>
> > It is not handling the case 3. It will hang when it encounters case 3.
>
> > system("perl -i -ne =A0\' unless(<EOF>){ if(/msg_pri.?\\(/i) { until(/[=
\;
>
> Why system? =A0Are you running this in perl as a separate process, and if
> so why? =A0Where did the EOF filehandle come from? =A0It is not doing
> anything in your example.
>
> > \)]\$/) { chomp; s/\\s+/ /; print; \$_ =3D <>;} s/\\s+/ /;} print }\'
> > $process_file");
>
> Converting that to usable Perl code:
>
> local ( $^I, @ARGV ) =3D ( '', $process_file );
> while ( <> ) {
> =A0 =A0 =A0unless ( <EOF> ) {
> =A0 =A0 =A0 =A0 =A0if ( /msg_pri.?\(/i ) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0until ( /[;)]$/ ) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0chomp;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0s/\s+/ /;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0print;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0$_ =3D <>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0 =A0 =A0s/\s+/ /;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0 =A0 =A0print
> =A0 =A0 =A0 =A0 =A0}
> =A0 =A0 =A0}
>
> > I modified "until(/[\;\)]\$/" to "until(/[\\\;\)]\$" in the above
> > statement then also it is not handling.
>
> > How to modify this to handle all the above cases or any other way to
> > do this in perl.
>
> > Please let me know if you need any other info.
>
> What determines "a single line"? =A0What do you want the output to look l=
ike?
>
> John
> --
> Those people who think they know everything are a great
> annoyance to those of us who do. =A0 =A0 =A0 =A0-- Isaac Asimov- Hide quo=
ted text -
>
> - Show quoted text -
until(/[\;\)]\$/)
in the unitl , pattern matching [\;\)]\$ will determined whether line
ending with ; or ). if it ends and spans multiple line then it will
convert it to single line.
msg_pri (........................,
..............);
to
msg_prin (............................);
this pattern matching fails if it line ends with \
3. msg_pri (........................, \
....................) \
Regards
Gururaja
------------------------------
Date: Tue, 17 Mar 2009 20:03:48 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: FAQ 5.16 Why do I sometimes get an "Argument list too long" when I use <*>?
Message-Id: <lt4696x4i3.ln2@goaway.wombat.san-francisco.ca.us>
This is a very minor nitpick, but I thought I'd at least make the
observation:
On 2009-03-18, PerlFAQ Server <brian@stonehenge.com> wrote:
> --------------------------------------------------------------------
>
> 5.16: Why do I sometimes get an "Argument list too long" when I use <*>?
>
> The "<>" operator performs a globbing operation (see above).
Of course there is no above, since this is excerpted from the perlfaq.
Perhaps it might be better to have it read (see 5.xx) instead? No,
wait, it can't, because the perlfaq5 document itself doesn't have those
identifiers. Perhaps (see "How can I translate tildes (~) in a
filename?"), but that's clunky.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: Wed, 18 Mar 2009 00:30:40 GMT
From: sln@netherlands.com
Subject: Re: Most efficient way to do set-comparison
Message-Id: <rpe0s457u4nnqku9mlrtjkvj1qh4i82ggt@4ax.com>
On Tue, 17 Mar 2009 04:09:40 -0700 (PDT), Krishna Chaitanya <schaitan@gmail.com> wrote:
>> So as a general rule, you want to set up methods both public and private, that change state,
>> during runtime.
>
>The mention of private methods is interesting...esp. in Perl. Since
>there are no C++-like keywords (private, et al), it's a lot more work
>to ensure privacy in Perl for OO? Like using file-level scoping,
>closures, etc? Would love to know how this is done as an example, so
>that I make up my own ways of designing classes in future. Any good
>CPAN modules you know that have private method implementation?
>
There probably is. Perl is not really OO though. You can get private subs
via anonymous subs, but most don't need to do it. Users usually don't muck with
unadvertised methods and it won't do what you think anyway.
You can distinguish the private ones with an underscore _func {}, but it is not private.
Read up in the perlmod.pod for basic info on OO stuff "Guidelines for Module Creation":
"Generally anything not exported is still accessible from outside the module using the
ModuleName::item_name (or $blessed_ref->method) syntax. By convention you can use a leading
underscore on names to indicate informally that they are 'internal' and not for public use.
(It is actually possible to get private functions by saying: my $subref = sub { ... }; &$subref;.
But there's no way to call that directly as a method, because a method must have a name in the symbol table.)"
[snip]
>What is a reporting truss, pls? I've searched but didn't find much on
>it. Also, about this truss and good logging system, again, could you
>pls. site examples of good CPAN modules that already do all this? I am
>prepared to read every line of them to understand these concepts. Pls.
>don't mind if I ask for examples, but they really drive home all of
>you guys' points...
>
I'll see if I can find a primitave example for you.
Below is a way of using anonymous sub methods as private (if its really necessary).
-sln
## Test.pl
# ==================
use strict;
use warnings;
use Ptest;
my $t = Ptest->new();
$t->PrintWorld( 'Hello' );
# print Ptest::$p{_MyPrint},"\n"; <- won't work, %p is file-scoped lexical in Ptest!
__END__
## Ptest.pm
# ==================
use strict;
use warnings;
package Ptest;
our @ISA = qw();
# File scope vars
# -----------------
my %p = (); # hash of private method refs
# User methods
# -------------
sub new
{
my $class = shift;
my $self = {
B => 'World',
C => 'Bye',
};
return bless ($self, $class);
}
sub PrintWorld
{
my ($self, $str) = @_;
$p{_MyPrint} ( $self, 'Hello' );
}
sub PrintBye
{
my $self = shift;
print "$self->{C}!\n";
}
# Private methods
# -----------------
$p{_MyPrint} = sub
{
my ($self, $A) = @_;
print "$A $self->{B}\n";
$self->PrintBye();
};
1;
------------------------------
Date: Wed, 18 Mar 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Mar 18 2009
Message-Id: <KGoqEr.1p4q@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.
AI-Genetic-Pro-0.34
http://search.cpan.org/~strzelec/AI-Genetic-Pro-0.34/
Efficient genetic algorithms for professional purpose.
----
Acme-URM-0.01
http://search.cpan.org/~cyga/Acme-URM-0.01/
URM (unlimited register machine) emulation
----
Apache2-Pod-0.26
http://search.cpan.org/~markle/Apache2-Pod-0.26/
base class for converting Pod files to prettier forms
----
Apache2-Pod-0.27
http://search.cpan.org/~markle/Apache2-Pod-0.27/
base class for converting Pod files to prettier forms
----
Authen-Simple-IMAP-0.0.1
http://search.cpan.org/~dmartin/Authen-Simple-IMAP-0.0.1/
Simple IMAP and IMAPS authentication
----
Bio-Glite-0.01
http://search.cpan.org/~gaou/Bio-Glite-0.01/
G-language Genome Analysis Environment REST service interface module
----
Bio-Graphics-1.91
http://search.cpan.org/~lds/Bio-Graphics-1.91/
Generate GD images of Bio::Seq objects
----
CHI-Driver-DBI-1.0
http://search.cpan.org/~perrin/CHI-Driver-DBI-1.0/
Use DBI for cache storage
----
CPANPLUS-YACSmoke-0.32
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.32/
Yet Another CPANPLUS Smoke Tester
----
Champlain-0.02
http://search.cpan.org/~potyl/Champlain-0.02/
Map rendering canvas
----
Config-Model-Xorg-1.102
http://search.cpan.org/~ddumont/Config-Model-Xorg-1.102/
Xorg configuration model for Config::Model
----
DBD-DB2-1.7
http://search.cpan.org/~ibmtordb2/DBD-DB2-1.7/
DataBase Driver for DB2 UDB
----
DBIx-DataModel-1.12
http://search.cpan.org/~dami/DBIx-DataModel-1.12/
Classes and UML-style Associations on top of DBI
----
Dackup-0.40
http://search.cpan.org/~lbrocard/Dackup-0.40/
Flexible file backup
----
Dackup-0.41
http://search.cpan.org/~lbrocard/Dackup-0.41/
Flexible file backup
----
Elive-0.01
http://search.cpan.org/~warringd/Elive-0.01/
Elluminate Live (c) client library
----
Finance-NASDAQ-Quote-0.03
http://search.cpan.org/~iank/Finance-NASDAQ-Quote-0.03/
Fetch real time stock quotes from nasdaq.com
----
FlatFile-DataStore-0.04
http://search.cpan.org/~bbaxter/FlatFile-DataStore-0.04/
Perl module that implements a flat file data store.
----
FlatFile-DataStore-0.05
http://search.cpan.org/~bbaxter/FlatFile-DataStore-0.05/
Perl module that implements a flat file data store.
----
FormValidator-Lite-0.03
http://search.cpan.org/~tokuhirom/FormValidator-Lite-0.03/
lightweight form validation library
----
Glib-1.220
http://search.cpan.org/~tsch/Glib-1.220/
Perl wrappers for the GLib utility and Object libraries
----
Gtk2-1.220
http://search.cpan.org/~tsch/Gtk2-1.220/
Perl interface to the 2.x series of the Gimp Toolkit library
----
Gtk2-Ex-ErrorTextDialog-2
http://search.cpan.org/~kryde/Gtk2-Ex-ErrorTextDialog-2/
display error messages in a dialog
----
HTML-Shakan-0.01_05
http://search.cpan.org/~tokuhirom/HTML-Shakan-0.01_05/
form html generator/validator
----
HTML-Widgets-Search-0.07
http://search.cpan.org/~frankie/HTML-Widgets-Search-0.07/
Perl module for building searches returning HTML
----
HTML-WikiConverter-0.67
http://search.cpan.org/~diberri/HTML-WikiConverter-0.67/
Convert HTML to wiki markup
----
HTML-WikiConverter-Markdown-0.05
http://search.cpan.org/~diberri/HTML-WikiConverter-Markdown-0.05/
Convert HTML to Markdown markup
----
Image-ImageShack-0.04
http://search.cpan.org/~plank/Image-ImageShack-0.04/
Upload images to be hosted at imageshack.us without needing any account information.
----
Iterator-Paged-0.001
http://search.cpan.org/~johnd/Iterator-Paged-0.001/
Simple iterator with events for accessing more records.
----
Iterator-Paged-0.002
http://search.cpan.org/~johnd/Iterator-Paged-0.002/
Simple iterator with events for accessing more records.
----
Iterator-Paged-0.003
http://search.cpan.org/~johnd/Iterator-Paged-0.003/
Simple iterator with events for accessing more records.
----
Math-GSL-0.17_03
http://search.cpan.org/~leto/Math-GSL-0.17_03/
Perl interface to the GNU Scientific Library (GSL)
----
Module-Install-0.80
http://search.cpan.org/~adamk/Module-Install-0.80/
Standalone, extensible Perl module installer
----
MooseX-WithCache-0.00003
http://search.cpan.org/~dmaki/MooseX-WithCache-0.00003/
Easy Cache Access From Moose Objects
----
Net-FireEagle-1.4
http://search.cpan.org/~simonw/Net-FireEagle-1.4/
access Yahoo's new FireEagle location service
----
Net-Mosso-CloudFiles-0.40
http://search.cpan.org/~lbrocard/Net-Mosso-CloudFiles-0.40/
Interface to Mosso CloudFiles service
----
Net-Mosso-CloudFiles-0.41
http://search.cpan.org/~lbrocard/Net-Mosso-CloudFiles-0.41/
Interface to Mosso CloudFiles service
----
Net-SFTP-Foreign-1.49
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.49/
SSH File Transfer Protocol client
----
Object-LocalVars-0.20
http://search.cpan.org/~dagolden/Object-LocalVars-0.20/
Outside-in objects with local aliasing of $self and object variables
----
POE-Filter-Hessian-0.1.1
http://search.cpan.org/~heytrav/POE-Filter-Hessian-0.1.1/
Translate datastructures to and from Hessian for transmission via a POE ReadWrite wheel.
----
Pango-1.220
http://search.cpan.org/~tsch/Pango-1.220/
Layout and render international text
----
Paranoid-0.23
http://search.cpan.org/~corliss/Paranoid-0.23/
Paranoia support for safer programs
----
Pod-Abstract-0.15
http://search.cpan.org/~blilburne/Pod-Abstract-0.15/
Abstract document tree for Perl POD documents
----
Pod-POM-0.19
http://search.cpan.org/~andrewf/Pod-POM-0.19/
POD Object Model
----
Pod-POM-0.20
http://search.cpan.org/~andrewf/Pod-POM-0.20/
POD Object Model
----
Statistics-ANOVA-0.062
http://search.cpan.org/~rgarton/Statistics-ANOVA-0.062/
Perform oneway analyses of variance
----
Statistics-FisherPitman-0.032
http://search.cpan.org/~rgarton/Statistics-FisherPitman-0.032/
Randomization-based alternative to one-way independent groups ANOVA; unequal variances okay
----
Statistics-Sequences-0.031
http://search.cpan.org/~rgarton/Statistics-Sequences-0.031/
Tests of sequential structure in the form of runs, joins, bunches, etc.
----
Statistics-Zed-0.022
http://search.cpan.org/~rgarton/Statistics-Zed-0.022/
Basic ztest/zscore, with optional continuity correction, Fisher's r-to-z, z-to-r, et al.
----
Test-Cucumber-0.001
http://search.cpan.org/~johnd/Test-Cucumber-0.001/
Perl extension for "Natural Language" test development
----
Text-Capitalize-0.8
http://search.cpan.org/~doom/Text-Capitalize-0.8/
capitalize strings ("to WORK AS titles" becomes "To Work as Titles")
----
UMLS-Similarity-0.13
http://search.cpan.org/~btmcinnes/UMLS-Similarity-0.13/
This is a suite of Perl modules that implements a number of semantic similarity measures. These algorithms use the UMLS-Interface module to access the UMLS to generate relatedness scores between conce
----
Unix-Lsof-0.0.6
http://search.cpan.org/~marcb/Unix-Lsof-0.0.6/
Wrapper to the Unix lsof utility
----
Video-FrameGrab-0.04
http://search.cpan.org/~mschilli/Video-FrameGrab-0.04/
Grab a frame or metadata from a video
----
WordNet-SenseRelate-AllWords-0.16
http://search.cpan.org/~tpederse/WordNet-SenseRelate-AllWords-0.16/
Disambiguate All Words in a Text based on semantic similarity and relatedness in WordNet
----
XML-Bare-0.43
http://search.cpan.org/~codechild/XML-Bare-0.43/
Minimal XML parser implemented via a C state engine
----
XML-Liberal-0.21
http://search.cpan.org/~miyagawa/XML-Liberal-0.21/
Super liberal XML parser that parses broken XML
----
Yahoo-Marketing-5.02
http://search.cpan.org/~shenj/Yahoo-Marketing-5.02/
an interface for Yahoo! Search Marketing's Web Services.
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Tue, 17 Mar 2009 17:32:22 -0700 (PDT)
From: google@markginsburg.com
Subject: Perl Packager - Free to wrong pool error
Message-Id: <9b445c43-cc0a-4d7b-8e3b-e1d4e0142010@o2g2000prl.googlegroups.com>
> perl -v
This is perl, v5.8.8 built for MSWin32-x86-multi-thread
...
== Begin of test.pl ==
use strict;
use warnings;
my $pid;
LaunchHostname();
print "waiting for child $pid to complete...\n";
my $waitstat = waitpid($pid,0);
print "waitpid returned $waitstat\n";
exit;
sub LaunchHostname {
$pid = fork ();
if (!defined($pid)) {
die "Failed to fork: $!\n";
}
elsif ($pid == 0) {
# This is the child
exec('hostname.exe'); # LINE 22
die "exec failed\n";
}
return;
}
== END of test.pl ==
> perl test.pl
waiting for child -3592 to complete...
fileserver123
waitpid returned -3592
> pp -o test.exe test.pl
> test.exe
waiting for child -1600 to complete...
fileserver123
Free to wrong pool fac720 not 8367c0 at script/test.pl line 22.
When I execute test.exe, the above error message is accompanied by a
pop up indicating "test.exe has encountered a problem and needs to
close. We are sorry for the inconvenience."
When I do all the above on a system with perl v5.10.0 installed, I do
not get the "Free to wrong pool" message but get a pop up that says:
'The instruction at "0x2800cd70" referenced memory at "0x00000028".
The memory could not be "read"'.
Any ideas why I get these errors?
------------------------------
Date: Wed, 18 Mar 2009 01:53:52 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Perl Packager - Free to wrong pool error
Message-Id: <gq0696-cp91.ln1@osiris.mauzo.dyndns.org>
Quoth google@markginsburg.com:
> > perl -v
> This is perl, v5.8.8 built for MSWin32-x86-multi-thread
> ...
>
> == Begin of test.pl ==
> use strict;
> use warnings;
>
> my $pid;
>
> LaunchHostname();
>
> print "waiting for child $pid to complete...\n";
> my $waitstat = waitpid($pid,0);
> print "waitpid returned $waitstat\n";
> exit;
>
> sub LaunchHostname {
> $pid = fork ();
> if (!defined($pid)) {
> die "Failed to fork: $!\n";
> }
> elsif ($pid == 0) {
> # This is the child
> exec('hostname.exe'); # LINE 22
> die "exec failed\n";
> }
Since you're on Win32, is there a good reason for using fork/exec rather
than system(1, ...) or Win32::Process? fork on Win32 is a rather
complicated emulation, and fork+exec ends up being a convoluted way of
calling spawnvp(3). Since the whole fork API is only present on Win32
for compatibility with Unix scripts, it's better to use the native
method.
> return;
> }
> == END of test.pl ==
>
> > perl test.pl
> waiting for child -3592 to complete...
> fileserver123
> waitpid returned -3592
>
> > pp -o test.exe test.pl
>
> > test.exe
> waiting for child -1600 to complete...
> fileserver123
> Free to wrong pool fac720 not 8367c0 at script/test.pl line 22.
'Free to wrong pool' generally indicates a threading-related bug in
either perl itself or some XS module. Presumably you can get rid of this
be removing the fork, but there's still an underlying bug somewhere. A
lot of these 'Free to wrong pool' bugs were fixed in 5.10, and I expect
most of the fixes went into 5.8.9 as well.
> When I execute test.exe, the above error message is accompanied by a
> pop up indicating "test.exe has encountered a problem and needs to
> close. We are sorry for the inconvenience."
>
> When I do all the above on a system with perl v5.10.0 installed, I do
> not get the "Free to wrong pool" message but get a pop up that says:
> 'The instruction at "0x2800cd70" referenced memory at "0x00000028".
> The memory could not be "read"'.
>
> Any ideas why I get these errors?
Not this one, sorry. Can you successfully build and execute anything
with pp? Can you reduce that test case at all and still provoke the bug?
Are you able to build a copy of perl with debugging symbols and get a
stack trace at the point of the crash?
Ben
------------------------------
Date: Wed, 18 Mar 2009 02:15:35 GMT
From: sln@netherlands.com
Subject: Re: Perl Packager - Free to wrong pool error
Message-Id: <egl0s492vv8bh6iat3a1in2sum28i6ui7h@4ax.com>
On Tue, 17 Mar 2009 17:32:22 -0700 (PDT), google@markginsburg.com wrote:
>> perl -v
>This is perl, v5.8.8 built for MSWin32-x86-multi-thread
>...
>
[snip]
>Free to wrong pool fac720 not 8367c0 at script/test.pl line 22.
>
>When I execute test.exe, the above error message is accompanied by a
>pop up indicating "test.exe has encountered a problem and needs to
>close. We are sorry for the inconvenience."
>
>When I do all the above on a system with perl v5.10.0 installed, I do
>not get the "Free to wrong pool" message but get a pop up that says:
>'The instruction at "0x2800cd70" referenced memory at "0x00000028".
>The memory could not be "read"'.
>
>Any ideas why I get these errors?
I got that message when I tried out of range unicode chars in regular expression tests.
But the windows MB says Perl encounterred an error and needs to close.
I press OK and the command prompt returns.
I do the very same command line again and get a different address, same result though.
Looks like its not nice to exec a program from Perl that will crash.
-sln
------------------------------
Date: Tue, 17 Mar 2009 20:30:40 GMT
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: perl/postscript csv->labels HERE-PROGRAM
Message-Id: <slrngs023g.crq.nospam-abuse@chorin.math.berkeley.edu>
On 2009-03-17, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> On 2009-03-17 06:00, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>> On 2009-03-17, Tad J McClellan <tadmc@seesig.invalid> wrote:
>>>> #!/usr/bin/perl
>>>
>>> Ask for all the help you can get:
>>>
>>> use strict;
>>> use warnings;
>>
>> Or, better, add -w ot the #!-line...
>
> Ok, I'll bite: How is -w better than "use warnings"?
IMO, `no warnings' is quite use()ful, but `use warnings' is absolutely
use()less.
Just try removing -w from
perl -we "sub a{print shift}" -e "use warnings; a my $x"
(I pretend I forgot to initialize $x, and pass it to a function in a
different module.)
Hope this helps,
Ilya
------------------------------
Date: Tue, 17 Mar 2009 14:32:39 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: perl/postscript csv->labels HERE-PROGRAM
Message-Id: <XFUvl.81779$aZ3.31120@newsfe01.iad>
Ilya Zakharevich wrote:
> On 2009-03-17, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>> On 2009-03-17 06:00, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>>> On 2009-03-17, Tad J McClellan <tadmc@seesig.invalid> wrote:
>>>>> #!/usr/bin/perl
>>>> Ask for all the help you can get:
>>>>
>>>> use strict;
>>>> use warnings;
>>> Or, better, add -w ot the #!-line...
>> Ok, I'll bite: How is -w better than "use warnings"?
>
> IMO, `no warnings' is quite use()ful, but `use warnings' is absolutely
> use()less.
>
> Just try removing -w from
>
> perl -we "sub a{print shift}" -e "use warnings; a my $x"
perl -e "sub a{print shift}" -e "use warnings; a my $x"
Or is that not what you meant?
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
------------------------------
Date: Tue, 17 Mar 2009 23:02:17 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: perl/postscript csv->labels HERE-PROGRAM
Message-Id: <slrngs07fa.8tf.hjp-usenet2@hrunkner.hjp.at>
On 2009-03-17 20:30, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> On 2009-03-17, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>> On 2009-03-17 06:00, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
>>> On 2009-03-17, Tad J McClellan <tadmc@seesig.invalid> wrote:
>>>>> #!/usr/bin/perl
>>>>
>>>> Ask for all the help you can get:
>>>>
>>>> use strict;
>>>> use warnings;
>>>
>>> Or, better, add -w ot the #!-line...
>>
>> Ok, I'll bite: How is -w better than "use warnings"?
>
> IMO, `no warnings' is quite use()ful, but `use warnings' is absolutely
> use()less.
>
> Just try removing -w from
>
> perl -we "sub a{print shift}" -e "use warnings; a my $x"
% perl -e 'use warnings; sub a{print shift}' -e 'use warnings; a my $x'
Use of uninitialized value within @_ in print at -e line 1.
Yes, "use warnings" needs to be in every module. It usually is, which
means that you get warnings even if you don't use -w.
hp
------------------------------
Date: Wed, 18 Mar 2009 05:27:15 GMT
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: perl/postscript csv->labels HERE-PROGRAM
Message-Id: <slrngs11hj.h8j.nospam-abuse@chorin.math.berkeley.edu>
On 2009-03-17, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>>> Ok, I'll bite: How is -w better than "use warnings"?
>> IMO, `no warnings' is quite use()ful, but `use warnings' is absolutely
>> use()less.
>> Just try removing -w from
>> perl -we "sub a{print shift}" -e "use warnings; a my $x"
> % perl -e 'use warnings; sub a{print shift}' -e 'use warnings; a my $x'
> Use of uninitialized value within @_ in print at -e line 1.
Not applicable - you do not have control over "the first -e". It is
one of hundreds somebody else's modules your script is using...
> Yes, "use warnings" needs to be in every module.
No. Just use -w. It would just work.
And cannot be in ANY portable enough module - this would break
compatibility with pre-5.6.0...
Hope this helps,
Ilya
------------------------------
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 2281
***************************************