[28492] in Perl-Users-Digest
Perl-Users Digest, Issue: 9856 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 17 03:05:56 2006
Date: Tue, 17 Oct 2006 00:05: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 Tue, 17 Oct 2006 Volume: 10 Number: 9856
Today's topics:
[ANNOUNCE] Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: alarm() - SIGALRM sent too eariy? anno4000@radom.zrz.tu-berlin.de
anyone try cgi builder ? is it legit? <bootiack@yahoo.com>
Re: I have no problems eating cereal...after it softens <tadmc@augustmail.com>
Re: I have no problems eating cereal...after it softens <glennj@ncf.ca>
Re: I have no problems eating cereal...after it softens <sbryce@scottbryce.com>
new CPAN modules on Tue Oct 17 2006 (Randal Schwartz)
remote commands on unix from win :( <hpbenton@scripps.edu>
Re: remote commands on unix from win :( usenet@DavidFilmer.com
Re: sending ctrl+C to pipe process <gweissenseel@yahoo.com>
Silencing TODO output from Test::Harness output <andrew.ho@gmail.com>
Re: size of directories? <bik.mido@tiscalinet.it>
Re: Undefined subroutine &main::1 called perl script <glennj@ncf.ca>
Re: use of next versus last in a nested loop algorithm <mark.leeds@morganstanley.com>
Re: use of next versus last in a nested loop algorithm <mark.leeds@morganstanley.com>
Re: use of next versus last in a nested loop algorithm <sbryce@scottbryce.com>
Using Schedule::Cron super.sumanth@gmail.com
what happened to pas? perl application server? <bootiack@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Oct 2006 04:25:59 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: [ANNOUNCE] Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1161059116@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: 16 Oct 2006 22:52:14 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: alarm() - SIGALRM sent too eariy?
Message-Id: <4pigouFiv3e4U1@news.dfncis.de>
<anno4000@radom.zrz.tu-berlin.de> wrote in comp.lang.perl.misc:
> Peter J. Holzer <hjp-usenet2@hjp.at> wrote in comp.lang.perl.misc:
> > On 2006-10-15 20:48, anno4000@radom.zrz.tu-berlin.de
> > <anno4000@radom.zrz.tu-berlin.de> wrote:
> > I've seen the bug with Time::HiRes 1.59 and 1.86, so I'd be surprised if
> > it wasn't present in any version between them. It might be
> > platform-specific, though: I have tested it only on Linux/i386, and I
> > haven't looked at the source code yet.
>
> Okay, I'll check again when I have a few hours :)
Right, the bug is still in bleadperl (5.9.4). It ought to be reported.
Anyone?
Anno
------------------------------
Date: 17 Oct 2006 00:00:12 -0700
From: "gavino" <bootiack@yahoo.com>
Subject: anyone try cgi builder ? is it legit?
Message-Id: <1161068412.582802.324830@h48g2000cwc.googlegroups.com>
It seems like a dream come true but Im not sure.
------------------------------
Date: Mon, 16 Oct 2006 15:59:27 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <slrnej7slf.cip.tadmc@magna.augustmail.com>
samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:
> In other words - don't you guys go away!!!
You had better learn to quote followups in the appropriate way then.
[ snip TOFU ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Oct 2006 23:51:34 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <slrnej86o6.3c3.glennj@smeagol.ncf.ca>
At 2006-10-16 03:50PM, "samiam@mytrashmail.com" wrote:
> Well...I don't know him very well at all and I tend to keep a stiff
> upper lip at work. I prefer to forge my way outside of work, bring
> value to the workplace...and if someone is amenable at work to helping
> me...fine....but work is the last place where I want to voice my
> experimental opinions on code. hope you can relate to that
> sensitivity.
I've always believed the only stupid questions are the ones you don't
ask. Don't you think you could bring more value if you were to use the
resources available to you and ask questions right away so you could
become productive right away?
--
Glenn Jackman
Ulterior Designer
------------------------------
Date: Mon, 16 Oct 2006 18:28:51 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <GqqdnY10wIRfvqnYnZ2dnUVZ_rOdnZ2d@comcast.com>
Tad McClellan wrote:
> samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:
>> And, respectfully, it's easier for me and friends
>
> That is fine by me, as I have now taken the appropriate action.
What Tad means is that since you have decided not to follow the usual
usenet conventions, he has decided not to read your posts.
You need to decide how many people you are willing to alienate here.
------------------------------
Date: Tue, 17 Oct 2006 04:42:05 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Oct 17 2006
Message-Id: <J79Jq5.13rC@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.
Acme-BloodType-0.01
http://search.cpan.org/~arodland/Acme-BloodType-0.01/
For those obsessed with celebrities' blood types
----
Acme-Greek-1.0
http://search.cpan.org/~jrockway/Acme-Greek-1.0/
??'? ??? ????? ?? ??!
----
Acme-MetaSyntactic-0.96
http://search.cpan.org/~book/Acme-MetaSyntactic-0.96/
Themed metasyntactic variables names
----
Acme-MorningMusume-ShinMember-0.01
http://search.cpan.org/~jrockway/Acme-MorningMusume-ShinMember-0.01/
Create random Morning Musume!
----
BerkeleyDB-0.31
http://search.cpan.org/~pmqs/BerkeleyDB-0.31/
Perl extension for Berkeley DB version 2, 3 or 4
----
CGI-Form2XML-1.4
http://search.cpan.org/~jstowe/CGI-Form2XML-1.4/
Render CGI form input as XML
----
CPAN-1.88_55
http://search.cpan.org/~andk/CPAN-1.88_55/
query, download and build perl modules from CPAN sites
----
Calendar-Simple-1.17
http://search.cpan.org/~davecross/Calendar-Simple-1.17/
Perl extension to create simple calendars
----
Config-DotNetXML-1.5
http://search.cpan.org/~jstowe/Config-DotNetXML-1.5/
Get config in the manner of .NET Framework
----
Crypt-CBC-2.21
http://search.cpan.org/~lds/Crypt-CBC-2.21/
Encrypt Data with Cipher Block Chaining Mode
----
Crypt-Util-0.01_02
http://search.cpan.org/~nuffin/Crypt-Util-0.01_02/
A lightweight Crypt/Digest convenience API
----
DBD-mysql-3.0008
http://search.cpan.org/~capttofu/DBD-mysql-3.0008/
MySQL driver for the Perl5 Database Interface (DBI)
----
DBD-mysql-3.0008_1
http://search.cpan.org/~capttofu/DBD-mysql-3.0008_1/
MySQL driver for the Perl5 Database Interface (DBI)
----
Deco-0.11
http://search.cpan.org/~narked/Deco-0.11/
Module for simulating body tissue during a scuba dive
----
EekBoek-1.01.02
http://search.cpan.org/~jv/EekBoek-1.01.02/
Bookkeeping software for small and medium-size businesses
----
File-Find-Rule-Perl-0.03
http://search.cpan.org/~adamk/File-Find-Rule-Perl-0.03/
Common rules for searching for Perl things
----
File-Tabular-0.70
http://search.cpan.org/~dami/File-Tabular-0.70/
searching and editing flat tabular files
----
GConf-FS-0.02
http://search.cpan.org/~lsim/GConf-FS-0.02/
----
IO-All-0.36
http://search.cpan.org/~ingy/IO-All-0.36/
IO::All of it to Graham and Damian!
----
IPC-PerlSSH-0.02
http://search.cpan.org/~pevans/IPC-PerlSSH-0.02/
a class for executing remote perl code over an SSH link
----
Linux-Fuser-1.4
http://search.cpan.org/~jstowe/Linux-Fuser-1.4/
Determine which processes have a file open
----
Module-Compile-0.19
http://search.cpan.org/~ingy/Module-Compile-0.19/
Perl Module Compilation
----
Module-ThirdParty-0.18
http://search.cpan.org/~saper/Module-ThirdParty-0.18/
Provide information for 3rd party modules (outside CPAN)
----
Secret-Simple-0.10
http://search.cpan.org/~agf/Secret-Simple-0.10/
Secure secrets in configurations and code
----
Secret-Simple-0.11
http://search.cpan.org/~agf/Secret-Simple-0.11/
Secure secrets in configurations and code
----
Tcl-Tk-0.91
http://search.cpan.org/~vkon/Tcl-Tk-0.91/
Extension module for Perl giving access to Tk via the Tcl extension
----
URPM-1.47
http://search.cpan.org/~rgarcia/URPM-1.47/
Manipulate RPM files and headers
----
WWW-Patent-Page-0.07
http://search.cpan.org/~anonwb/WWW-Patent-Page-0.07/
get a patent page or document (e.g. htm, pdf, tif) from selected source (e.g. from United States Patent and Trademark Office (USPTO) website or the European Patent Office (ESPACE_EP). and place into a
----
WordNet-QueryData-1.44
http://search.cpan.org/~jrennie/WordNet-QueryData-1.44/
direct perl interface to WordNet database
----
WordNet-QueryData-1.45
http://search.cpan.org/~jrennie/WordNet-QueryData-1.45/
direct perl interface to WordNet database
----
XML-XPathEngine-0.05
http://search.cpan.org/~mirod/XML-XPathEngine-0.05/
a re-usable XPath engine for DOM-like trees
----
lib-restrict-0.0.3
http://search.cpan.org/~dmuey/lib-restrict-0.0.3/
Perl extension for restricting what goes into @INC
----
tidyview-1.09
http://search.cpan.org/~leif/tidyview-1.09/
a previewer for the effects of perltidy's plethora of options
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: 16 Oct 2006 20:26:11 -0700
From: "PB0711" <hpbenton@scripps.edu>
Subject: remote commands on unix from win :(
Message-Id: <1161055571.826454.318890@b28g2000cwb.googlegroups.com>
hi,
I need a suggestion for a good way to ask a unix server to run a
program for me, however I have to do this from a windows machine over
the network. I was planning on useing Net::SSH::Perl till I found out
that activestate :( doesn't suppost the library.
Thanks,
------------------------------
Date: 16 Oct 2006 22:57:45 -0700
From: usenet@DavidFilmer.com
Subject: Re: remote commands on unix from win :(
Message-Id: <1161064665.378521.167040@i42g2000cwa.googlegroups.com>
PB0711 wrote:
> I was planning on useing Net::SSH::Perl till I found out
> that activestate :( doesn't suppost the library.
Net::Rexec and Net::Rsh seem to be available (if you don't mind a
non-secure transport).
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: 16 Oct 2006 19:58:18 -0700
From: "linbox" <gweissenseel@yahoo.com>
Subject: Re: sending ctrl+C to pipe process
Message-Id: <1161053898.922367.141770@e3g2000cwe.googlegroups.com>
Joe
thanks, your post helped me a lot. Doing the command "pstree; ps axj |
egrep 'PPID|rec|sox'" gave me the info I needed. I still don't know how
to stop sox when it is started through rec, but it showed me sox and
the arguments how to start it directly without rec. I changed my
program to start sox right away and now I can control my child right
away.
guenter
music@slug1 ~ $ pstree; ps axj | egrep 'PPID|rec|sox'
init---IxOsal\0401
+-dropbear---dropbear---bash
=A6
+-dropbear---bash---perl---rec---sox
=A6 +-dropbear---bash---pstree
+-events/0
+-gdd.pl
+-ixp400\040eth0
+-khelper
+-kjournald
+-ksoftirqd/0
+-kswapd0
+-kthread---aio/0
=A6 +-ata/0
=A6 +-3*[ixp400_eth]
=A6 +-kblockd/0
=A6 +-khubd
=A6 +-2*[pdflush]
=A6 +-scsi_eh_0
=A6 +-scsi_eh_1
=A6 +-usb-storage
+-mtdblockd
+-mysqld---mysqld---8*[mysqld]
+-nftld
+-nmbd
+-smbd---3*[smbd]
+-syslog-ng
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
19649 19650 19649 19217 pts/1 19649 S+ 1000 0:00 /bin/sh
/usr/local/bin/rec -c2 -r 44100 testme2.wav
19650 19653 19649 19217 pts/1 19649 S+ 1000 0:00 sox -t ossdsp
-c2 -r 44100 /dev/dsp testme2.wav
19575 19656 19655 19575 pts/2 19655 S+ 1000 0:00 egrep
PPID|rec|sox
#!/usr/bin/perl
do {
# $pid =3D open(KID_TO_WRITE, "|-","rec -c2 -r 44100 testme2.wav"
);
$pid =3D open(KID_TO_WRITE, "|-","sox -t ossdsp -c2 -r 44100
/dev/dsp testme2.wav");
unless (defined $pid) {
warn "cannot fork: $!";
die "bailing out" if $sleep_count++ > 6;
sleep 10;
}
} until defined $pid;
print "pid =3D$pid\n";
if ($pid) { # parent
print "parents pid =3D $pid (my pid=3D $$) \n";
sleep (25);
$result =3D kill(2,$pid) || kill(3,$pid); #SIGINT, SIGQUIT
sleep 1;
print "Killed child process (result $result)\n";
$id =3D wait();
}
------------------------------
Date: 16 Oct 2006 22:07:11 -0700
From: "Andrew Ho" <andrew.ho@gmail.com>
Subject: Silencing TODO output from Test::Harness output
Message-Id: <1161061631.232147.20040@i42g2000cwa.googlegroups.com>
We recently began porting an application from Perl 5.6.1 to Perl 5.8.8
and one of the things I've noticed has changed in between Perl versions
is how Test::Harness acts w.r.t. TODO tests. Perl 5.6.1 will squelch
output from tests that fail, but are marked TODO. Perl 5.8.8 outputs
error messages (with a *TODO* marker appended to them) to stdout on
"make test."
Here's a quick repro case, metatest.t:
use Test qw(plan ok);
plan tests => 2, todo => [2];
ok(1);
ok(0);
Here is the command line invocation that "make test" creates with Perl
5.6.1, stripped of blib include paths, run on the above repro case (the
command line invocation works with either Perl 5.6.1 or Perl 5.8.8):
% perl -e 'printf "%vd\n", $^V'
5.6.1
% PERL_DL_NONLAZY=1 /usr/local/bin/perl -e 'use Test::Harness
qw(&runtests $verbose); $verbose=0; runtests @ARGV;' metatest.t
metatest............ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.01 cusr + 0.00 csys =
0.01 CPU)
And here is the equivalent "make test" invocation that Perl 5.8.8 uses
(this only works on Perl 5.8 because Perl 5.6.1 lacks
ExtUtils::Command::MM):
% perl -e 'printf "%vd\n", $^V'
5.8.8
% PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM"
"-e" "test_harness(0)" metatest.t
metatest....# Failed test 2 in metatest.t at line 4 *TODO*
# metatest.t line 4 is: ok(0);
ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.00 cusr + 0.01 csys =
0.01 CPU)
Now, I understand some advantages to always calling out TODO tests to
make them more obvious. However, in our case our test suite has almost
20,000 tests and many of them are marked TODO. Outputting every TODO
case to stdout makes "make test" very difficult to visually scan.
Does anybody know of a standard way to make the Perl 5.8 Test::Harness
(or Test.pm) emulate Perl 5.6's behvaior of not outputting TODO test
"failure" output?
Thanks in advance!
------------------------------
Date: 17 Oct 2006 00:24:44 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: size of directories?
Message-Id: <ui08j2p801o3pjvfhlmevuek31tdg22fa9@4ax.com>
On 16 Oct 2006 12:29:54 -0700, "Paul Lalli" <mritty@gmail.com> wrote:
>You can recurse through directories using the File::Find module, and
>you can find the size of a file with the -s operator. Read their
>documentations to learn about them, then try putting a script together.
> If it doesn't work to your satisfaction, let us know by posting the
>shortest possible script that still exhibits the same error.
While we're here also remind (to the OP) that disk usage and total
file size are generally different. Also see this post and the
following thread:
news:1157638903.095919.40580@h48g2000cwc.googlegroups.com
(Also available from Google at
<http://groups.google.it/group/comp.lang.perl.misc/browse_thread/thread/d26f0edbf4169ec/>
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: 16 Oct 2006 23:46:59 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: Undefined subroutine &main::1 called perl script
Message-Id: <slrnej86fj.3c3.glennj@smeagol.ncf.ca>
At 2006-10-16 04:03PM, "Paul Lalli" wrote:
> nunekavitha@gmail.com wrote:
> > 22 $assigntmp = 'gzip -cd /opt/delphi/logs/saved/FAM.${opt_d}.*.gz |
> > grep "RESPONSE:" > ${tmpDir}/famOut1.txt 2'>&1;
>
> Your quotes are misasligned. For reasons unkown, you have your single
> quoted string ending before the ">&1" portion of your command. Fix
> that.
>
> By the way, once that's fixed, you're going to have more problems....
> Single quotes do not interpolate Perl variables. Neither $opt_d nor
> $tmpDir are going to be included in your command string. Rather, the
> actual characters $, o, p, t, _, and d will be included. Change your
> single quotes to double quotes.
>
> This, of course, will force you to either backslash the internal Double
> quotes (which surround RESPONSE), or to replace them with single
> quotes.
Or, to be pedantic, use the qq() operator instead of the single quotes
and leave all internal quotes alone.
--
Glenn Jackman
Ulterior Designer
------------------------------
Date: 16 Oct 2006 17:23:50 -0700
From: "markpark" <mark.leeds@morganstanley.com>
Subject: Re: use of next versus last in a nested loop algorithm
Message-Id: <1161044630.864827.291520@e3g2000cwe.googlegroups.com>
obviously ( form the previous message ) my main problem ( besides a
lack of knowledge of perl ) is what to type in
after perldoc to get the relevant information that i need. also, just
so
people know, i wasn't asking anyone to test any of my code out. that
would
be really rude. i was just asking how to jump out of the inner loop
using next or last.
related to my previous algoriithm, below works perfectly for checking
whether the filename
has the pattern. but i also should not write files that have a size of
o bytes ( empty ),
i definitely want to use perldoc so i can minimize my pestering but how
does one know what to type after perldoc in order to get this
information ?
i really don't want to bother people but i can't figure out how to
figure out
what to type ? the last one was "perldoc perlsyn" but i would never
figure that out. thanks.
open ( my $out_file1, '>', $outfilename1 ) or die "Couldn't write to
$outfilename1: $!";
foreach my $item (@filelist) {
foreach my $pat (@datelist1array) {
if ( $item =3D~ /$pat/ ) {
print $out_file1 "$item \n";
last;
}
}
}
On Oct 16, 5:26 pm, "Mumia W. (reading news)"
<paduille.4059.mumi...@earthlink.net> wrote:
> On 10/16/2006 03:00 PM, markpark wrote:
>
> > this is my last question of the day, i promise.
>
> > the code below is doing something very straightforward : i may have a
> > datelist array say ( 200601, 200603, 200602) and a filelist array say
> > ( eurusd.20060123.txt, eurusd.20060523.txt, eurusd.20060622.txt ). all
> > i want to do is write the .txt string to a file whenever there is a
> > match between it and any of the items in the datelist array. i think
> > below will work but i haven't tested it yet.Please test your programs b=
efore asking others to test them.
>
>
>
>
>
> > [B]ut, my question is not
> > really about the code below exactly. filelist can have tons of items in
> > it, so if there is a match, i want to get
> > out of the foreach my $pat loop and go to the next $item in the
> > foreach my $item loop on the outside. i've read about next and last in
> > various books and still i can't tell what to use because
> > my case is a little different than the examples in the books because i
> > am comparing values in
> > the two loops to decide when to get out. therefore, i don't think
> > whatever statement i use, next
> > or last, can go in the if statement ?
>
> > foreach my $item (@filelist) {
> > foreach my $pat (@datelist2array) {
> > if ( $item =3D~ /$pat/ ) {
> > print $out_file2 "$item \n";
> > }
> > }
> > }
>
> > thanks a lot. i'm very sorry to bother everyone.The example in "perldoc=
perlsyn" shows you how to do this. Search in
> that document for "OUTER:" to go to the right place instantly.
>
> --
> Mumia W.
> paduille.4059.mumi...@earthlink.net
> This is a temporary e-mail to help me catch some s-p*=E1/m.- Hide quoted =
text -- Show quoted text -
------------------------------
Date: 16 Oct 2006 17:44:20 -0700
From: "markpark" <mark.leeds@morganstanley.com>
Subject: Re: use of next versus last in a nested loop algorithm
Message-Id: <1161045860.567611.126850@b28g2000cwb.googlegroups.com>
i aplogize. i couldn't find it using perldoc but i grinded through the
books and found it.
if ( -s $filename > 0 ) should do the trick. for checking if the files
are not empty.
i think the answer to my problem about not knowing where to look is to
just look REALLY hard everywhere
before i ask something. at the same time, i went to
www.perldoc.perl.org and couldn't find the -s thing
that way ??? i'm sure it's there somehwere though.
i'm really going to try extremely hard to minimize my questions. i
started perl last week and, because of this list,
i feel like i learned a lot in one week. thank you very much to
everyone for their help.
On Oct 16, 8:23 pm, "markpark" <mark.le...@morganstanley.com> wrote:
> obviously ( form the previous message ) my main problem ( besides a
> lack of knowledge of perl ) is what to type in
> after perldoc to get the relevant information that i need. also, just
> so
> people know, i wasn't asking anyone to test any of my code out. that
> would
> be really rude. i was just asking how to jump out of the inner loop
> using next or last.
>
> related to my previous algoriithm, below works perfectly for checking
> whether the filename
> has the pattern. but i also should not write files that have a size of
> o bytes ( empty ),
> i definitely want to use perldoc so i can minimize my pestering but how
> does one know what to type after perldoc in order to get this
> information ?
> i really don't want to bother people but i can't figure out how to
> figure out
> what to type ? the last one was "perldoc perlsyn" but i would never
> figure that out. thanks.
>
> open ( my $out_file1, '>', $outfilename1 ) or die "Couldn't write to
> $outfilename1: $!";
>
> foreach my $item (@filelist) {
> foreach my $pat (@datelist1array) {
> if ( $item =3D~ /$pat/ ) {
> print $out_file1 "$item \n";
> last;
> }
> }
> }
>
> On Oct 16, 5:26 pm, "Mumia W. (reading news)"
>
>
>
> <paduille.4059.mumi...@earthlink.net> wrote:
> > On 10/16/2006 03:00 PM, markpark wrote:
>
> > > this is my last question of the day, i promise.
>
> > > the code below is doing something very straightforward : i may have a
> > > datelist array say ( 200601, 200603, 200602) and a filelist array say
> > > ( eurusd.20060123.txt, eurusd.20060523.txt, eurusd.20060622.txt ). all
> > > i want to do is write the .txt string to a file whenever there is a
> > > match between it and any of the items in the datelist array. i think
> > > below will work but i haven't tested it yet.Please test your programs=
before asking others to test them.
>
> > > [B]ut, my question is not
> > > really about the code below exactly. filelist can have tons of items =
in
> > > it, so if there is a match, i want to get
> > > out of the foreach my $pat loop and go to the next $item in the
> > > foreach my $item loop on the outside. i've read about next and last in
> > > various books and still i can't tell what to use because
> > > my case is a little different than the examples in the books because i
> > > am comparing values in
> > > the two loops to decide when to get out. therefore, i don't think
> > > whatever statement i use, next
> > > or last, can go in the if statement ?
>
> > > foreach my $item (@filelist) {
> > > foreach my $pat (@datelist2array) {
> > > if ( $item =3D~ /$pat/ ) {
> > > print $out_file2 "$item \n";
> > > }
> > > }
> > > }
>
> > > thanks a lot. i'm very sorry to bother everyone.The example in "perld=
oc perlsyn" shows you how to do this. Search in
> > that document for "OUTER:" to go to the right place instantly.
>
> > --
> > Mumia W.
> > paduille.4059.mumi...@earthlink.net
> > This is a temporary e-mail to help me catch some s-p*=E1/m.- Hide quote=
d text -- Show quoted text -- Hide quoted text -- Show quoted text -
------------------------------
Date: Mon, 16 Oct 2006 21:20:56 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: use of next versus last in a nested loop algorithm
Message-Id: <S6udnQljsJyK0anYnZ2dnUVZ_vudnZ2d@comcast.com>
markpark wrote:
> at the same time, i went to www.perldoc.perl.org and couldn't find
> the -s thing that way ??? i'm sure it's there somehwere though.
A search for -s got me this page:
http://perldoc.perl.org/functions/-X.html
------------------------------
Date: 16 Oct 2006 22:03:17 -0700
From: super.sumanth@gmail.com
Subject: Using Schedule::Cron
Message-Id: <1161061397.854666.10070@i42g2000cwa.googlegroups.com>
Hello all,
I am a new bie in perl. I trying to write a scheduler but later
figured out that this can be done using
Schedule::Cron module.
I have a query regarding this module,
Does this module take only sub routines to execute and not files.
My problem is i have a script that needs to at a particular interval,
using Schedule::Cron is it possible to exeute the script directly
instead of calling the sub routine.
i.e I have a script, checker.ovpl which needs to be called with
Schedule::Cron.
I have done the following,
sub dispatcher {
print "ID: ",shift,"\n";
print "Args: ","@_","\n";
}
my $cron = new Schedule::Cron(\&dispatcher);
$cron->add_entry("* * * * *","/path/checker.ovpl");
$cron->run();
Here checker.ovpl is not getting invoked, instead i see messages from
dispatcher sub routine.
Please let me know if execution of another script from Schedule::Cron
can be done or not.
Thanks,
Sumanth
------------------------------
Date: 16 Oct 2006 23:38:32 -0700
From: "gavino" <bootiack@yahoo.com>
Subject: what happened to pas? perl application server?
Message-Id: <1161067111.986992.163390@e3g2000cwe.googlegroups.com>
http://sourceforge.net/news/?group_id=19226
This seemed liek a cool idea, use and invisible frame!
What happened to this project?
------------------------------
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 9856
***************************************