[28393] in Perl-Users-Digest
Perl-Users Digest, Issue: 9757 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 23 03:05:54 2006
Date: Sat, 23 Sep 2006 00:05:05 -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 Sat, 23 Sep 2006 Volume: 10 Number: 9757
Today's topics:
[ANNOUNCE] Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: Can't locate oject methoid Cells via package Ssprea <pamelapdh@aol.com>
Re: Can't locate oject methoid Cells via package Ssprea <pamelapdh@aol.com>
Re: Can't locate oject methoid Cells via package Ssprea (reading news)
Re: Can't locate oject methoid Cells via package Ssprea (reading news)
Re: differences between hashes and arrays ? <tadmc@augustmail.com>
Re: differences between hashes and arrays ? (Chris Mattern)
Re: differences between hashes and arrays ? <jurgenex@hotmail.com>
Re: differences between hashes and arrays ? <jurgenex@hotmail.com>
Re: differences between hashes and arrays ? <uri@stemsystems.com>
Re: differences between hashes and arrays ? <uri@stemsystems.com>
new CPAN modules on Sat Sep 23 2006 (Randal Schwartz)
passing multiple values into an argument as an array ? <jack_posemsky@yahoo.com>
Re: perl sort <tadmc@augustmail.com>
Re: perl sort (reading news)
Re: perl sort usenet@DavidFilmer.com
Re: perl sort <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Sep 2006 04:58:42 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: [ANNOUNCE] Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1158987457@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
Maintainer: Jari Aalto A T cante net
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Unix Windows port (for Unix die-hards):
install http://www.cygwin.com/ which includes native Emacs 21.x.
and XEmacs port
o Pure Native Windows port
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/ => Emacs resource page
Emacs Perl Modules
Cperl -- Perl programming mode
http://math.berkeley.edu/~ilya/software/emacs/
by Ilya Zakharevich
CPerl is major mode for editing perl files. Also included in
latest Emacs, but newest version is at Ilya's site. Note that
the directrory at CPAN is out of date:
http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
Compared to default `perl-mode' that comes with Emacs, this
one has more features.
TinyPerl -- Perl related utilities
http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Grep through all Perl manpages (.pod)
o Follow POD references e.g. [perlre] to next pod with RETURN
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o Update `$VERSION' variable with YYYY.MMDD on save.
o Load source code into Emacs, like Devel::DProf.pm
o Prepare script (version numbering) and Upload it to PAUSE
o Generate autoload STUBS (Devel::SelfStubber) for you
Perl Module (.pm)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in Tiny Tools Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up dattabases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to to do the search, You can adjust
recursive grep options, set search case sensitivity, add user grep
options etc.
You can find latest `igrep.el' module at
<http://groups.google.com/groups?group=gnu.emacs.sources> The
maintainer is Jefin Rodgers <kevinr@ihs.com>.
TinyCompile -- To Browse grep results in Emacs *compile* buffer
TinyCompile is a minor mode for *compile* buffer from where
you can collapse unwanted lines or shorten file URLs:
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: 22 Sep 2006 15:32:19 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Re: Can't locate oject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158964339.808181.210700@m7g2000cwm.googlegroups.com>
Jim Gibson wrote:
> In article <1158597175.798104.172770@m73g2000cwd.googlegroups.com>, Pam
> <pamelapdh@aol.com> wrote:
>
> > jmcnamara@cpan.org wrote:
> > > Pam wrote:
> > > > I get
> > > > Can't locate boject method Cells via package
> > > > Spreadsheet::WriteExcel::Worksheet
> > >
> > > That is because Cell() isn't a Spreadsheet::WriteExcel method it is a
> > > Spreadsheet::ParseExcel method.
> > >
> > > You are calling the wrong method on the wrong object.
> > >
> > > John.
> > > --
> >
> >
> > Yes, I was calling the wrong methond on the wrong object. I have
> > corrected that, I think the confussion because I am trying to write to
> > a file as well as read it. I have corrected that as well, but I am
> > still having problems getting the contents of the cell.
> > I no longer get the warning about not being able to locate object
> > method. I fixed that part.
>
> To increase the chances of getting help from the people who read this
> newsgroup, you should shorten your program to the smallest example that
> still shows your problem. You are not having any problems reading and
> parsing a CSV file, so leave that part out. Also, please do not start a
> new thread with a similar subject, but continue to respond in the old
> thread.
>
> [many irrelevant lines snipped]
>
> >
> > #Tring to check for empty cell
> > #This looks at Sheet1 in the workbook
> > my $Sheet = $Book->Worksheets(1);
> >
> >
> > for(my $row =1 ;
> > $row <= $total ; $row++) {
> >
> >
> >
> > printf "At ($row, $col) the value is %s and the formula is %s\n",
> > $Sheet->Cells($row,$col)->{'Value'},
> > $Sheet->Cells($row,$col)->{'Formula'};
>
> There are two methods for Worksheet:
>
> Cells[$row][$col]
> Cell($row,$col)
>
> You seem to be confusing them.
>
> --
> Jim Gibson
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com
------------------------------
Date: 22 Sep 2006 16:02:14 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Re: Can't locate oject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158966134.325579.60950@m7g2000cwm.googlegroups.com>
Hello
Regarding the last response I received from the group. I am aware that
there
are two ways to get the value of a cell, {Cells} [$row], [$col] This
one is used for Spreadsheet Module and Cell($row, $col) is used for
Win32:Ole Module
I am not having luck with either one in which I can get the data from a
cell.
I have looked at countless examples which are basically the same but
my code does not work '
I am able to create the sheet as you can see from the code below, I can
write to it and format it. When I open the spreadsheet the columns and
formating is there. I can't parse it to get the value I know
Spreadsheet::ParseExcel should work
I have seen examples were Cell($row, $col) where used on Spreadsheet
module but it does not work for me. Right now I am trying to use
{Cells} [$row] [$col]
I thought what I was trying to do would be simple but I just can't seem
to get it to work.
I only want to read from an existing worksheet to see if there is any
contents in a cell before I write to it.
use strict;
Spreadsheet::WriteExcel;
Spreadsheet::ParseExcel;
#This is the parser
my $oBook = new
Spreadsheet::ParseExcel::Workbook->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
$col = 11;
my $oWorksheet;
$oBook->{SheetCount} = 1;
my $sName= 'Sheet1';
my $ocell;
print "Is it getting the book", $oBook, "\n";
#Tring to check for empty cell
print "--------- SHEET:", $oBook->{Name}, "\n";
#print "Trying to get sheet name", $oWks, "\n";
for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++)
{
print "what is sheet", $iSheet, "\n"; Print out gives me 0
#I seem to be having a bit of a problem with this one. I am not sure
#if I am getting the worksheet. I tried using $Book->Worksheet(1) but
I gat
#complaint aqbout unblessed reference, so used the below code
$oWorksheet = $oBook->{Worksheet} [$iSheet];
for( $row = 1; $row <= $total; $row++) {
$ocell = $oWorksheet->{Cells}[$row][$col];
print "Row:$row Col:$col Value:", $ocell->{Val},"\n";
}
}
I get the correct number of rows so it has to reading my sheet.
Why can't I get the data ?
CAN ANYONE HELP ME PLEASE
Pamela
Jim Gibson wrote:
> In article <1158597175.798104.172770@m73g2000cwd.googlegroups.com>, Pam
> <pamelapdh@aol.com> wrote:
>
> > jmcnamara@cpan.org wrote:
> > > Pam wrote:
> > > > I get
> > > > Can't locate boject method Cells via package
> > > > Spreadsheet::WriteExcel::Worksheet
> > >
> > > That is because Cell() isn't a Spreadsheet::WriteExcel method it is a
> > > Spreadsheet::ParseExcel method.
> > >
> > > You are calling the wrong method on the wrong object.
> > >
> > > John.
> > > --
> >
> >
> > Yes, I was calling the wrong methond on the wrong object. I have
> > corrected that, I think the confussion because I am trying to write to
> > a file as well as read it. I have corrected that as well, but I am
> > still having problems getting the contents of the cell.
> > I no longer get the warning about not being able to locate object
> > method. I fixed that part.
>
> To increase the chances of getting help from the people who read this
> newsgroup, you should shorten your program to the smallest example that
> still shows your problem. You are not having any problems reading and
> parsing a CSV file, so leave that part out. Also, please do not start a
> new thread with a similar subject, but continue to respond in the old
> thread.
>
> [many irrelevant lines snipped]
>
> >
> > #Tring to check for empty cell
> > #This looks at Sheet1 in the workbook
> > my $Sheet = $Book->Worksheets(1);
> >
> >
> > for(my $row =1 ;
> > $row <= $total ; $row++) {
> >
> >
> >
> > printf "At ($row, $col) the value is %s and the formula is %s\n",
> > $Sheet->Cells($row,$col)->{'Value'},
> > $Sheet->Cells($row,$col)->{'Formula'};
>
> There are two methods for Worksheet:
>
> Cells[$row][$col]
> Cell($row,$col)
>
> You seem to be confusing them.
>
> --
> Jim Gibson
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com
------------------------------
Date: Sat, 23 Sep 2006 00:01:52 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Can't locate oject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <QP_Qg.4857$UG4.3285@newsread2.news.pas.earthlink.net>
On 09/22/2006 06:02 PM, Pam wrote:
> Hello
>
>
> Regarding the last response I received from the group. I am aware that
> there are two ways to get the value of a cell, [...]
In this forum, you should write your response _below_ the quoted
text--like I just did.
--
paduille.4058.mumia.w@earthlink.net
------------------------------
Date: Sat, 23 Sep 2006 00:01:53 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Can't locate oject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <RP_Qg.4858$UG4.1657@newsread2.news.pas.earthlink.net>
On 09/22/2006 06:02 PM, Pam wrote:
> Hello
>
Hello
>
> #I seem to be having a bit of a problem with this one. I am not sure
> #if I am getting the worksheet. I tried using $Book->Worksheet(1) but
> I gat
> #complaint aqbout unblessed reference, so used the below code
>
> $oWorksheet = $oBook->{Worksheet} [$iSheet];
> [...]
Use the Data::Dumper module to find out what is there. The junk produced
by SpreadSheet::ParseExecl->Parse is incredibly complicated, and you
need Data::Dumper to unravel it. Set $Data::Dumper::MaxDepth to a
reasonable value (?) before you dump the data.
HTH
--
paduille.4058.mumia.w@earthlink.net
------------------------------
Date: Fri, 22 Sep 2006 17:01:11 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: differences between hashes and arrays ?
Message-Id: <slrneh8n97.oho.tadmc@magna.augustmail.com>
Uri Guttman <uri@stemsystems.com> wrote:
> or he should learn more perl before asking such deep questions. :)
Maybe he is still learning it from that web page that you
critiqued in:
Message-ID: <x7ac8yu4wj.fsf@mail.sysarch.com>
:-(
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 23 Sep 2006 00:39:07 -0000
From: syscjm@sumire.eng.sun.com (Chris Mattern)
Subject: Re: differences between hashes and arrays ?
Message-Id: <12h90hbtm8be2d9@corp.supernews.com>
In article <x77izvabiw.fsf@mail.sysarch.com>, Uri Guttman wrote:
>
>hmm, in general arrays have faster lookups than hashes. me thinks you
>confused the OP's statement. and arrays definitely use less storage
>(even excluding the key itself) for each element.
>
That's true in most languages because in most languages arrays
are required to have all elements be the same type, making
looking up an element a simple matter of pointer arithmetic
(you see this in its most naked form in a higher-level language
in C, where arrays and pointers are the same thing, and array
lookups are defined in the language as pointer arithmetic.
This results in a lot of C's less cuddly quirks, but that's
another subject...). But in Perl, each element can be
entirely different and each element has its own size. There
are several different ways Perl can handle this problem; I
don't know Perl internals so I don't know how it does it.
But however it's done, it's going to take more cycles than
a simple homogenous array (and probably more space, too).
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Sat, 23 Sep 2006 02:59:50 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: differences between hashes and arrays ?
Message-Id: <Gq1Rg.73$Kw1.57@trnddc05>
Jack wrote:
> is it true you can use a hash and work with it just as you would an
> array - what are the differences between them (besides in an array you
> can have a multidimensional array) ?
Both are mappings. Arrays map from a contiguous list of natural numbers,
starting with 0 (assuming you didn't fool around with $[) into scalars.
Hashes are a generalization and map arbitrary strings to scalars.
> why arent folks using hashes instead of arrays since (I believe) they
> are faster to access and take up the same or less memory than arrays..
Very often you need organize your data in a sequence. This sequencing is
naturally achieved by the natural order of number when they are used as
domain of your mapping. For hashes it is possible to sort the keys of a
hash and then access the values in sequence, but this operation is much more
expensive.
jue
------------------------------
Date: Sat, 23 Sep 2006 03:04:01 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: differences between hashes and arrays ?
Message-Id: <Bu1Rg.619$Vk4.235@trnddc01>
Mirco Wahab wrote:
> An "array" means otherwise "access by an index number",
> so array elements must be searched in order to
> find a particular item.
Not really. To access the 23rd element of an array in a typical
implementation you would simply access
StartOfArray + 23 * SizeOfArrayElement
which is just adding a constant that is independant of the size of the
array. No need to search (which would be O(n log n)).
jue
------------------------------
Date: Fri, 22 Sep 2006 23:29:32 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: differences between hashes and arrays ?
Message-Id: <x7zmcr8dlv.fsf@mail.sysarch.com>
>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:
PL> Uri Guttman wrote:
>> >>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:
>>
>>
>> >> why arent folks using hashes instead of arrays since (I believe) they
>> >> are faster to access and take up the same or less memory than arrays..
>>
PL> Faster to access, yes. Same or less memory, no.
>>
>> hmm, in general arrays have faster lookups than hashes. me thinks you
>> confused the OP's statement.
PL> Or I confused my answer. :-) What I meant was that:
PL> my $there = $hash{$key} ? 1 : 0;
PL> is faster than:
PL> my $there = 0;
PL> for my $elem (@array) {
PL> if ($elem eq $value) {
PL> $there = 1;
PL> next;
PL> }
PL> }
well then, why didn't you say that!! string key lookup is a very diff
beast than element lookup. :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Fri, 22 Sep 2006 23:33:47 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: differences between hashes and arrays ?
Message-Id: <x7venf8des.fsf@mail.sysarch.com>
>>>>> "CM" == Chris Mattern <syscjm@sumire.eng.sun.com> writes:
CM> In article <x77izvabiw.fsf@mail.sysarch.com>, Uri Guttman wrote:
>>
>> hmm, in general arrays have faster lookups than hashes. me thinks you
>> confused the OP's statement. and arrays definitely use less storage
>> (even excluding the key itself) for each element.
>>
CM> That's true in most languages because in most languages arrays
CM> are required to have all elements be the same type, making
CM> looking up an element a simple matter of pointer arithmetic
CM> (you see this in its most naked form in a higher-level language
CM> in C, where arrays and pointers are the same thing, and array
CM> lookups are defined in the language as pointer arithmetic.
CM> This results in a lot of C's less cuddly quirks, but that's
CM> another subject...). But in Perl, each element can be
CM> entirely different and each element has its own size. There
CM> are several different ways Perl can handle this problem; I
CM> don't know Perl internals so I don't know how it does it.
CM> But however it's done, it's going to take more cycles than
CM> a simple homogenous array (and probably more space, too).
perl's arrays ARE homogeneous but at a different level than scalar
values. the SV's of an array are in a real c array and are indexed just
like you say. otherwise how would perl lookup an array element? do you
think it scans the array in some linked list format for the nth element?
but my quoted statement is still true - perl arrays are faster and use
less ram than hashes. this is easily tested with benchmark.pm and
the devel::size (iirc the name correctly) module that shows ram
usage. so you don't need to know perl internals to learn about array vs
hash resource usage.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sat, 23 Sep 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Sep 23 2006
Message-Id: <J613q9.D8z@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.
Album-1.03
http://search.cpan.org/~jv/Album-1.03/
Create and maintain browser based photo albums
----
CPAN-1.8801
http://search.cpan.org/~andk/CPAN-1.8801/
query, download and build perl modules from CPAN sites
----
CPAN-Reporter-0.19
http://search.cpan.org/~dagolden/CPAN-Reporter-0.19/
Provides Test::Reporter support for CPAN.pm
----
DBIx-Fun-0.01
http://search.cpan.org/~tobeya/DBIx-Fun-0.01/
access database stored procedures as methods
----
DBIx-Web-0.63
http://search.cpan.org/~makarow/DBIx-Web-0.63/
Active Web Database Layer
----
Daizu-0.1
http://search.cpan.org/~geoffr/Daizu-0.1/
class for accessing Daizu CMS from Perl
----
Devel-Timer-0.03
http://search.cpan.org/~szabgab/Devel-Timer-0.03/
Track and report execution time for parts of code
----
EasyDBAccess-3.0.8
http://search.cpan.org/~foolfish/EasyDBAccess-3.0.8/
Perl Database Access Interface
----
File-Rotate-Backup-0.10
http://search.cpan.org/~dowens/File-Rotate-Backup-0.10/
Make backups of multiple directories and rotate them on unix.
----
Gantry-3.40
http://search.cpan.org/~philcrow/Gantry-3.40/
Web application framework for mod_perl, cgi, etc.
----
HTML-Prototype-1.48
http://search.cpan.org/~esskar/HTML-Prototype-1.48/
Generate HTML and Javascript for the Prototype library
----
Mail-Karmasphere-Client-2.01
http://search.cpan.org/~shevek/Mail-Karmasphere-Client-2.01/
Client for Karmasphere Reputation Server
----
Mail-Karmasphere-Client-2.02
http://search.cpan.org/~shevek/Mail-Karmasphere-Client-2.02/
Client for Karmasphere Reputation Server
----
Mail-Salsa-0.09
http://search.cpan.org/~hdias/Mail-Salsa-0.09/
An easy to use perl mailing list manager module.
----
Module-Build-Convert-0.33
http://search.cpan.org/~schubiger/Module-Build-Convert-0.33/
Makefile.PL to Build.PL converter
----
Net-DRI-0.40
http://search.cpan.org/~pmevzek/Net-DRI-0.40/
Interface to Domain Name Registries/Registrars/Resellers
----
Net-SFTP-Foreign-0.90_13
http://search.cpan.org/~salva/Net-SFTP-Foreign-0.90_13/
Secure File Transfer Protocol client
----
Net-sFlow-0.03X
http://search.cpan.org/~elisa/Net-sFlow-0.03X/
decode sFlow datagrams.
----
Net-sFlow-0.04X
http://search.cpan.org/~elisa/Net-sFlow-0.04X/
decode sFlow datagrams.
----
OOPS-0.1007
http://search.cpan.org/~muir/OOPS-0.1007/
Object Oriented Persistent Store
----
Pipe-0.03
http://search.cpan.org/~szabgab/Pipe-0.03/
Framework to create pipes using iterators
----
RPM-Util-Files-0.10
http://search.cpan.org/~zigorou/RPM-Util-Files-0.10/
Generate %files list in RPM Specfile
----
SAP-Rfc-1.51
http://search.cpan.org/~piers/SAP-Rfc-1.51/
SAP RFC - RFC Function calls against an SAP R/3 System
----
TAPx-Parser-0.32
http://search.cpan.org/~ovid/TAPx-Parser-0.32/
Parse TAP output
----
TAPx-Parser-0.33
http://search.cpan.org/~ovid/TAPx-Parser-0.33/
Parse TAP output
----
TM-1.17
http://search.cpan.org/~drrho/TM-1.17/
Topic Maps, Base Class
----
Template-Magic-1.39
http://search.cpan.org/~domizio/Template-Magic-1.39/
Magic merger of runtime values with templates
----
XML-Compile-0.08
http://search.cpan.org/~markov/XML-Compile-0.08/
Compilation based XML processing
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: 22 Sep 2006 20:43:51 -0700
From: "Jack" <jack_posemsky@yahoo.com>
Subject: passing multiple values into an argument as an array ?
Message-Id: <1158983031.194854.61860@d34g2000cwd.googlegroups.com>
hi folks,
I am reading in arguments just fine using the code below, but I want to
be able to add a variable number of values into an argument into perl -
I want to be able to say
perl -f value1 value2 ..valueN -v value value2 ..valueN
and store the values of -f in a single array, and -v also (and the
number of passed values could vary !)
If anyone has any tips that would be great - Thanks, Jack
if (@ARGV[0] eq undef) {
$value1=@ARGV[0];
}
if (@ARGV[1] eq undef) {
$value2=@ARGV[1];
------------------------------
Date: Fri, 22 Sep 2006 17:21:06 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl sort
Message-Id: <slrneh8oeh.oho.tadmc@magna.augustmail.com>
Jan Burdil <honza@burdil.cz> wrote:
> when I try
> perl -e 'print join "\n", sort { -M $b <=> -M $a } <*>,"\n"'
> my files are sorted by date.
That is because $a and $b contain filenames.
> And I need to sort lines from curl command.
> curl ftp://1.1.1.1 give me
> -rw-r--r-- 1 honza users 414 Sep 22 12:16 curl.txt
> -rwx------ 1 honza users 52 May 31 21:54 bb
> drwx------ 2 honza users 512 Aug 22 10:54 mail
>
> And I would like the result to be sorted by date.
>
> I try replace <*> with command curl ftp://1.1.1.1
You can't just make stuff up and expect it to work (usually).
You need to understand the code before you can modify that code.
> like this
> perl -e 'print join "\n", sort { -M $b <=> -M $a } `curl
> ftp://1.1.1.1`,"\n"'
Now $a and $b do not contain filenames.
> but this doesn't work
So that is the expected result.
You need to arrange for $a and $b to contain filenames, which
will make your program too cumbersome to be a one-liner.
There are several FAQs about sorting. You should read them.
[snip TOFU. Learn to quote followups properly. ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 22 Sep 2006 23:38:19 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: perl sort
Message-Id: <Lt_Qg.1102$o71.476@newsread3.news.pas.earthlink.net>
On 09/22/2006 03:24 PM, Jan Burdil wrote:
> when I try
> perl -e 'print join "\n", sort { -M $b <=> -M $a } <*>,"\n"'
> bb
> xx
> aa
> Mail
> mail
> yy
> unrar
> tmp
> curl.txt
> abc
>
> my files are sorted by date. And I need to sort lines from curl command.
> curl ftp://1.1.1.1 give me
> -rw-r--r-- 1 honza users 414 Sep 22 12:16 curl.txt
> -rwx------ 1 honza users 52 May 31 21:54 bb
> drwx------ 2 honza users 512 Aug 22 10:54 mail
>
> And I would like the result to be sorted by date.
>
> I try replace <*> with command curl ftp://1.1.1.1 like this
> perl -e 'print join "\n", sort { -M $b <=> -M $a } `curl
> ftp://1.1.1.1`,"\n"'
> but this doesn't work
>
> Jan Burdil
>
>
If you are invoking the 'curl' command and getting back text, then
you'll have to extract the portions of text that represent the date,
convert those dates into a sortable form, and sort them.
--
paduille.4058.mumia.w@earthlink.net
------------------------------
Date: 22 Sep 2006 16:53:17 -0700
From: usenet@DavidFilmer.com
Subject: Re: perl sort
Message-Id: <1158969197.100768.214850@h48g2000cwc.googlegroups.com>
Jan Burdil wrote:
> my files are sorted by date. And I need to sort lines from curl command.
> curl ftp://1.1.1.1 give me
Somtimes the shell way is the easier way. for example:
ls -l |sort -k 1.37
(see also the -t flag of sort)
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Sat, 23 Sep 2006 08:40:11 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: perl sort
Message-Id: <slrneh9lmb.d1.hjp-usenet2@yoyo.hjp.at>
On 2006-09-22 22:21, Tad McClellan <tadmc@augustmail.com> wrote:
> Jan Burdil <honza@burdil.cz> wrote:
>> And I need to sort lines from curl command.
>> curl ftp://1.1.1.1 give me
>> -rw-r--r-- 1 honza users 414 Sep 22 12:16 curl.txt
>> -rwx------ 1 honza users 52 May 31 21:54 bb
>> drwx------ 2 honza users 512 Aug 22 10:54 mail
>>
>> And I would like the result to be sorted by date.
[...]
>> like this
>> perl -e 'print join "\n", sort { -M $b <=> -M $a } `curl
>> ftp://1.1.1.1`,"\n"'
[...]
>
> You need to arrange for $a and $b to contain filenames,
How would this help? He needs to sort lines which contain a text
representation of a date by this date. -M doesn't do that, so he
shouldn't use -M but extract the date from each line and convert it to a
comparable value (e.g., seconds since the epoch, or yyyy-mm-ddThh:mm).
HTTP::Date may be helpful.
Another way might be to ditch curl in favour of Net::FTP. I haven't
looked at it, but I expect it to contain a function to parse directory
listings from FTP servers.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
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 9757
***************************************