[30052] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1295 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 21 03:09:43 2008

Date: Thu, 21 Feb 2008 00:09:07 -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, 21 Feb 2008     Volume: 11 Number: 1295

Today's topics:
    Re: Book: Applied Perl - sourcecode required <sigzero@gmail.com>
    Re: FormMail - value1=value2 <noreply@gunnar.cc>
        how to retrieve info <rose@russ.org>
    Re: How to save a webpage contents to a file ( with LWP <jack_posemsky@yahoo.com>
    Re: How to save a webpage contents to a file ( with LWP <noreply@gunnar.cc>
    Re: how to substitute text - special case <noreply@gunnar.cc>
        new CPAN modules on Thu Feb 21 2008 (Randal Schwartz)
    Re: new module SQL::QueryQueue <rvtol+news@isolution.nl>
    Re: Number of days since 1/1/2000 dummy@phony.info
    Re: Number of days since 1/1/2000 <noreply@gunnar.cc>
    Re: PerlCtrl and arrays of arrays <Bruce.Axtens@gmail.com>
    Re: PerlCtrl and arrays of arrays <Bruce.Axtens@gmail.com>
        setting %ENV in a module <pgodfrin@gmail.com>
    Re: setting %ENV in a module <noreply@gunnar.cc>
    Re: setting %ENV in a module <pgodfrin@gmail.com>
    Re: setting %ENV in a module <joost@zeekat.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 20 Feb 2008 17:36:27 -0800 (PST)
From: Robert Hicks <sigzero@gmail.com>
Subject: Re: Book: Applied Perl - sourcecode required
Message-Id: <cf84a18b-5593-4f51-9f00-ee90303d18a1@v3g2000hsc.googlegroups.com>

On Feb 20, 10:21=A0am, "mydaj [ROR]" <> wrote:
> Hi,
>
> Title: Applied Perl
> Authors: Peter Williams
> Publisher: M&T books
> ISBN: 0764547836
>
> I bought the above book, I unable to download the source code, as
> the sitewww.peterwilliams.netis no longer online. Could anyone point
> me to another download link.
> Thanks in advance.
>
> LC

Back slowly away from that book!

You want "Learning Perl"...

Robert


------------------------------

Date: Thu, 21 Feb 2008 00:19:49 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail - value1=value2
Message-Id: <623qp5F216kseU1@mid.individual.net>

[ Please don't top-post! ]

Adrian Nelson wrote:
> Thanks to you all for your replies. I understand loud and clear that 
> Matt's FormMail is to be avoided. I also have access to nms_formail, my 
> original question still applies but should I be posting in a different 
> group?

Not necessarily. Make an own attempt and, if needed, explain here (with 
code) what you did and how the output differs from the expected output.

> I was approaching the problem from a php angle where I could define 
> parameters at the start of the app, was hoping there'd be a similar Perl 
> method.

I'm sure that whatever your problem is, there is a solution available in 
Perl as well.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Thu, 21 Feb 2008 15:09:44 +0800
From: "Rose" <rose@russ.org>
Subject: how to retrieve info
Message-Id: <fpj83q$vj8$1@ijustice.itsc.cuhk.edu.hk>

i have hundreds of files to submit to

http://propka.ki.ku.dk/~drogers/

for analysis. the inputs are some 4-letter code, e.g. 1a00, 1brs, 2bti, 
3bmn, ...

How can I tell perl to submit the values and retrieve the results under a 
Linux platform?




------------------------------

Date: Wed, 20 Feb 2008 15:49:37 -0800 (PST)
From: Jack <jack_posemsky@yahoo.com>
Subject: Re: How to save a webpage contents to a file ( with LWP )
Message-Id: <6cc4af08-cfac-4a27-9831-9c47471f6d3c@n77g2000hse.googlegroups.com>

On Feb 20, 8:08=A0am, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Jack wrote:
> > this is all there is in the html
> > =A0 <!--<SCRIPT>
> > =A0 =A0//
> > =A0 </SCRIPT>-->
> > =A0 <FRAMESET ROWS=3D"70,*" FRAMESPACING=3D0>
> > =A0 =A0<FRAME NAME=3D"header" SRC=3D"./header_default.asp?
> > NoCache=3D2%2F20%2F2008+7%3A35%3A47+AM" SCROLLING=3D"no" MARGINWIDTH=3D"=
2"
> > MARGINHEIGHT=3D"0">
>
> > =A0 =A0<FRAME NAME=3D"bodyx" SRC=3D
> > body.asp?centerin=3DGGCC
> > =A0 =A0SCROLLING=3D"auto" MARGINWIDTH=3D"2" MARGINHEIGHT=3D"2">
>
> > </FRAMESET>
>
> > </HTML>
>
> Then get the bodyx frame, not the frameset.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl- Hide quoted text -
>
> - Show quoted text -

How exactly does one get the bodyx frame, and more importantly how do
you auto select from the select box when there is no such mention of
it or a submit button in html for this ASP application.
Thank you,
Jack


------------------------------

Date: Thu, 21 Feb 2008 01:50:27 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to save a webpage contents to a file ( with LWP )
Message-Id: <624034F21be08U1@mid.individual.net>

Jack wrote:
> On Feb 20, 8:08 am, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
>> Jack wrote:
>>> this is all there is in the html
>>>   <!--<SCRIPT>
>>>    //
>>>   </SCRIPT>-->
>>>   <FRAMESET ROWS="70,*" FRAMESPACING=0>
>>>    <FRAME NAME="header" SRC="./header_default.asp?
>>> NoCache=2%2F20%2F2008+7%3A35%3A47+AM" SCROLLING="no" MARGINWIDTH="2"
>>> MARGINHEIGHT="0">
>>>    <FRAME NAME="bodyx" SRC=
>>> body.asp?centerin=GGCC
>>>    SCROLLING="auto" MARGINWIDTH="2" MARGINHEIGHT="2">
>>> </FRAMESET>
>>> </HTML>
>>
>> Then get the bodyx frame, not the frameset.
> 
> How exactly does one get the bodyx frame,

Assuming the URL of the frameset is 
http://www.example.com/somepage/index.asp, you probably use the URL 
http://www.example.com/somepage/body.asp?centerin=GGCC

> and more importantly how do
> you auto select from the select box when there is no such mention of
> it or a submit button in html for this ASP application.

As Sinan mentioned, you apparently need to learn some basics about HTML. 
Asking questions in a Perl group is not the right way to do so.

Recommended reading: http://www.w3.org/TR/html4/present/frames.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Thu, 21 Feb 2008 00:23:35 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to substitute text - special case
Message-Id: <623r07F216kseU2@mid.individual.net>

lars wrote:
> Try it this way
> 
> s/ \+ /\+/g
---------^
What's the reason for that backslash?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Thu, 21 Feb 2008 05:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Feb 21 2008
Message-Id: <JwKqIH.1K4F@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.

Apache2-ASP-1.31
http://search.cpan.org/~johnd/Apache2-ASP-1.31/
Perl extension for ASP on mod_perl2. 
----
Archive-Rar-1.95
http://search.cpan.org/~smueller/Archive-Rar-1.95/
Interface with the 'rar' command 
----
B-Generate-1.12_05
http://search.cpan.org/~jcromie/B-Generate-1.12_05/
Create your own op trees. 
----
Bundle-Thread-1.03
http://search.cpan.org/~jdhedden/Bundle-Thread-1.03/
A bundle of modules for supporting threads in Perl 
----
CGI-LZE-0.26
http://search.cpan.org/~lze/CGI-LZE-0.26/
----
CGI-LZE-Blog-0.26
http://search.cpan.org/~lze/CGI-LZE-Blog-0.26/
----
CORBA-Python-2.62
http://search.cpan.org/~perrad/CORBA-Python-2.62/
----
Catalyst-Engine-Apache-1.12
http://search.cpan.org/~agrundma/Catalyst-Engine-Apache-1.12/
Catalyst Apache Engines 
----
Catalyst-Model-LDAP-0.16
http://search.cpan.org/~danieltwc/Catalyst-Model-LDAP-0.16/
LDAP model class for Catalyst 
----
Catalyst-Model-SWISH-0.02
http://search.cpan.org/~karman/Catalyst-Model-SWISH-0.02/
Catalyst model for Swish-e 
----
Common-CLI-0.01
http://search.cpan.org/~izut/Common-CLI-0.01/
Command line applications made easy. 
----
Config-Interactive-0.01
http://search.cpan.org/~mpg/Config-Interactive-0.01/
config module with support for interpolation, XML fragments and interactive UI 
----
Config-Options-0.08
http://search.cpan.org/~ealleniii/Config-Options-0.08/
module to provide a configuration hash with option to read from file. 
----
DBD-Multi-0.13
http://search.cpan.org/~dwright/DBD-Multi-0.13/
Manage Multiple Data Sources with Failover and Load Balancing 
----
DBD-Pg-2.1.3
http://search.cpan.org/~turnstep/DBD-Pg-2.1.3/
PostgreSQL database driver for the DBI module 
----
DBI-LZE-0.26
http://search.cpan.org/~lze/DBI-LZE-0.26/
----
DashProfiler-1.09
http://search.cpan.org/~timb/DashProfiler-1.09/
efficiently collect call count and timing data aggregated by context 
----
Data-Paginate-v0.0.5
http://search.cpan.org/~dmuey/Data-Paginate-v0.0.5/
Perl extension for complete and efficient data pagination 
----
Data-Path-1.2
http://search.cpan.org/~zaphar/Data-Path-1.2/
Perl extension for XPath like accessing from complex data structs 
----
Data-Path-1.3
http://search.cpan.org/~zaphar/Data-Path-1.3/
Perl extension for XPath like accessing from complex data structs 
----
Data-Properties-YAML-0.02
http://search.cpan.org/~johnd/Data-Properties-YAML-0.02/
YAML-ized properties for your application 
----
Date-Piece-v0.0.2
http://search.cpan.org/~ewilhelm/Date-Piece-v0.0.2/
efficient dates with Time::Piece interoperability 
----
Fey-0.05
http://search.cpan.org/~drolsky/Fey-0.05/
Better SQL Generation Through Perl 
----
Fey-DBIManager-0.04
http://search.cpan.org/~drolsky/Fey-DBIManager-0.04/
Manage a set of DBI handles 
----
Fey-Test-0.04
http://search.cpan.org/~drolsky/Fey-Test-0.04/
Test libraries for Fey distros 
----
File-Remove-1.39_01
http://search.cpan.org/~adamk/File-Remove-1.39_01/
Remove files and directories 
----
HTML-Copy-1.3
http://search.cpan.org/~tkurita/HTML-Copy-1.3/
copy a HTML file without breaking links. 
----
HTML-Template-LZE-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-0.26/
----
HTML-Template-LZE-Editor-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-Editor-0.26/
----
HTML-Template-LZE-Main-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-Main-0.26/
----
HTML-Template-LZE-Pages-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-Pages-0.26/
----
HTML-Template-LZE-TabWidget-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-TabWidget-0.26/
----
HTML-Template-LZE-Window-0.26
http://search.cpan.org/~lze/HTML-Template-LZE-Window-0.26/
html window 
----
Hatena-Keyword-0.05
http://search.cpan.org/~naoya/Hatena-Keyword-0.05/
Extract Hatena Keywords in a string 
----
I18N-Charset-1.388
http://search.cpan.org/~mthurn/I18N-Charset-1.388/
IANA Character Set Registry names and Unicode::MapUTF8 (et al.) conversion scheme names 
----
IO-Socket-INET6-2.53
http://search.cpan.org/~shlomif/IO-Socket-INET6-2.53/
Object interface for AF_INET|AF_INET6 domain sockets 
----
List-Maker-v0.0.5
http://search.cpan.org/~dconway/List-Maker-v0.0.5/
Generate more sophisticated lists than just $a..$b 
----
List-Rotation-Cycle-1.009
http://search.cpan.org/~pelagic/List-Rotation-Cycle-1.009/
Cycle through a list of values via a singleton object implemented as closure. 
----
Mail-Builder-1.06
http://search.cpan.org/~maros/Mail-Builder-1.06/
Easily create e-mails with attachments, html and inline images 
----
Mail-Builder-1.07
http://search.cpan.org/~maros/Mail-Builder-1.07/
Easily create e-mails with attachments, html and inline images 
----
Mail-DKIM-0.30_8
http://search.cpan.org/~jaslong/Mail-DKIM-0.30_8/
Signs/verifies Internet mail with DKIM/DomainKey signatures 
----
Mail-IMAPClient-3.05
http://search.cpan.org/~markov/Mail-IMAPClient-3.05/
An IMAP Client API 
----
Math-Random-MT-Auto-6.11
http://search.cpan.org/~jdhedden/Math-Random-MT-Auto-6.11/
Auto-seeded Mersenne Twister PRNGs 
----
Music-Tag-0.3
http://search.cpan.org/~ealleniii/Music-Tag-0.3/
Module for collecting information about music files. 
----
Music-Tag-MP3-0.29
http://search.cpan.org/~ealleniii/Music-Tag-MP3-0.29/
Plugin module for Music::Tag to get information from id3 tags 
----
Net-DBus-0.33.6
http://search.cpan.org/~danberr/Net-DBus-0.33.6/
Perl extension for the DBus message system 
----
Net-Frame-Tools-1.02
http://search.cpan.org/~gomor/Net-Frame-Tools-1.02/
useful network utilities created using Net::Frame 
----
Net-MirrorDir-0.13
http://search.cpan.org/~knorr/Net-MirrorDir-0.13/
Perl extension for compare local-directories and remote-directories with each other 
----
News-NNTP-0.3
http://search.cpan.org/~jnixon/News-NNTP-0.3/
NNTP client implementation 
----
Ocsinventory-Agent-0.0.8.1
http://search.cpan.org/~goneri/Ocsinventory-Agent-0.0.8.1/
----
POE-Component-Client-Whois-Smart-0.05
http://search.cpan.org/~graykot/POE-Component-Client-Whois-Smart-0.05/
Provides very quick WHOIS queries with smart features. 
----
POE-Component-IRC-5.68
http://search.cpan.org/~bingos/POE-Component-IRC-5.68/
a fully event-driven IRC client module. 
----
POE-Component-Server-IRC-1.28
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.28/
A fully event-driven networkable IRC server daemon module. 
----
POE-Component-WebService-Validator-HTML-W3C-0.07
http://search.cpan.org/~zoffix/POE-Component-WebService-Validator-HTML-W3C-0.07/
a non-blocking POE wrapper around WebService::Validator::HTML::W3C 
----
POE-Component-Win32-ChangeNotify-1.10
http://search.cpan.org/~bingos/POE-Component-Win32-ChangeNotify-1.10/
A POE wrapper around Win32::ChangeNotify. 
----
POE-Component-Win32-ChangeNotify-1.12
http://search.cpan.org/~bingos/POE-Component-Win32-ChangeNotify-1.12/
A POE wrapper around Win32::ChangeNotify. 
----
POE-Component-Win32-EventLog-1.14
http://search.cpan.org/~bingos/POE-Component-Win32-EventLog-1.14/
A POE component that provides non-blocking access to Win32::EventLog. 
----
POE-Component-Win32-EventLog-1.16
http://search.cpan.org/~bingos/POE-Component-Win32-EventLog-1.16/
A POE component that provides non-blocking access to Win32::EventLog. 
----
POE-Component-Win32-Service-1.12
http://search.cpan.org/~bingos/POE-Component-Win32-Service-1.12/
A POE component that provides non-blocking access to Win32::Service. 
----
POE-Component-Win32-Service-1.14
http://search.cpan.org/~bingos/POE-Component-Win32-Service-1.14/
A POE component that provides non-blocking access to Win32::Service. 
----
POE-Filter-Swank-0.01
http://search.cpan.org/~avar/POE-Filter-Swank-0.01/
Stream based filter for the Swank protocol 
----
POEIKC-0.00_05
http://search.cpan.org/~suzuki/POEIKC-0.00_05/
POE IKC daemon and client 
----
Path-Abstract-0.080
http://search.cpan.org/~rkrimen/Path-Abstract-0.080/
A fast and featureful class for UNIX-style path manipulation 
----
SimpleConfig-0.01
http://search.cpan.org/~mpg/SimpleConfig-0.01/
simple config module 
----
Sub-Name-0.03
http://search.cpan.org/~xmath/Sub-Name-0.03/
(re)name a sub 
----
Test-Continuous-0.0.5
http://search.cpan.org/~gugod/Test-Continuous-0.0.5/
Run your tests suite continusouly when developing. 
----
Thread-Cancel-1.06
http://search.cpan.org/~jdhedden/Thread-Cancel-1.06/
Cancel (i.e., kill) threads 
----
Thread-Queue-2.05
http://search.cpan.org/~jdhedden/Thread-Queue-2.05/
Thread-safe queues 
----
Thread-Semaphore-2.06
http://search.cpan.org/~jdhedden/Thread-Semaphore-2.06/
Thread-safe semaphores 
----
Thread-Suspend-1.11
http://search.cpan.org/~jdhedden/Thread-Suspend-1.11/
Suspend and resume operations for threads 
----
WWW-PastebinCom-Retrieve-0.001
http://search.cpan.org/~zoffix/WWW-PastebinCom-Retrieve-0.001/
retrieve content of pastes from <http://pastebin.com> 
----
Win32-API-0.48
http://search.cpan.org/~cosimo/Win32-API-0.48/
Perl Win32 API Import Facility 
----
Win32-API-0.49
http://search.cpan.org/~cosimo/Win32-API-0.49/
Perl Win32 API Import Facility 
----
XML-DT-0.48
http://search.cpan.org/~ambs/XML-DT-0.48/
a package for down translation of XML files 
----
XML-DT-0.49
http://search.cpan.org/~ambs/XML-DT-0.49/
a package for down translation of XML files 
----
ack-1.77_03
http://search.cpan.org/~petdance/ack-1.77_03/
grep-like text finder 
----
autobox-2.11
http://search.cpan.org/~chocolate/autobox-2.11/
call methods on builtin types 
----
eGuideDog-Dict-Cantonese-0.3
http://search.cpan.org/~hgneng/eGuideDog-Dict-Cantonese-0.3/
an informal Jyutping dictionary. 
----
eGuideDog-Dict-Cantonese-0.31
http://search.cpan.org/~hgneng/eGuideDog-Dict-Cantonese-0.31/
an informal Jyutping dictionary. 
----
namespace-clean-0.06
http://search.cpan.org/~phaylon/namespace-clean-0.06/
Keep imports and functions out of your namespace 
----
threads-1.68
http://search.cpan.org/~jdhedden/threads-1.68/
Perl interpreter-based threads 
----
threads-shared-1.16
http://search.cpan.org/~jdhedden/threads-shared-1.16/
Perl extension for sharing data structures between threads 


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: Wed, 20 Feb 2008 23:53:12 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: new module SQL::QueryQueue
Message-Id: <fpiekg.1fs.1@news.isolution.nl>

mapeck65@gmail.com schreef:

> Looking for comments on the name, as well as the function of this
> module proposal. 

See also:
Mailing-List: contact modules-help(AT)perl.org; run by ezmlm

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: Wed, 20 Feb 2008 15:27:17 -0800
From: dummy@phony.info
Subject: Re: Number of days since 1/1/2000
Message-Id: <6odpr35pd2luepp28c1j4ii42vg647esck@4ax.com>

On Mon, 18 Feb 2008 11:20:30 -0800 (PST), oprah.chopra@gmail.com wrote:

>I am using the following subroutine to calculate the  number of days
>since 1/1/2000 . Is there any possible bug in it? I know  I can use
>Date::Manip but it will slow down my program which is around 100 kb
>long.
>
>use strict;
>use warnings;
>
>my $days = &calc_days;
>
>print "The number of days since 1/1/2000 is $days\n";
>

[snip]

print calc_days(),"\n";
sub calc_days {int ((time() - 946713600)/86400);}


------------------------------

Date: Thu, 21 Feb 2008 01:24:42 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Number of days since 1/1/2000
Message-Id: <623uirF20nr7iU1@mid.individual.net>

dummy@phony.info wrote:
> On Mon, 18 Feb 2008 11:20:30 -0800 (PST), oprah.chopra@gmail.com wrote:
>> ... to calculate the  number of days since 1/1/2000 .
> 
> print calc_days(),"\n";
> sub calc_days {int ((time() - 946713600)/86400);}

We just finished a long sub-thread that discusses that approach to this 
problem. 
http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/259972ffe1c1fa69#33f24a857d14e94f

The approach is not portable because
- the epoch is not the same on all systems, and
- there are other time zones in this world but US/Pacific. ;-)

Furthermore, you are mixing a local time zone with UTC, and the approach 
ignores the DST issue.

I think that this code takes all those objections into account:

     use Time::Local;
     use constant Y2000 => timelocal 0,0,0,1,0,2000;

     print calc_days(), "\n";
     sub calc_days {
         my $sec = timelocal(0,0,0,(localtime)[3..5]) - Y2000;
         sprintf '%.0f', $sec/86400;
     }

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 20 Feb 2008 19:29:33 -0800 (PST)
From: axtens <Bruce.Axtens@gmail.com>
Subject: Re: PerlCtrl and arrays of arrays
Message-Id: <1999f1fc-0379-4f28-a9b0-dd448b55e5a3@u10g2000prn.googlegroups.com>

Okay, I think I've found a solution:

I found convertArrayToVBArray at http://www.perlmonks.org/?node_id=516137
and applied it to as below

sub test {
  my $res = 1;
  my $dat = "hello";
  my @b = ("my", "dog", "has", 3, "fleas");
  my $c = convertArrayToVBArray( \@b );
  my @r = ( $res, $dat, $c);
  my $a = convertArrayToVBArray( \@r );
  return $a;
}

By using convertArrayToVBArray on the inner array, adding the result
to the outer array, and then pushing that array through
convertArrayToVBArray, I can hand back a VT_ARRAY|VT_VARIANT that is
equivalent to

Array( 1, "hello", Array( "my", "dog", "has", 3, "fleas" ))

I really ought to blog this.

Kind regards,
Bruce.


------------------------------

Date: Wed, 20 Feb 2008 22:17:02 -0800 (PST)
From: axtens <Bruce.Axtens@gmail.com>
Subject: Re: PerlCtrl and arrays of arrays
Message-Id: <33eccf89-145a-4f98-992b-cd551a91f17a@c33g2000hsd.googlegroups.com>

Okay, blogged on http://codeaholic.blogspot.com/2008/02/perlpdkperlctrl-returning-array-of.html

Kind regards,
Bruce.


------------------------------

Date: Wed, 20 Feb 2008 16:59:32 -0800 (PST)
From: pgodfrin <pgodfrin@gmail.com>
Subject: setting %ENV in a module
Message-Id: <9d90345a-6485-47d6-8edf-4bbb161e523e@t66g2000hsf.googlegroups.com>

Greetings,
So - I'd like to have a subroutine that reads a file with lines like:
export MYENVVAR=some_data and sets the hash $ENV{MYENVVAR}=some_data.
This part is easy....

I'd like to put that subroutine in a module so that I can use that
subroutine wherever I want to. I having problems with scoping - seems
the module subroutine sets the environment but then loses when control
is returned to the calling program. This part is hard.

Any thoughts?

pg


------------------------------

Date: Thu, 21 Feb 2008 02:41:28 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: setting %ENV in a module
Message-Id: <62432oF1ugrq1U1@mid.individual.net>

pgodfrin wrote:
> So - I'd like to have a subroutine that reads a file with lines like:
> export MYENVVAR=some_data and sets the hash $ENV{MYENVVAR}=some_data.
> This part is easy....
> 
> I'd like to put that subroutine in a module so that I can use that
> subroutine wherever I want to. I having problems with scoping - seems
> the module subroutine sets the environment but then loses when control
> is returned to the calling program.

I can't reproduce the problem you describe.

C:\home>type MyModules\ENVSet.pm
package MyModules::ENVSet;
$ENV{MYENVVAR}='Hello';
1;

C:\home>type test.pl
use MyModules::ENVSet;
print "$ENV{MYENVVAR}\n";

C:\home>test.pl
Hello

C:\home>

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 20 Feb 2008 20:41:33 -0800 (PST)
From: pgodfrin <pgodfrin@gmail.com>
Subject: Re: setting %ENV in a module
Message-Id: <c34bd1f0-a9ad-4d6a-99f7-ddf6f0d0f91d@q70g2000hsb.googlegroups.com>

On Feb 20, 7:41 pm, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> pgodfrin wrote:
> > So - I'd like to have a subroutine that reads a file with lines like:
> > export MYENVVAR=some_data and sets the hash $ENV{MYENVVAR}=some_data.
> > This part is easy....
>
> > I'd like to put that subroutine in a module so that I can use that
> > subroutine wherever I want to. I having problems with scoping - seems
> > the module subroutine sets the environment but then loses when control
> > is returned to the calling program.
>
> I can't reproduce the problem you describe.
>
> C:\home>type MyModules\ENVSet.pm
> package MyModules::ENVSet;
> $ENV{MYENVVAR}='Hello';
> 1;
>
> C:\home>type test.pl
> use MyModules::ENVSet;
> print "$ENV{MYENVVAR}\n";
>
> C:\home>test.pl
> Hello
>
> C:\home>
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl

I got the same results as you - with your code. My other code is still
screwy - more on this tomorrow...
pg


------------------------------

Date: Thu, 21 Feb 2008 09:02:14 +0100
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: setting %ENV in a module
Message-Id: <87ablud9fd.fsf@zeekat.nl>

pgodfrin <pgodfrin@gmail.com> writes:

> I'd like to put that subroutine in a module so that I can use that
> subroutine wherever I want to. I having problems with scoping - seems
> the module subroutine sets the environment but then loses when control
> is returned to the calling program. This part is hard.

I'm not sure if this applies to your problem, but tou may be unaware
that on most operating systems it's impossible to set the environment
for anything other than the "current process" (and any child processes
will then inherit the parent's environment).

In other words, if program A fork()s program B, and program B
changes its %ENV, program A will not see those changes. Neither will
program B see any changes in program A's environment made after B is
forked off.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


------------------------------

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 1295
***************************************


home help back first fref pref prev next nref lref last post