[29563] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 807 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 09:09:42 2007

Date: Thu, 30 Aug 2007 06:09:06 -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           Thu, 30 Aug 2007     Volume: 11 Number: 807

Today's topics:
    Re: 2D array of real numbers <stoupa@practisoft.cz>
    Re: 2D array of real numbers <dummy@example.com>
    Re: 2D array of real numbers <tadmc@seesig.invalid>
    Re: Appending a character to a field <dummy@example.com>
    Re: Exe and module download questions <rprp@gmx.net>
    Re: Exe and module download questions <edgrsprj@ix.netcom.com>
        Important Research Project <edgrsprj@ix.netcom.com>
    Re: Mac: Perl script that will run when double-clicked  amirkarger@gmail.com
        new CPAN modules on Thu Aug 30 2007 (Randal Schwartz)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 30 Aug 2007 02:54:58 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: 2D array of real numbers
Message-Id: <fb5500$2ii0$1@ns.felk.cvut.cz>

jeanluc wrote:
> I want to create a 2D array whose values initially contains 0.0
>
>> From "http://www.xav.com/perl/lib/Pod/perllol.html"
>
> I see that the following code will set up a 3x2 2D array:
>
> @2D_array = (
>                    [0.0, 0.0, 0.0],
>                    [0.0, 0.0, 0.0],
>                    );
>
> The above works fine but unfortunately I might have to make some large
> arrays of arbitrary size. Doing it manually like above is not
> possible.
>
> I want to use the variables
>
> $no_rows = 50;
> $no_columns = 63;
>

my $no_rows = 50;
my $no_columns = 63;
my @row=(0.0)x$no_columns;
my @array=([@row])x$no_rows;

But you must address element as $array[row]->[col] instead of 
$array[row][col].
-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)





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

Date: Thu, 30 Aug 2007 01:20:37 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: 2D array of real numbers
Message-Id: <FXoBi.2491$bO6.338@edtnps89>

Petr Vileta wrote:
> jeanluc wrote:
>> I want to create a 2D array whose values initially contains 0.0
>>
>>> From "http://www.xav.com/perl/lib/Pod/perllol.html"
>>
>> I see that the following code will set up a 3x2 2D array:
>>
>> @2D_array = (
>>                    [0.0, 0.0, 0.0],
>>                    [0.0, 0.0, 0.0],
>>                    );
>>
>> The above works fine but unfortunately I might have to make some large
>> arrays of arbitrary size. Doing it manually like above is not
>> possible.
>>
>> I want to use the variables
>>
>> $no_rows = 50;
>> $no_columns = 63;
> 
> my $no_rows = 50;
> my $no_columns = 63;
> my @row=(0.0)x$no_columns;
> my @array=([@row])x$no_rows;

You are making $no_rows copies of the *same* anonymous array so any change to 
$array[0] will also show up in $array[1] and $array[2] and $array[3] and etc.


> But you must address element as $array[row]->[col] instead of 
> $array[row][col].

Because you said so?  I don't think so.



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Thu, 30 Aug 2007 10:50:23 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: 2D array of real numbers
Message-Id: <slrnfdcbf0.mkg.tadmc@tadmc30.sbcglobal.net>

Petr Vileta <stoupa@practisoft.cz> wrote:

> But you must address element as $array[row]->[col] instead of 
> $array[row][col].


No you don't.

Both forms are equivalent.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Thu, 30 Aug 2007 01:22:53 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: Appending a character to a field
Message-Id: <NZoBi.2493$bO6.2464@edtnps89>

Ben Morrow wrote:
> Quoth "Jürgen Exner" <jurgenex@hotmail.com>:
>> bokjasong@gmail.com wrote:
>>> Let's say I have the following code. Trying to check the disk space,
>>> it's to truncate the percent sign % from the df -k output, compare the
>>> percentage field to see if it's bigger than 90%, and grasp only those
>>> lines that are and push those to an array @df. But how can I add the
>>> percentage sign back to the percentage field on each line for the
>>> proper output? I put down ??????? as below to find out what regexp
>>> needs to be there in the below.
>> Just plain ignore the % sign. When evaluating a text in numerical context 
>> then Perl will take any leading number as the value and happily ignore any 
>> trailing non-numbers (somewhat simplified, but shouldn't matter in your 
>> case).
> 
> This ignores the fact that Perl will warn if a string has trailing
> non-numeric characters. This warning can be suppressed for a block with
> 
>     no warnings 'numeric';
> 
>>> $percent=90;
>>> open(DFOUT, "/usr/bin/df -k|");
> 
> You should always check the return value of open.
> You should probably use lexical filehandles.
> You should probably use 3-arg open, as its safer.
> 
>     open(my $DFOUT, '-|', '/usr/bin/df', '-k')
>         or die "cannot run df: $!";

And with a piped open you should also check the return value of close:

perldoc -f close



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Thu, 30 Aug 2007 09:24:14 +0200
From: Reinhard Pagitsch <rprp@gmx.net>
Subject: Re: Exe and module download questions
Message-Id: <46d6709f$0$90274$14726298@news.sunsite.dk>

E.D.G. wrote:
> "Reinhard Pagitsch" <rprp@gmx.net> wrote in message
> news:46d53dfc$0$90268$14726298@news.sunsite.dk...
>> E.D.G. wrote:
>> > Questions related to the downloadable ActiveState version of Perl.
>=20
> When the PAR tar.gz file was decompressed it created a directory called=

> Par-0.976 which contains a number of files, directories such as inc, li=
b,
> and t, and subdirectories. The lib directory contains a Par directory a=
nd a
> Par.pm file.
>=20
> What is the next step for merging Par with perl?

read the README which is included in the Par-0.976 directory. There are=20
all necessary informations about the build and install.

Here an extract from the http://par.perl.org page:
Note: Contrary to popular belief, you do not need a C compiler on=20
Windows to install PAR =96 just follow the "Download" link, extract it to=
=20
some temporary directory, and install it like any other perl module by=20
following README's instructions. An  incomplete compatibility list=20
between PAR binary releases and Win32 Perl versions can be found  here.


>=20
> I am using ActiveState 5.8.8 which contains ppm.  But that program appe=
ars
> to install only ppd files.

Yes it can only install ppm packages. But there are some ppm=20
repositories where you can find a lot of ppm packages ready to install=20
with ppm.
http://cpan.uwinnipeg.ca/htdocs/faqs/cpan-search.html
http://win32.perl.org/wiki/index.php?title=3DMain_Page (# 3.2 Modules and=
=20
Repositories)
http://www.bribes.org/perl/ppmdir.html

regards,
Reinhard

>=20


--=20



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

Date: Thu, 30 Aug 2007 04:14:06 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Exe and module download questions
Message-Id: <13dd2hfg0lagtb1@corp.supernews.com>

"Reinhard Pagitsch" <rprp@gmx.net> wrote in message
news:46d6709f$0$90274$14726298@news.sunsite.dk...

Thanks again.  I did actually find a copy of Par that I was able to link
with Perl by using ppm.  And I am planning to post another note discussing
what the main goal is here.  Basically, it is to get Perl to create charts
and standalone .exe versions of an existing Perl program which can be used
by scientific researchers around the world.




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

Date: Thu, 30 Aug 2007 07:12:17 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Important Research Project
Message-Id: <13ddcvm1bsu3s94@corp.supernews.com>

Important Research Project  (Related to computer programming)

Posted by E.D.G. on August 30, 2007 edgrsprj@ix.netcom.com

    This report is being posted to a number of Internet Newsgroups to see if
there are any experienced computer programmers who would like to provide
some assistance with an effort to develop a Perl language computer program.

    Interested parties can try contacting me by e-mail or by posting a
response note to the comp.lang.perl.misc newsgroup.  They would need to
download a recent (free) MSI copy of Perl from the ActiveState Web site and
get it running on a Windows XP or Vista system.

http://www.activestate.com

    I am presently using Perl 5.8.8 but plan to upgrade to the latest
version as soon as possible.  People can use Windows 98 if that is the only
operating system available.  Perl also runs on other operating systems.  But
at this time I specifically need help with the Windows version.

    The goal is to have a single Perl program (or modules) perform functions
that have been done by a sizeable collection of other language programs in
the past.

    Help is presently needed with learning how to get Perl to generate
charts and also produce standalone .exe copies of itself.  The plan is to
then make those .exe copies available to other scientific researchers around
the world for free use along with free use updates when they become
available.  If other researchers wish to get Perl running on their own
computers then they will probably also be given the source code for the
original program for free use so that they can do their own development
work.

    Perl was originally chosen because it is quite versatile, is a free
download, and is supported both by ActiveState and quite a few independent
programmers.  So other researchers could get their own versions running
without having to worry about viruses or cost.

    So far the work is fairly advanced.  The effort has been underway for at
least a decade.  The core data generation program was formally copyrighted
several years ago.  My present version of Perl will send data to Windows as
if it were being manually typed into the keyboard (important for controlling
other programs).  And it can directed to respond to most keystrokes even
when another program is the active one.  Unfortunately, Windows also
presently responds to those keystrokes.  And that complicates things a bit.

    Not being a professional computer programmer I have been finding it
difficult to get new features such as a chart generating ability merged with
and running with Perl.  And the entire research project is now being slowed
as a result.  One of my colleagues has done an extensive amount of work with
Basic.  And I even offered to pay him to help with the Perl development
effort.  But after he downloaded a copy of Perl and examined it he decided
that this would involve too much effort.  I have to agree with him.

    Once it is possible to create charts and .exe versions the plan is for
researchers around the world to develop Perl modules for generating a
variety of data related to sun, moon, planet, ocean tide crest and trough,
and Solid Earth Tide locations.  Most of those data can already be generated
with other programs.  Some of the data are not yet available anywhere as far
as I am aware.  If the effort is unusually successful the Perl program (or
modules) might eventually be converted to CGI programs that will run at one
or more Internet Web sites.





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

Date: Thu, 30 Aug 2007 01:57:26 -0000
From:  amirkarger@gmail.com
Subject: Re: Mac: Perl script that will run when double-clicked
Message-Id: <1188439046.020699.36070@r34g2000hsd.googlegroups.com>

On Aug 29, 5:54 pm, Anno Siegel <anno4...@mailbox.zrz.tu-berlin.de>
wrote:
> On 2007-08-29 06:17:58 +0200, amirkar...@gmail.com said:
>
> > On Aug 22, 1:28 pm, amirkar...@gmail.com wrote:
> > 1) You need to chmod +x the script, or it won't run. Which sort of
> > defeats the purpose of creating adouble-clickable program, doesn't
> > it?
>
> How so?  What do you consider the purpose of making a perl script clickable?
>
> Anno

Good point.

The idea here is that I'm going to have downloadable files that the
user saves to their disk so they can click on it & run without ever
needing to open a Terminal themselves or type stuff on a command
line.

In case you're wondering about the purpose, I have a site called the
Scriptome which provides simple data munging tools for non-programming
biologists. To make things as super-simple as possible (no install or
config necessary), we originally set it up to have Perl one-liners you
cut & paste onto a command line, but people kept telling us that non-
programmers are afraid of the command line. I worked out a way to
make .pl's do the right thing when clicked on Windows, but wasn't sure
how we could handle it on Mac. If I actually knew how to build Mac
apps easily, I could do this in a fancier way (volunteers welcomed!).
But I'm really aiming for this stuff to just work; prettiness, bells &
whistles are optional. (Sorry for the plug, but you asked!)

-Amir



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

Date: Thu, 30 Aug 2007 04:42:13 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Aug 30 2007
Message-Id: <JnKL2D.HHx@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.

Autodia-2.04
http://search.cpan.org/~teejay/Autodia-2.04/
The configuration and Utility perl module for AutoDia. 
----
Bricklayer-Templater-0.9.6
http://search.cpan.org/~zaphar/Bricklayer-Templater-0.9.6/
yet another templating system. Pure perl, highly flexible with very few dependencies. 
----
Business-PayPal-API-0.51
http://search.cpan.org/~scottw/Business-PayPal-API-0.51/
PayPal API 
----
Catalyst-Action-RenderView-0.06
http://search.cpan.org/~mramberg/Catalyst-Action-RenderView-0.06/
Sensible default end action. 
----
Catalyst-View-JSON-0.20
http://search.cpan.org/~miyagawa/Catalyst-View-JSON-0.20/
JSON view for your data 
----
Config-Grammar-1.03
http://search.cpan.org/~dschwei/Config-Grammar-1.03/
A grammar-based, user-friendly config parser 
----
Convert-IBM390-0.23
http://search.cpan.org/~grommel/Convert-IBM390-0.23/
functions for manipulating mainframe data 
----
Data-Path-1.1
http://search.cpan.org/~zaphar/Data-Path-1.1/
Perl extension for XPath like accessing from complex data structs 
----
Data-Tabulator-0.03
http://search.cpan.org/~rkrimen/Data-Tabulator-0.03/
Create a table (two-dimensional array) from a list (one-dimensional array) 
----
DateTime-Format-Natural-0.38
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.38/
Create machine readable date/time with natural parsing logic 
----
Devel-Leak-Object-0.90
http://search.cpan.org/~adamk/Devel-Leak-Object-0.90/
Detect leaks of objects 
----
JavaScript-Writer-0.0.4
http://search.cpan.org/~gugod/JavaScript-Writer-0.0.4/
JavaScript code generation from Perl. 
----
Mail-Postini-0.14
http://search.cpan.org/~scottw/Mail-Postini-0.14/
Perl extension for talking to Postini 
----
Maypole-2.121
http://search.cpan.org/~teejay/Maypole-2.121/
MVC web application framework 
----
MojoMojo-0.999001
http://search.cpan.org/~mramberg/MojoMojo-0.999001/
not your daddy`s wiki. 
----
Net-Social-0.1
http://search.cpan.org/~simonw/Net-Social-0.1/
abstracted interface for social networks 
----
Net-Social-Service-Facebook-0.1
http://search.cpan.org/~simonw/Net-Social-Service-Facebook-0.1/
a Facebook plugin for Net::Social 
----
RT-Extension-TicketAging-0.10
http://search.cpan.org/~ruz/RT-Extension-TicketAging-0.10/
----
Regexp-Exhaustive-0.02
http://search.cpan.org/~lodin/Regexp-Exhaustive-0.02/
Find all possible matches, including backtracked and overlapping, of a pattern against a string 
----
SMS-Send-DE-MeinBMW-0.04
http://search.cpan.org/~borisz/SMS-Send-DE-MeinBMW-0.04/
An SMS::Send driver for the www.meinbmw.de website 
----
Template-Plugin-DtFormatter-RelativeDate-0.03
http://search.cpan.org/~bokutin/Template-Plugin-DtFormatter-RelativeDate-0.03/
return finder like relative date. 
----
Template-Plugin-Filter-VisualTruncate-0.03
http://search.cpan.org/~bokutin/Template-Plugin-Filter-VisualTruncate-0.03/
Filter Plugin for trimming text by the number of the columns of terminals and mobile phones. 
----
WWW-YouTube-VideoURI-0.1
http://search.cpan.org/~gbrown/WWW-YouTube-VideoURI-0.1/
a module to determine the URI of a Flash Video file on YouTube.com 
----
WebService-Google-Suggest-0.02
http://search.cpan.org/~miyagawa/WebService-Google-Suggest-0.02/
Google Suggest as an API 
----
Win32-SysTray-0.10
http://search.cpan.org/~mahnkong/Win32-SysTray-0.10/
----
XML-Trivial-0.01
http://search.cpan.org/~pajout/XML-Trivial-0.01/
The trivial tool representing parsed XML as tree of read only objects. 


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: 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 807
**************************************


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