[31168] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2413 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 13 14:09:52 2009

Date: Wed, 13 May 2009 11:09:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 13 May 2009     Volume: 11 Number: 2413

Today's topics:
    Re: Finding all the links in a Unix file/directory path <ben@morrow.me.uk>
    Re: Launching 2 background processes with fork - how to <marc.girod@gmail.com>
        Launching 2 background processes with fork - how to mak <mrstevegross@gmail.com>
    Re: Launching 2 background processes with fork - how to (Greg Bacon)
        Loop aborts on web server <info@nexo.de>
    Re: Loop aborts on web server <mail@bananas-playground.net>
    Re: Loop aborts on web server <smallpond@juno.com>
    Re: Loop aborts on web server <jurgenex@hotmail.com>
    Re: Loop aborts on web server <info@nexo.de>
    Re: Loop aborts on web server <info@nexo.de>
    Re: Loop aborts on web server <smallpond@juno.com>
    Re: Loop aborts on web server <willem@snail.stack.nl>
        new CPAN modules on Wed May 13 2009 (Randal Schwartz)
    Re: Simple date question <ben@morrow.me.uk>
    Re: Simple date question <tony_curtis32@yahoo.com>
    Re: split string after third forwardslash <rvtol+usenet@xs4all.nl>
    Re: standard and OOP together (Mordechai T. Abzug)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 13 May 2009 03:13:06 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Finding all the links in a Unix file/directory path
Message-Id: <iumpd6-572.ln1@osiris.mauzo.dyndns.org>


Quoth Jürgen Exner <jurgenex@hotmail.com>:
> John <freesoft12@gmail.com> wrote:
> >Looks like my question was not clear:
> >
> >In my logfile, i see the following path: /tmp/test_hier/b/f/of3.cpp.
> >Since directory 'f' is a symbolic link to directory 'c', the actual
> >path is /tmp/test_hier/b/c/of3.cpp.
> >
> >I want to copy the orig path  /tmp/test_hier/b/f/of3.cpp to my target
> >directory: /tmp/copy/ . here is what I want to do:
> >
> >1) Copy the actual file /tmp/test_hier/b/c/of3.cpp as /tmp/copy/tmp/
> >test_hier/b/c/of3.cpp
> >2) Create a link:  /tmp/copy/tmp/test_hier/b/f ->  /tmp/copy/tmp/
> >test_hier/b/c
> 
> So, if I understand correctly you want to copy the complete _structure_
> of the the file tree, i.e. if a directory entry was a symlink in the
> original then it should become a symlink in the copy, too.

No, AIUI he doesn't want to copy the whole tree, just one file and all
symlinks required to resolve that. So if he starts with

    /a/b -> /c
    /c/d -> /e
    /e/f
    /g   -> /a/b/d/f

and copys /g to /tmp/copy he wants to end up with

    /tmp/copy/
        a/
            b -> /tmp/copy/c
        c/
            d -> /tmp/copy/e
        e/
            f
        g -> /tmp/copy/a/b/d/f

In particular, he seems to want to follow and copy links that point
anywhere on the filesystem, without copying the whole disk. This is not
straightforward, but can be done with -l, readlink,
File::Basename::dirname, and a little care.

Ben



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

Date: Wed, 13 May 2009 10:24:18 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: Launching 2 background processes with fork - how to make wait()  work?
Message-Id: <51fd6b77-63e1-4a77-8ce8-80911a9db8f0@e24g2000vbe.googlegroups.com>

On May 13, 5:16=A0pm, mrstevegross <mrstevegr...@gmail.com> wrote:

> Is there something quirky about having two
> background processes instead of one?

Nothing quirky.
Test separately whether you pids are defined or 0,
to account for failures to fork.

Look at the value returned by wait...
I am afraid it returns for each completing process, so you want to
loop
until both have exited (?)
You can also use waitpid, and wait for them explicitely
(I need to do that because I have one other background process
which will exit in the END clause)...

my %family;
for ... {
  if (my $pid =3D fork) {
    $family{$pid}++;
  } else {
    die "cannot fork: $!" unless defined($pid);
  }
}
while (%family) {
  foreach my $kid (keys %family) {
    delete $family{$kid} if waitpid($kid, WNOHANG);
  }
  sleep 1;
}

Marc


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

Date: Wed, 13 May 2009 09:16:30 -0700 (PDT)
From: mrstevegross <mrstevegross@gmail.com>
Subject: Launching 2 background processes with fork - how to make wait() work?
Message-Id: <e0f2b42b-d19c-4c71-93c9-b71c424b6965@s31g2000vbp.googlegroups.com>

Hi folks. I need to launch two "background" processes and wait for
them both to finish before proceeding. I have followed the advice
elsewhere on this forum to use the fork & wait solution. Here's what I
have so far:

  my $proc1_pid = fork;
  if(not $proc1_pid) {
    exec("proc1");
  }
  my $proc2_pid = fork;
  if(not $proc2_pid) {
    exec("proc1");
  }
  wait();
  doSomething();

Unfortunately, wait() doesn't appear to work--the doSomething() line
is processed immediately, even though proc1 and proc2 have not
terminated.

Am I doing something wrong? Is there something quirky about having two
background processes instead of one?

Thanks,
--Steve


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

Date: Wed, 13 May 2009 12:13:02 -0500
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: Launching 2 background processes with fork - how to make wait() work?
Message-Id: <5PWdndxwqPgDYpfXnZ2dnUVZ_jSdnZ2d@posted.hiwaay2>

mrstevegross@gmail.com wrote

: Hi folks. I need to launch two "background" processes and wait for
: them both to finish before proceeding. I have followed the advice
: elsewhere on this forum to use the fork & wait solution. Here's what I
: have so far:
: 
:   my $proc1_pid = fork;
:   if(not $proc1_pid) {
:     exec("proc1");
:   }
:   my $proc2_pid = fork;
:   if(not $proc2_pid) {
:     exec("proc1");
:   }
:   wait();
:   doSomething();
: 
: Unfortunately, wait() doesn't appear to work--the doSomething() line
: is processed immediately, even though proc1 and proc2 have not
: terminated.

Remember that wait will return as soon as any one child exits, not
when all have exited.

You should always check the value returned from a system call. Which
pid did wait give you (or was it -1)? Does proc1 put itself in the
background by forking and exiting?

Consider the following code:

    #! /usr/bin/perl

    use warnings;
    use strict;

    my %kid;

    my $work = [ 'perl', '-e', 'sleep rand 7;' .
                               'print qq[$$ exiting\n]' ];

    my @kids = ($work) x 3;

    $| = 1;

    foreach my $kid (@kids) {
      my $pid = fork;
      if (defined $pid) {
        if ($pid) {
          print "new kid: $pid\n";
          $kid{$pid}++;
        }
        else {
          exec @$kid or die "$0: exec: $!";
        }
      }
      else {
        die "$0: fork: $!";
      }
    }

    while (keys %kid) {
      my $pid = wait;

      last if $pid == -1;

      print "reaped $pid\n";
      delete $kid{$pid} or warn "$0: unknown kid: $pid\n";
    }

    print "Done.\n";

Its output is what you'd expect:

    new kid: 26210
    new kid: 26211
    new kid: 26212
    26212 exiting
    reaped 26212
    26211 exiting
    reaped 26211
    26210 exiting
    reaped 26210
    Done.

But say we change $work to

    my $work = [ 'perl', '-e', 'fork && exit;' .
                               'sleep rand 7;' .
                               'print qq[$$ exiting\n]' ];

Then we see behavior similar to what you're seeing:

    $ ./myprog
    new kid: 26232
    new kid: 26233
    new kid: 26234
    reaped 26233
    reaped 26232
    reaped 26234
    Done.
    $ 26236 exiting
    26235 exiting
    26237 exiting

Notice that after the main process announces its completion, we get
a shell prompt (the $ on the third line from the bottom), but other
child processes are still running and writing to the standard output.

It may help to visualize our processes' family tree, which was
something like

    26231
        - 26232
            - 26235
        - 26233
            - 26236
        - 26234
            - 26237

The children (-32, -33, and -34) did almost nothing: they sired
grandchildren (-35, -36, and -37) and exited immediately, so the
wait loop didn't take long.

I hope this helps.

Greg
-- 
You can always tell when the War Party wants a new war.  They will
invariably trot out the Argumentum ad Hitlerum.
    -- Pat Buchanan


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

Date: Wed, 13 May 2009 15:20:12 +0200
From: "Emil Horowitz" <info@nexo.de>
Subject: Loop aborts on web server
Message-Id: <76vvofF1ehh6tU1@mid.individual.net>

Hi,

I have noticed that a large For loop (10,000 to 20,000 loops) aborts after 
about 500 to 600 loops and terminates script execution when running on the 
web server of my ISP. On my local host, the complete loop runs without 
problems. Any idea about this?

Thanks, Emil




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

Date: Wed, 13 May 2009 15:27:15 +0200
From: =?ISO-8859-1?Q?=22j=2Eke=DFler=22?= <mail@bananas-playground.net>
Subject: Re: Loop aborts on web server
Message-Id: <guehrn$nbu$02$1@news.t-online.com>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Emil Horowitz wrote:
> Hi,
> 
> I have noticed that a large For loop (10,000 to 20,000 loops) aborts after 
> about 500 to 600 loops and terminates script execution when running on the 
> web server of my ISP. On my local host, the complete loop runs without 
> problems. Any idea about this?
> 
> Thanks, Emil
> 
> 
Hello,

how to you execute the script ?
from console or via webserver ?
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkoKyrMACgkQE++2Zdc7EtdabwCXQmI9+0DSocexcDFCeg1nlwBU
OACgoiPTQD+hSoE1sI+5Fbh3UQERZ24=
=Xj5u
-----END PGP SIGNATURE-----


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

Date: Wed, 13 May 2009 08:14:10 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: Loop aborts on web server
Message-Id: <532d6c62-4329-472e-b892-54602ae9e784@s21g2000vbb.googlegroups.com>

On May 13, 9:20 am, "Emil Horowitz" <i...@nexo.de> wrote:
> Hi,
>
> I have noticed that a large For loop (10,000 to 20,000 loops) aborts after
> about 500 to 600 loops and terminates script execution when running on the
> web server of my ISP. On my local host, the complete loop runs without
> problems. Any idea about this?
>
> Thanks, Emil

Web servers put a time limit on CGIs.  Does your
server allow you to fork a long-running process?

http://www.stonehenge.com/merlyn/LinuxMag/col39.html


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

Date: Wed, 13 May 2009 08:32:10 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Loop aborts on web server
Message-Id: <ntpl05pq9a4gfmj0ecdpdiiq4sed2hs3ld@4ax.com>

"Emil Horowitz" <info@nexo.de> wrote:
>I have noticed that a large For loop (10,000 to 20,000 loops) aborts after 
>about 500 to 600 loops and terminates script execution when running on the 
>web server of my ISP. On my local host, the complete loop runs without 
>problems. Any idea about this?

My first guess would be different ulimits between the local host and the
web server.
Or different versions Perl, leading to different program behavoiur.

jue


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

Date: Wed, 13 May 2009 19:20:20 +0200
From: "Emil Horowitz" <info@nexo.de>
Subject: Re: Loop aborts on web server
Message-Id: <770e6hF1eig5eU1@mid.individual.net>


""j.keßler"" <mail@bananas-playground.net> schrieb im Newsbeitrag 
news:guehrn$nbu$02$1@news.t-online.com...
> Emil Horowitz wrote:
>> Hi,
>>
>> I have noticed that a large For loop (10,000 to 20,000 loops) aborts 
>> after
>> about 500 to 600 loops and terminates script execution when running on 
>> the
>> web server of my ISP. On my local host, the complete loop runs without
>> problems. Any idea about this?
>>
>> Thanks, Emil
>>
>>
> Hello,
>
> how to you execute the script ?
> from console or via webserver ?

The problem occurs when executing the script via webserver. Via local host 
the script runs without problems.

Emil




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

Date: Wed, 13 May 2009 19:26:24 +0200
From: "Emil Horowitz" <info@nexo.de>
Subject: Re: Loop aborts on web server
Message-Id: <770e6hF1eig5eU2@mid.individual.net>


> On May 13, 9:20 am, "Emil Horowitz" <i...@nexo.de> wrote:
>> Hi,
>>
>> I have noticed that a large For loop (10,000 to 20,000 loops) aborts 
>> after
>> about 500 to 600 loops and terminates script execution when running on 
>> the
>> web server of my ISP. On my local host, the complete loop runs without
>> problems. Any idea about this?
>>
>> Thanks, Emil
>
> Web servers put a time limit on CGIs.  Does your
> server allow you to fork a long-running process?

I am afraid that a time limit is not the reason for the problem. I made this 
test: I put a one second's "sleep" into each loop, extending the runtime of 
the script many times over. Still the script aborts after about 500 loops, 
as before without the "sleep" command. Any ideas?

Emil




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

Date: Wed, 13 May 2009 10:31:31 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: Loop aborts on web server
Message-Id: <cc02c9b1-f5d9-460f-ab74-5cafa7838139@l28g2000vba.googlegroups.com>

On May 13, 1:26 pm, "Emil Horowitz" <i...@nexo.de> wrote:
> > On May 13, 9:20 am, "Emil Horowitz" <i...@nexo.de> wrote:
> >> Hi,
>
> >> I have noticed that a large For loop (10,000 to 20,000 loops) aborts
> >> after
> >> about 500 to 600 loops and terminates script execution when running on
> >> the
> >> web server of my ISP. On my local host, the complete loop runs without
> >> problems. Any idea about this?
>
> >> Thanks, Emil
>
> > Web servers put a time limit on CGIs.  Does your
> > server allow you to fork a long-running process?
>
> I am afraid that a time limit is not the reason for the problem. I made this
> test: I put a one second's "sleep" into each loop, extending the runtime of
> the script many times over. Still the script aborts after about 500 loops,
> as before without the "sleep" command. Any ideas?
>
> Emil

Is it creating a large data structure on each loop?


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

Date: Wed, 13 May 2009 17:45:28 +0000 (UTC)
From: Willem <willem@snail.stack.nl>
Subject: Re: Loop aborts on web server
Message-Id: <slrnh0m1po.pkn.willem@snail.stack.nl>

Emil Horowitz wrote:
) I am afraid that a time limit is not the reason for the problem. I made this 
) test: I put a one second's "sleep" into each loop, extending the runtime of 
) the script many times over. Still the script aborts after about 500 loops, 
) as before without the "sleep" command. Any ideas?

CPU time isn't the same as runtime.
For your test, put something that does a lot of calculation
in stead of the sleep.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


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

Date: Wed, 13 May 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed May 13 2009
Message-Id: <KJKFqr.Fzx@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-WURFLFilter-2.00
http://search.cpan.org/~ifuschini/Apache2-WURFLFilter-2.00/
is a Apache Mobile Filter that give any information about the capabilities of the devices as environment variable 
----
App-GitHub-FixRepositoryName-0.01
http://search.cpan.org/~rkrimen/App-GitHub-FixRepositoryName-0.01/
Fix your .git/config after a repository-name case change 
----
App-MrShell-2.0203
http://search.cpan.org/~jettero/App-MrShell-2.0203/
do everything the mrsh commandline tool can do and more 
----
Array-Diff-0.05002
http://search.cpan.org/~typester/Array-Diff-0.05002/
Find the differences between two arrays 
----
CGI-Application-Plugin-Menu-1.06
http://search.cpan.org/~leocharre/CGI-Application-Plugin-Menu-1.06/
manage navigation menus for cgi apps 
----
Catalyst-Model-DBIC-Schema-0.01
http://search.cpan.org/~rkitover/Catalyst-Model-DBIC-Schema-0.01/
----
Catalyst-Plugin-PluginLoader-0.01
http://search.cpan.org/~rkitover/Catalyst-Plugin-PluginLoader-0.01/
Load Catalyst Plugins from Config 
----
Catalyst-Plugin-Session-Store-Delegate-0.04
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Session-Store-Delegate-0.04/
Delegate session storage to an application model object. 
----
Class-C3-Adopt-NEXT-0.10
http://search.cpan.org/~flora/Class-C3-Adopt-NEXT-0.10/
make NEXT suck less 
----
Class-MOP-0.84
http://search.cpan.org/~drolsky/Class-MOP-0.84/
A Meta Object Protocol for Perl 5 
----
Data-Serializable-0.01
http://search.cpan.org/~robins/Data-Serializable-0.01/
Moose-based role that adds serialization support to any class 
----
Data-Serializable-0.02
http://search.cpan.org/~robins/Data-Serializable-0.02/
Moose-based role that adds serialization support to any class 
----
Devel-PackagePath-0.02
http://search.cpan.org/~perigrin/Devel-PackagePath-0.02/
Inspect and Manipulate a Path based on a Package Name 
----
Devel-StringInfo-0.03
http://search.cpan.org/~nuffin/Devel-StringInfo-0.03/
Gather information about strings 
----
Dist-Zilla-PluginBundle-RJBS-0.091320
http://search.cpan.org/~rjbs/Dist-Zilla-PluginBundle-RJBS-0.091320/
BeLike::RJBS when you build your dists 
----
File-LibMagic-0.92
http://search.cpan.org/~fitzner/File-LibMagic-0.92/
Perlwrapper for libmagic (file-4.x or file-5.x) 
----
File-LibMagic-0.93
http://search.cpan.org/~fitzner/File-LibMagic-0.93/
Perlwrapper for libmagic (file-4.x or file-5.x) 
----
Geo-WebService-Elevation-USGS-0.005
http://search.cpan.org/~wyant/Geo-WebService-Elevation-USGS-0.005/
Elevation queries against USGS web services. 
----
Getopt-Chain-0.010
http://search.cpan.org/~rkrimen/Getopt-Chain-0.010/
Command-line processing like svn and git 
----
Git-CPAN-Patch-0.1.6
http://search.cpan.org/~yanick/Git-CPAN-Patch-0.1.6/
Patch CPAN modules using Git 
----
GnuPG-0.10_1
http://search.cpan.org/~robbiebow/GnuPG-0.10_1/
Perl module interface to the GNU Privacy Guard. 
----
JavaScript-Beautifier-0.07
http://search.cpan.org/~fayland/JavaScript-Beautifier-0.07/
Beautify Javascript (beautifier for javascript) 
----
Log-UDP-Client-0.01
http://search.cpan.org/~robins/Log-UDP-Client-0.01/
a simple way to send structured log messages via UDP 
----
Log-UDP-Server-0.01
http://search.cpan.org/~robins/Log-UDP-Server-0.01/
a simple way to receive and handle structured messages via UDP 
----
Log-UDP-Server-0.02
http://search.cpan.org/~robins/Log-UDP-Server-0.02/
a simple way to receive and handle structured messages via UDP 
----
MIME-Charset-1.007_02
http://search.cpan.org/~nezumi/MIME-Charset-1.007_02/
Charset Informations for MIME 
----
MIME-EncWords-1.011_02
http://search.cpan.org/~nezumi/MIME-EncWords-1.011_02/
deal with RFC 2047 encoded words (improved) 
----
Math-Random-ISAAC-XS-1.0.5
http://search.cpan.org/~frequency/Math-Random-ISAAC-XS-1.0.5/
C implementation of the ISAAC PRNG Algorithm 
----
Math-VarRate-0.091320
http://search.cpan.org/~rjbs/Math-VarRate-0.091320/
deal with linear, variable rates of increase 
----
Moose-0.78
http://search.cpan.org/~drolsky/Moose-0.78/
A postmodern object system for Perl 5 
----
MooseX-Documenter-0.01
http://search.cpan.org/~dsbike/MooseX-Documenter-0.01/
class for getting Moose documentation for your Moose classes 
----
MooseX-POE-0.202
http://search.cpan.org/~perigrin/MooseX-POE-0.202/
The Illicit Love Child of Moose and POE 
----
MooseX-Role-Parameterized-0.06
http://search.cpan.org/~sartak/MooseX-Role-Parameterized-0.06/
parameterized roles 
----
Muldis-D-0.70.0
http://search.cpan.org/~duncand/Muldis-D-0.70.0/
Formal spec of Muldis D relational DBMS lang 
----
Net-Axigen-0.09
http://search.cpan.org/~itmfrolov/Net-Axigen-0.09/
Perl extension for Gecad Technologies Axigen Mail Server (www.axigen.com). This module use Axigen CLI interface. 
----
Net-Google-Code-0.04
http://search.cpan.org/~sunnavy/Net-Google-Code-0.04/
a simple client library for google code 
----
Padre-Plugin-Debugger-0.2
http://search.cpan.org/~pmakholm/Padre-Plugin-Debugger-0.2/
Debug Perl code from Padre editor 
----
RT-Extension-NotifyOwners-0.01_01
http://search.cpan.org/~idn/RT-Extension-NotifyOwners-0.01_01/
----
Sub-Attribute-0.01
http://search.cpan.org/~gfuji/Sub-Attribute-0.01/
Reliable subroutine attribute handlers 
----
Sysadm-Install-0.28
http://search.cpan.org/~mschilli/Sysadm-Install-0.28/
Typical installation tasks for system administrators 
----
Test-Command-0.06
http://search.cpan.org/~danboo/Test-Command-0.06/
Test routines for external commands 
----
Test-Command-0.07
http://search.cpan.org/~danboo/Test-Command-0.07/
Test routines for external commands 
----
Test-Output-0.15
http://search.cpan.org/~jlholt/Test-Output-0.15/
Utilities to test STDOUT and STDERR messages. 
----
TheOneRing-0.21
http://search.cpan.org/~hardaker/TheOneRing-0.21/
A high level perl class to bind all VCs together 
----
TheOneRing-0.22
http://search.cpan.org/~hardaker/TheOneRing-0.22/
A high level perl class to bind all VCs together 
----
Tk-ForDummies-Graph-1.07
http://search.cpan.org/~djibel/Tk-ForDummies-Graph-1.07/
Extension of Canvas widget to create a graph like GDGraph. 
----
Ubigraph-0.04
http://search.cpan.org/~gaou/Ubigraph-0.04/
Perl client of Ubigraph software 
----
Video-FourCC-Info-1.1.5
http://search.cpan.org/~frequency/Video-FourCC-Info-1.1.5/
Find information about codecs from its FourCC 
----
WWW-Scraper-Yahoo360-0.04
http://search.cpan.org/~cosimo/WWW-Scraper-Yahoo360-0.04/
Yahoo 360 blogs old-fashioned crappy scraper 
----
Yahoo-Marketing-5.03
http://search.cpan.org/~shenj/Yahoo-Marketing-5.03/
an interface for Yahoo! Search Marketing's Web Services. 
----
as-0.06
http://search.cpan.org/~elizabeth/as-0.06/
load OO module under another name 
----
local-lib-1.003004
http://search.cpan.org/~apeiron/local-lib-1.003004/
create and use a local lib/ for perl modules with PERL5LIB 
----
mod_perl-1.31
http://search.cpan.org/~gozer/mod_perl-1.31/
Embed a Perl interpreter in the Apache HTTP server 


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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Wed, 13 May 2009 03:06:05 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Simple date question
Message-Id: <dhmpd6-572.ln1@osiris.mauzo.dyndns.org>


Quoth somebody <some@body.com>:
> Is there a simple way to get the date in the format mm/dd/yyyy into a
> variable, without installing a module such as DateTime?

Use POSIX::strftime. POSIX is a core module, so it's always available
when perl is.

Ben



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

Date: Tue, 12 May 2009 21:18:22 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Simple date question
Message-Id: <m2zldhvj81.fsf@yahoo.com>

somebody <some@body.com> writes:

> Is there a simple way to get the date in the format mm/dd/yyyy into a
> variable, without installing a module such as DateTime?

perldoc POSIX -> strftime

    my $date = strftime('%m/%d/%Y', localtime);


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

Date: Wed, 13 May 2009 10:08:33 +0200
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: split string after third forwardslash
Message-Id: <4a0a8001$0$199$e4fe514c@news.xs4all.nl>

Tad J McClellan wrote:
> mike <mikaelpetterson@hotmail.com> wrote:
>> Hi,
>>
>> How can I use perl to get the following substring:
>>
>> C:\cc_views\wong
>>
>> from this string:
>>
>> C:\cc_views\wong\mbv_admin\tools\scripts\deliver\delivery.pl
> 
> 
> If the full path is in $full, then use split() along with a "list slice":
> 
>     my $partial = join '\\', (split /\\/, $full)[0..2];

There is no need to repeat the split string:

     my $partial = join "", (split /(\\)/, $full)[0..2*2];

-- 
Ruud


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

Date: Wed, 13 May 2009 14:39:27 +0000 (UTC)
From: morty@sanctuary.arbutus.md.us (Mordechai T. Abzug)
Subject: Re: standard and OOP together
Message-Id: <guem2v$rs7$1@news.motzarella.org>

In article <4a07276d$0$23751$9a566e8b@news.aliant.net>,
"Guy" <someone@somewhere.nb.ca> spake thusly:

> If I decide to use the OO interface of CGI.pm such as...
[snip]
> ...could I still write the rest of my application in a standard way?
> I mean what else would have to change?

Nothing else need change.   You can mix OO and imperative Perl.

- Morty


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

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


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