[27681] in Perl-Users-Digest
Perl-Users Digest, Issue: 9125 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 5 18:05:52 2006
Date: Wed, 5 Apr 2006 15: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 Wed, 5 Apr 2006 Volume: 10 Number: 9125
Today's topics:
Re: [VERY OT] Seeya all! <bik.mido@tiscalinet.it>
Re: fork and taint <noreply@gunnar.cc>
Re: my variables don't work inside of a loop <jgibson@mail.arc.nasa.gov>
Re: my variables don't work inside of a loop <1usa@llenroc.ude.invalid>
new CPAN modules at Wed Apr 5 19:17:12 2006 (Randal Schwartz)
Receiving SNMP traps <olivier.marechal@laposte.net>
Re: taint mode and require using "." <eflorac@imaginet.fr>
Re: taint mode and require using "." <noreply@gunnar.cc>
Re: taint mode and require using "." <eflorac@imaginet.fr>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 05 Apr 2006 22:22:16 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: [VERY OT] Seeya all!
Message-Id: <km98329abpamf2q03goa0b7ic1afd60gm4@4ax.com>
On Thu, 20 Jan 2005 20:56:45 +0100, in comp.lang.perl.misc I wrote:
>Dear all,
>
>
>I can't go on like this any more: I must take this f**ked up degree!
Just done, Folks!
;-)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Wed, 05 Apr 2006 21:21:20 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: fork and taint
Message-Id: <49ijljFp2fdjU1@individual.net>
Asterbing wrote:
> Hello. This script below crashes perl.exe when in taint mode. I've not
> any message in error log.
>
> #!/usr/bin/perl -T
> print "Content-type: text/html\n\n";
> my $pid = fork();
> die "fork: $!\n" unless defined $pid;
> if (!$pid){
> print "son ok<br>";
> exit 0;}
> print "daddy ok<br>";
> exit 0;
>
> It seems like the problem happen on line "my $pid = fork();" because if
> I stop the script just below using an "exit 0;", it crashes the same
> way.
Have you considered to ask Perl for help?
use strict;
use warnings;
use CGI::Carp 'fatalsToBrowser';
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 05 Apr 2006 11:31:34 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: my variables don't work inside of a loop
Message-Id: <050420061131341278%jgibson@mail.arc.nasa.gov>
In article <4433DFAF.4B15B170@king-cart.com>, Marshall Dudley
<mdudley@king-cart.com> wrote:
> I have a very strange problem. I am running perl version 5.005_03 built
> for i386-freebsd. The problem is that "my" variables which should be
> local to the block, are not being seen inside of a loop within that
> block. I have had to change them to global variables to get them seen.
What block are you talking about? The entire file? Which lexical scope
("my") variables are not being seen inside this block? $category,
$name, and @variables are lexically scoped to the entire file (at least
the part you have posted). $var is a lexically scoped to the foreach
loop (I typed this wrong the first time thanks to your lousy indenting
style). Thus, they are all seen inside the loop.
$$var refers to a global variable because you are using symbolic
references. If you had 'use strict;' at the beginning of your program
you would have known that. Since you only have one global variable
($options), it is the only one transformed by the substitution
operators inside the loop.
In other words, your program is doing exactly what it is programmed to
do and all of your variables are working they way they should. Whether
or not you really want to be doing what you are showing is another
matter.
>
> The following code demonstrates it:
>
> ---------------------------------------------
> my $category = "<test>";
> my $name = "product's";
> $options = "blue & green"; #This one is global
> my @variables = ("category","name","options");
> foreach my $var(@variables) {
> $$var =~ s/\</</g;
> $$var =~ s/\>/>/g;
> $$var =~ s/\&/&/g;
> $$var =~ s/\'/'/g;
> $$var =~ s/\"/"/g;
> print "$var = $$var\n";
> }
> print "$category - $name - $options\n";
>
> ----------------- and when executed gives me this:
>
> execonn# perl test.pl
> category =
> name =
> options = blue & green
> <test> - product's - blue & green
> #execonn
>
> As can be seen, the "my" variables completely disappear when they are
> accessed inside the loop both to the regular expression and the print
> statement, yet reappear when outside of the loop, and the global
> variable of options is available both in the loop and outside of it.
No, they do not. You are not using lexical ("my") variables inside the
loop. You are using symbolic references to global variables. You cannot
use symbolic references to lexical variables.
>
> Any ideas? Everything I find says that "my" variables should be
> available everywhere within the block that they are declared in.
Don't use symbolic references. Please explain what it is you are really
trying to do and someone will surely be able to help you (but please
fix up your indenting before posting again.)
Thanks.
------------------------------
Date: Wed, 05 Apr 2006 18:44:01 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: my variables don't work inside of a loop
Message-Id: <Xns979C96034CC0Aasu1cornelledu@127.0.0.1>
Marshall Dudley <mdudley@king-cart.com> wrote in news:4433DFAF.4B15B170
@king-cart.com:
> for i386-freebsd. The problem is that "my" variables which should be
> local to the block, are not being seen inside of a loop within that
> block. I have had to change them to global variables to get them
> seen.
Others have explained $$var is a symbolic reference to the global
variable whose name is held in $var.
> ---------------------------------------------
> my $category = "<test>";
> my $name = "product's";
> $options = "blue & green"; #This one is global
> my @variables = ("category","name","options");
> foreach my $var(@variables) {
> $$var =~ s/\</</g;
> $$var =~ s/\>/>/g;
> $$var =~ s/\&/&/g;
> $$var =~ s/\'/'/g;
> $$var =~ s/\"/"/g;
> print "$var = $$var\n";
> }
#!/usr/bin/perl
use strict;
use warnings;
my $category = q{<test>};
my $name = q{product's};
my $options = q{blue & green};
foreach my $var ( $category, $name, $options ) {
$var =~ s/&/&/g;
$var =~ s/</</g;
$var =~ s/>/>/g;
$var =~ s/'/'/g;
$var =~ s/"/"/g;
print "\$var = $var\n";
}
__END__
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 5 Apr 2006 19:17:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules at Wed Apr 5 19:17:12 2006
Message-Id: <Ix9K8o.16s@zorch.sf-bay.org>
TiVo-1.3.1
http://search.cpan.org/~sschneid/TiVo-1.3.1/
a Perl interface to the TiVo Calypso protocol
----
DBD-Pg-1.48
http://search.cpan.org/~dbdpg/DBD-Pg-1.48/
PostgreSQL database driver for the DBI module
----
Mail-Webmail-Gmail-1.07
http://search.cpan.org/~mincus/Mail-Webmail-Gmail-1.07/
An interface to Google's webmail service
----
Parallel-Forker-1.202
http://search.cpan.org/~wsnyder/Parallel-Forker-1.202/
Parallel job forking and management
----
Mail-Webmail-Gmail-1.06.1
http://search.cpan.org/~mincus/Mail-Webmail-Gmail-1.06.1/
An interface to Google's webmail service
----
Rose-DateTime-0.521
http://search.cpan.org/~jsiracusa/Rose-DateTime-0.521/
DateTime helper functions and objects.
----
Email-Filter-SpamAssassin-v0.0.1
http://search.cpan.org/~uvoelker/Email-Filter-SpamAssassin-v0.0.1/
integrate Mail::SpamAssassin in Email::Filter
----
Rose-DB-Object-0.701
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.701/
Extensible, high performance RDBMS-OO mapper.
----
sqlpp-0.03
http://search.cpan.org/~karasik/sqlpp-0.03/
SQL preprocessor
----
Text-Hatena-0.11
http://search.cpan.org/~jkondo/Text-Hatena-0.11/
Perl extension for formatting text with Hatena Style.
----
FEAR-API-0.480.2
http://search.cpan.org/~xern/FEAR-API-0.480.2/
There's no fear with this elegant site scraper
----
Net-Amazon-0.35
http://search.cpan.org/~mschilli/Net-Amazon-0.35/
Framework for accessing amazon.com via SOAP and XML/HTTP
----
Rose-DB-0.671
http://search.cpan.org/~jsiracusa/Rose-DB-0.671/
A DBI wrapper and abstraction layer.
----
Parse-RecDescent-FAQ-5.00
http://search.cpan.org/~tbone/Parse-RecDescent-FAQ-5.00/
the official, authorized FAQ for Parse::RecDescent.
----
CGI-Session-ExpireSessions-1.06
http://search.cpan.org/~rsavage/CGI-Session-ExpireSessions-1.06/
Delete expired CGI::Session db-based and file-based sessions
----
SVN-Notify-2.56
http://search.cpan.org/~dwheeler/SVN-Notify-2.56/
Subversion activity notification
----
DBIx-HTML-PopupRadio-1.13
http://search.cpan.org/~rsavage/DBIx-HTML-PopupRadio-1.13/
Convert sql into a popup menu or radio group.
----
WWW-Mechanize-Pluggable-1.00
http://search.cpan.org/~mcmahon/WWW-Mechanize-Pluggable-1.00/
custmomizable via plugins
----
Net-ICQ-On-1.10.5
http://search.cpan.org/~jeromemck/Net-ICQ-On-1.10.5/
ICQ Online Tester
----
Business-PayPal-API-0.23
http://search.cpan.org/~scottw/Business-PayPal-API-0.23/
PayPal API
----
RiveScript-0.18
http://search.cpan.org/~kirsle/RiveScript-0.18/
Rendering Intelligence Very Easily
----
RiveScript-0.17
http://search.cpan.org/~kirsle/RiveScript-0.17/
Rendering Intelligence Very Easily
----
Net-Amazon-S3-0.31
http://search.cpan.org/~lbrocard/Net-Amazon-S3-0.31/
Use the Amazon S3 - Simple Storage Service
----
RTx-RightsMatrix-0.03.00
http://search.cpan.org/~htchapman/RTx-RightsMatrix-0.03.00/
Bulk editing GUI for RT rights
----
Rose-DB-Object-0.70
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.70/
Extensible, high performance RDBMS-OO mapper.
----
Math-Prime-XS-0.17
http://search.cpan.org/~schubiger/Math-Prime-XS-0.17/
Calculate/detect prime numbers with deterministic tests
----
Rose-DB-0.67
http://search.cpan.org/~jsiracusa/Rose-DB-0.67/
A DBI wrapper and abstraction layer.
----
threads-1.21
http://search.cpan.org/~jdhedden/threads-1.21/
Perl interpreter-based threads
----
Rose-DateTime-0.52
http://search.cpan.org/~jsiracusa/Rose-DateTime-0.52/
DateTime helper functions and objects.
----
Catalyst-Plugin-Message-0.02
http://search.cpan.org/~chunzi/Catalyst-Plugin-Message-0.02/
The great new Catalyst::Plugin::Message!
----
Log-Funlog-0.85_1
http://search.cpan.org/~korsani/Log-Funlog-0.85_1/
Log module with fun inside!
----
WWW-Blog-Metadata-Yadis-0.03
http://search.cpan.org/~kokogiko/WWW-Blog-Metadata-Yadis-0.03/
Extract Yadis Resourse Descriptor URL from HTML header
----
Log-Funlog-0.85
http://search.cpan.org/~korsani/Log-Funlog-0.85/
Log module with fun inside!
----
EekBoek-0.55
http://search.cpan.org/~jv/EekBoek-0.55/
Bookkeeping software for small and medium-size businesses
----
EekBoek-0.54
http://search.cpan.org/~jv/EekBoek-0.54/
Bookkeeping software for small and medium-size businesses
----
Class-Rebless-0.06
http://search.cpan.org/~gaal/Class-Rebless-0.06/
Rebase deep data structures
----
Catalyst-Plugin-CodeEval-0.012
http://search.cpan.org/~shot/Catalyst-Plugin-CodeEval-0.012/
Module for huge Catalyst application development.
----
SAP-Rfc-1.41
http://search.cpan.org/~piers/SAP-Rfc-1.41/
SAP RFC - RFC Function calls against an SAP R/3 System
----
Win32API-Registry-0.27
http://search.cpan.org/~blm/Win32API-Registry-0.27/
Low-level access to Win32 system API calls from WINREG.H
----
Class-Trigger-Ordered-0.01
http://search.cpan.org/~boxphere/Class-Trigger-Ordered-0.01/
A little flexibility was added to Class::Trigger
----
Email-Folder-0.85
http://search.cpan.org/~simonw/Email-Folder-0.85/
read all the messages from a folder as Email::Simple objects.
----
Net-FS-Gmail-0.2
http://search.cpan.org/~simonw/Net-FS-Gmail-0.2/
store and retrieve files on Gmail
----
Array-Diff-0.02
http://search.cpan.org/~typester/Array-Diff-0.02/
Diff two arrays
----
Array-Diff-0.01
http://search.cpan.org/~typester/Array-Diff-0.01/
Diff two arrays
----
CGI-WebGzip-0.14
http://search.cpan.org/~koterov/CGI-WebGzip-0.14/
Perl extension for GZipping script output
----
Template-Plugin-HtmlToText-0.01
http://search.cpan.org/~fayland/Template-Plugin-HtmlToText-0.01/
Plugin interface to HTML::FormatText
----
KinoSearch-0.09_03
http://search.cpan.org/~creamyg/KinoSearch-0.09_03/
search engine library
----
Lingua-KO-Romanize-Hangul-0.12
http://search.cpan.org/~kawasaki/Lingua-KO-Romanize-Hangul-0.12/
Romanization of Korean language
----
Lingua-ZH-Romanize-Pinyin-0.12
http://search.cpan.org/~kawasaki/Lingua-ZH-Romanize-Pinyin-0.12/
Romanization of Standard Chinese language
----
Lingua-JA-Romanize-Japanese-0.12
http://search.cpan.org/~kawasaki/Lingua-JA-Romanize-Japanese-0.12/
Romanization of Japanese language
----
Sys-Statgrab-0.01
http://search.cpan.org/~rybskej/Sys-Statgrab-0.01/
Extension of Unix::Statgrab for greater portability
----
Data-Pager-0.01
http://search.cpan.org/~vidul/Data-Pager-0.01/
flexible data pager
----
WWW-Blog-Metadata-Yadis-0.02
http://search.cpan.org/~kokogiko/WWW-Blog-Metadata-Yadis-0.02/
Extract Yadis Resourse Descriptor URL from HTML header
----
RTx-Shredder-0.03_03
http://search.cpan.org/~ruz/RTx-Shredder-0.03_03/
Cleanup RT database
----
Games-Sudoku-Component-0.02
http://search.cpan.org/~ishigaki/Games-Sudoku-Component-0.02/
provides APIs for Sudoku solver/generator
----
HTTP-MessageParser-0.3
http://search.cpan.org/~chansen/HTTP-MessageParser-0.3/
Parse HTTP Messages
----
activitymail-1.24
http://search.cpan.org/~dwheeler/activitymail-1.24/
CVS activity notification
----
SVN-Notify-2.55
http://search.cpan.org/~dwheeler/SVN-Notify-2.55/
Subversion activity notification
----
Acme-Greek-0.01
http://search.cpan.org/~jrockway/Acme-Greek-0.01/
??'? ??? ????? ?? ??!
----
KinoSearch-0.09_02
http://search.cpan.org/~creamyg/KinoSearch-0.09_02/
search engine library
----
Error-0.15005
http://search.cpan.org/~shlomif/Error-0.15005/
Error/exception handling in an OO-ish way
----
CGI-Session-4.11
http://search.cpan.org/~markstos/CGI-Session-4.11/
persistent session data in CGI applications
----
DBIx-Web-0.61
http://search.cpan.org/~makarow/DBIx-Web-0.61/
Active Web Database Layer
----
Apache-DB-0.12
http://search.cpan.org/~fwiles/Apache-DB-0.12/
Run the interactive Perl debugger under mod_perl
--
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: Wed, 5 Apr 2006 22:45:09 +0200
From: "Olivier" <olivier.marechal@laposte.net>
Subject: Receiving SNMP traps
Message-Id: <44342c52$0$13233$636a55ce@news.free.fr>
I'm looking for a module which can be used to receive SNMP traps.
I wish that this module is compatible with ActivePerl 5.8.x.
Does anyone knows the solution ?
Olivier
------------------------------
Date: Wed, 05 Apr 2006 22:16:22 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: taint mode and require using "."
Message-Id: <pan.2006.04.05.20.16.22.55151@imaginet.fr>
Le Wed, 05 Apr 2006 14:51:42 +0200, Gunnar Hjalmarsson a écrit :
>
> You can add it:
>
> use lib '.';
Nope, not in taint mode.
--
Pluralitas non est ponenda sine necessitate.
Guillaume d'Ockham.
------------------------------
Date: Wed, 05 Apr 2006 22:32:15 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: taint mode and require using "."
Message-Id: <49inqhFovc2iU1@individual.net>
Emmanuel Florac wrote:
> Le Wed, 05 Apr 2006 14:51:42 +0200, Gunnar Hjalmarsson a écrit :
>>
>>You can add it:
>>
>> use lib '.';
>
> Nope, not in taint mode.
C:\home>type test.pl
use lib '.';
grep $_ eq '.', @INC and print "Worked fine\n";
C:\home>perl -T test.pl
Worked fine
C:\home>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 05 Apr 2006 22:45:51 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: taint mode and require using "."
Message-Id: <pan.2006.04.05.20.45.51.24635@imaginet.fr>
Le Wed, 05 Apr 2006 22:32:15 +0200, Gunnar Hjalmarsson a écrit :
>
> C:\home>perl -T test.pl
> Worked fine
Weird, didn't work last time I tried.
--
Si ça a l'air facile, c'est difficile. Si ça a l'air difficile, c'est
carrément impossible. Si ça a l'air impossible, c'est un compilateur
Ada.
Théorème de Stockmayer.
------------------------------
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 9125
***************************************