[28580] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9944 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 9 03:05:55 2006

Date: Thu, 9 Nov 2006 00:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 9 Nov 2006     Volume: 10 Number: 9944

Today's topics:
    Re: are appservers BS? is python a bunch of snooty wank <bootiack@yahoo.com>
    Re: Data plotting questions   Nov. 2, 2006 <edgrsprj@ix.netcom.com>
    Re: Generate HTML from a Windows Network Share <tadmc@augustmail.com>
    Re: how do i update one section of a page leaving rest? <bootiack@yahoo.com>
    Re: how do i update one section of a page leaving rest? <bootiack@yahoo.com>
    Re: how do i update one section of a page leaving rest? <uri@stemsystems.com>
    Re: how to load 'formats' from a file anno4000@radom.zrz.tu-berlin.de
    Re: how to load 'formats' from a file <benmorrow@tiscali.co.uk>
    Re: how to load 'formats' from a file <benmorrow@tiscali.co.uk>
    Re: How to reference memory address returned from Win32 <sisyphus1@nomail.afraid.org>
        new CPAN modules on Thu Nov  9 2006 (Randal Schwartz)
    Re: perl & lsof kind <joe@inwap.com>
    Re: PERL can't open file for logging (world writable di <sisyphus1@nomail.afraid.org>
    Re: PERL can't open file for logging (world writable di <noreply@gunnar.cc>
    Re: Regular expressions <someone@example.com>
    Re: sorting array in multiple columns <tadmc@augustmail.com>
    Re: What is the diff between PerlCE and Perl????????? <effigies@gmail.com>
    Re: What is the diff between PerlCE and Perl????????? <cdalten@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 8 Nov 2006 22:29:49 -0800
From: "gavino" <bootiack@yahoo.com>
Subject: Re: are appservers BS? is python a bunch of snooty wankers?
Message-Id: <1163053789.575220.168450@h48g2000cwc.googlegroups.com>


Keith Keller wrote:
> On 2006-11-08, gavino <bootiack@yahoo.com> wrote:
> > http://www.kx.com/listbox/kdb/msg00797.html
> >
> > http://philip.greenspun.com/wtr/application-servers
> >
> > is an appserver a mistake?
> > should everything happen in the db in nice tables?
> > why do pythons talk smak?
> > why catalyst active if appservers are mistake?
> > do people just not want o use a relational db right?
>
> What is your Perl question?
> 
> --keith
every line except the python one, do you know english?



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

Date: Thu, 09 Nov 2006 01:56:11 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Data plotting questions   Nov. 2, 2006
Message-Id: <%Uv4h.4302$l25.3818@newsread4.news.pas.earthlink.net>

"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
news:071120060947389379%jgibson@mail.arc.nasa.gov...

> Nobody here is likely to take the time to give you a detailed
> comparison of any 3 computer languages. There is much existing

Thanks for the comments.

The information in your response answered my questions.  As I said, I was
just looking for some general information, not details.

One of the major goals here is to identify a language which scientists
around the world would be willing to work with on a variety of projects.
And some of the important considerations are that the language should be:

Versatile
Reliable
Compatible with programs written in other languages
Formally supported by some organization such as ActiveState
Have a support group such as this Perl Newsgroup
Be easy to use
Be downloadable for free

Many attractive programs such as different versions of Basic have to be
purchased.  Then their upgrades need to be purchased etc.  I personally have
no objection there.  But it would be difficult to get large numbers of other
scientists around the world to go along with that.  Some that I am working
with do not even want to use Perl in spite of the fact that it is free.

This is one of the reasons the language of choice needs to be compatible
with programs written in other languages.  They can be called as
"subroutines" of a sort by Perl.  I am already doing that myself with some
specialty programs using "GuiTest" routines.  My main Perl program feeds
them information as if it were being entered from the keyboard, starts them
running, waits for results, stops them, collects the newly generated
information from them, processes the data, and moves on to the next task.

The problem with the fact that Perl is not easy for people who are not
experienced programmers to use can be overcome if usage instructions are
prepared which are specifically designed for them.  Special modules can also
be created for them.  But if people are going to go through that much
trouble then it is important to start with the language which is the closest
to what is needed.




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

Date: Wed, 8 Nov 2006 17:55:03 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Generate HTML from a Windows Network Share
Message-Id: <slrnel4rin.k7p.tadmc@tadmc30.august.net>

rob <robgmatthews@gmail.com> wrote:

> I'm mostly investigating the possible viability of doing this. 


It is most certainly viable. (if "viable" means "possible".)


> Please
> bear with me as I am very much a newbie when it comes to perl.

> $path "\\network_share\"
                        ^^
                        ^^ statements in Perl usually end with a semicolon;


> Am I looking at this in the right direction?


No.

You should start with writing a Perl program that prints:

   Hello world!

Then modify it a little bit at a time, each time getting a little
closer to your real objective. 

See:

   http://learn.perl.org


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 8 Nov 2006 22:25:09 -0800
From: "gavino" <bootiack@yahoo.com>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <1163053509.436756.93410@h54g2000cwb.googlegroups.com>


Uri Guttman wrote:
> >>>>> "g" == gavino  <bootiack@yahoo.com> writes:
>
>   g> Michele Dondi wrote:
>   >>
>   >> Oh, you should have specified these details in the first place. Then
>   >> it would have been easier to help you. So here's another try: open the
>   >> sources for that web app in your favourite editor and write some code
>   >> that will delete the section you don't like, and update it with the
>   >> new content.
>
>   g> You realise you come off as an idiot when you talk like this?
>
> nah, he was just treating you like the idiot you are. big difference.
>
>   g> vote republican.
> 
> more proof of your idiocy.
> 
> uri
> 
> -- 
you are useless



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

Date: 8 Nov 2006 22:32:32 -0800
From: "gavino" <bootiack@yahoo.com>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <1163053952.575387.326390@k70g2000cwa.googlegroups.com>


J=FCrgen Exner wrote:
> gavino wrote:
> > vote republican.
>
> Hmmmmmm, last time I checked my country was a republic already, no need to
> vote against a Monarchy.
> Of course it might be different for you if you are a victim of King George
> in which case you should indeed vote in favour of restoring the republic.
>
> jue
I think we simply need to reduce governemnt spending, sadly bush does
not



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

Date: Thu, 09 Nov 2006 03:03:14 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: how do i update one section of a page leaving rest?
Message-Id: <x7y7ql59od.fsf@mail.sysarch.com>

>>>>> "g" == gavino  <bootiack@yahoo.com> writes:

  g> Uri Guttman wrote:
  >> >>>>> "g" == gavino  <bootiack@yahoo.com> writes:
  >> 
  g> Michele Dondi wrote:
  >> >>
  >> >> Oh, you should have specified these details in the first place. Then
  >> >> it would have been easier to help you. So here's another try: open the
  >> >> sources for that web app in your favourite editor and write some code
  >> >> that will delete the section you don't like, and update it with the
  >> >> new content.
  >> 
  g> You realise you come off as an idiot when you talk like this?
  >> 
  >> nah, he was just treating you like the idiot you are. big difference.
  >> 
  g> vote republican.
  >> 
  >> more proof of your idiocy.
  >> 
  >> uri
  >> 
  >> -- 
  g> you are useless

nah, just useless to you. and you don't count. i voted yesterday and
that turned out to be very useful to our country.

too bad to be you. have fun if you can. learn python. go bother them.

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: 8 Nov 2006 23:13:00 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: how to load 'formats' from a file
Message-Id: <4rf6jsFr3gjjU1@mid.dfncis.de>

simulant <fraser.tim@gmail.com> wrote in comp.lang.perl.misc:
> I am using the `format` command in a reporting module I am writing, and
> I want to be able to store multiple format pictures in files and then
> load the needed format from the file.  This would be an example session
> using my modules:

[snip]

> Nowhere in perlform or anywhere else I searched was there a mention of
> how to load formats from files.  The code above in the write sub does
> NOT work, but I would like to do something similar.

That's because formats weren't designed to be loaded dynamically.
A format must be defined at compile-time, there's no way around
that.

> I have the formats defined at the top of the module for now, and this
> works, but this does not support dynamically loading different formats:
> 
> format FORMAT1_TOP =
> Title: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>        $title
> Date: @>>>>>>>>>>>>>>>>>>>
>       $now
> 
> .
> 
> format FORMAT1 =
> @*
> $content
> .

The simplest way to load formats dynamically would be to put the
various format statements in modules and load the one you want.  They
should all refer to the same file handle, say DYN_FORMAT so the main
program knows what to open.  Otherwise, put your code above literally
into a file named Format1.pl.  Don't forget to add a final statement
"1;".

The main program could do (untested)

    our ( $title, $now, $content) =
        ( 'heading', scalar localtime, 'stuff');

    use Format1;

    open DYN_FORMAT, '>&', 'STDOUT' or die $!;
    write DYN_FORMAT;

Make a copy Format2.pl of Format1.pl and edit it to contain a different
format.  Change "use Format1" to "use Format2" in the main program,
which will now use the other format.

Anno


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

Date: Wed, 8 Nov 2006 21:36:11 +0000
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: how to load 'formats' from a file
Message-Id: <b7v924-snk.ln1@osiris.mauzo.dyndns.org>


Quoth "simulant" <fraser.tim@gmail.com>:
> I am using the `format` command in a reporting module I am writing, and
> I want to be able to store multiple format pictures in files and then
> load the needed format from the file.  This would be an example session
> using my modules:
[snip]
> Nowhere in perlform or anywhere else I searched was there a mention of
> how to load formats from files.  The code above in the write sub does
> NOT work, but I would like to do something similar.
> 
> I have the formats defined at the top of the module for now, and this
> works, but this does not support dynamically loading different formats:
[snip]

See the swrite function defined at the end of perlform. Basically, you
can't load formats from a file; you have to use formline and $^A to
format the data 'by hand'.

Alternatively, I would recommend the Perl6::Form module from CPAN. It
implements the Perl6 'form' command for Perl5, which is both much more
flexible and has considerably nicer formatting options.

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  benmorrow@tiscali.co.uk                                          (Kate Rusby)


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

Date: Thu, 9 Nov 2006 03:15:06 +0000
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: how to load 'formats' from a file
Message-Id: <q2ja24-sme.ln1@osiris.mauzo.dyndns.org>


Quoth anno4000@radom.zrz.tu-berlin.de:
> 
> The simplest way to load formats dynamically would be to put the
> various format statements in modules and load the one you want.  They
> should all refer to the same file handle, say DYN_FORMAT so the main
> program knows what to open.

 ...and, of course, you have to bear in mind that formats, as
filehandles, are package-scoped.

> Otherwise, put your code above literally
> into a file named Format1.pl.  Don't forget to add a final statement
> "1;".
> 
> The main program could do (untested)
> 
>     our ( $title, $now, $content) =
>         ( 'heading', scalar localtime, 'stuff');
> 
>     use Format1;

Umm, either you mean

    require 'Format1.pl';

or you meant Format1.pm above.

>     open DYN_FORMAT, '>&', 'STDOUT' or die $!;
>     write DYN_FORMAT;

In fact, there's no need for separate files. This

    #!/usr/bin/perl

    (my $f = shift) =~ s/!/\n/g;

    our ($x, $y) = qw/aaa bbb/;
    
    eval <<EOFORMAT;
    format FOO =
    $f
    .
    EOFORMAT

    open FOO, '>&', \*STDOUT or die "can't open FOO: $!";
    write FOO;

    __END__

will quite happily accept an argument of 'foo: @<<<!$x' and produce

    foo: aaa

as output. If you attempt to redefine a format you get a warning, of
course, but that can be suppressed.

Ben

-- 
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces mollit animos, tristesque mentes erigit.|benmorrow@tiscali.co.uk
Musica vel ipsas arbores et horridas movet feras.     |


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

Date: Thu, 9 Nov 2006 13:44:48 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: How to reference memory address returned from Win32::API call
Message-Id: <4552973f$0$17211$afc38c87@news.optusnet.com.au>


"cyl" <u8526505@gmail.com> wrote in message
news:1162964481.986287.124270@h54g2000cwb.googlegroups.com...
> Below is my code to enumerate services. The returned buffer $lpServices
> is an array of the structure ENUM_SERVICE_STATUS. After unpacking it, I
> got the memory address of the variable lpServiceName which points to
> somewhere in the buffer $lpServices. My problem is how do I reference
> the address? Unlike a C program, I cannot reference that value
> directly. What should I do?
>
> typedef struct _SERVICE_STATUS {
>   DWORD dwServiceType;
>   DWORD dwCurrentState;
>   DWORD dwControlsAccepted;
>   DWORD dwWin32ExitCode;
>   DWORD dwServiceSpecificExitCode;
>   DWORD dwCheckPoint;
>   DWORD dwWaitHint;
> } SERVICE_STATUS;
>
> typedef struct _ENUM_SERVICE_STATUS {
>   LPTSTR lpServiceName;
>   LPTSTR lpDisplayName;
>   SERVICE_STATUS ServiceStatus;
> } ENUM_SERVICE_STATUS;
>
>
> ---CODE---
> use Win32::API;
>
> my $fnOpenSCManager = Win32::API->new('Advapi32.dll', 'OpenSCManager',
> 'PPI', 'I');
> my $fnEnumServicesStatus = Win32::API->new('Advapi32.dll',
> 'EnumServicesStatus', 'IIIPIPPP', 'I');
>
> my $hSCManager = $fnOpenSCManager->Call(0,0,0x000f003f);
>
> die unless $hSCManager;
>
> my $cbBufSize = 4;
> my $pcbBytesNeeded = pack("N",0);
> my $lpServicesReturned = pack("N",0);
> my $lpResumeHandle = pack("N",0);
> my @Services;
> @Services[0 .. 36*$cbBufSize] = 0;
> my $lpServices = pack("N*",@Services);
>

Having a bit of trouble following this. You can create your SERVICE_STATUS
struct as:

my $service_status_struct = pack('LLLLLLL', 0, 0, 0, 0, 0, 0, 0);

If any of those values need to be initialised to something other than zero,
then replace the zero with the appropriate value - but if the values are
going to be set by the Call() then zeroes will be fine.

You need to create an lpServiceName buffer (to a size that is at least as
long as the string it will be set to):

my $lpServiceName_buffer = " " x $size_of_lpServiceName; # or longer

Similarly, for $lpDisplayName:

my $lpDisplayName =  " " x $size_of_lpDisplayName; # or longer

You can now create the $lpServices variable as follows:

my $lpServices = pack('ppP', $lpServiceName, $lpDisplayName,
$service_status_struct);

(I *think* that 'P' is the correct way to pack $service_status_struct.
That's what 'perldoc -f pack' suggests to me, but I've no experience in
actually using 'P'.)

Then after the Call() you should be able to get at the values you want with:

($lpServiceName, $lpDisplayName, $service_status_struct) = unpack ('ppP',
$lpServices);

If you want to then get at the values in $service_status_struct, you'll need
to also:

@values = unpack('LLLLLL', $service_status_struct);

>
> my $ret = $fnEnumServicesStatus->Call( $hSCManager,
>                                        0x3B, #SERVICE_DRIVER |
> SERVICE_WIN32
>                                        0x3, #SERVICE_STATE_ALL
>                                        $lpServices,
>                                        36*$cbBufSize,
>                                        $pcbBytesNeeded,
>                                        $lpServicesReturned,
>                                        $lpResumeHandle
>                                       );
>

Cheers,
Rob




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

Date: Thu, 9 Nov 2006 05:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Nov  9 2006
Message-Id: <J8G7uC.1CsH@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.

Alien-scriptaculous-1.001
http://search.cpan.org/~gtermars/Alien-scriptaculous-1.001/
installing and finding script.aculo.us
----
Bigtop-0.19
http://search.cpan.org/~philcrow/Bigtop-0.19/
A web application data language processor
----
CFPlus-0.95
http://search.cpan.org/~mlehmann/CFPlus-0.95/
undocumented utility garbage for our crossfire client
----
CGI-FormBuilder-Source-YAML-1.0.5
http://search.cpan.org/~markle/CGI-FormBuilder-Source-YAML-1.0.5/
Initialize FormBuilder from YAML file
----
CGI-FormBuilder-Source-YAML-1.0.6
http://search.cpan.org/~markle/CGI-FormBuilder-Source-YAML-1.0.6/
Initialize FormBuilder from YAML file
----
CPAN-Reporter-0.34
http://search.cpan.org/~dagolden/CPAN-Reporter-0.34/
Provides Test::Reporter support for CPAN.pm
----
Cache-Memcached-Tie-0.03
http://search.cpan.org/~gugu/Cache-Memcached-Tie-0.03/
Using Cache::Memcached as hash
----
Event-Lib-UDPPump-0.01
http://search.cpan.org/~cmo/Event-Lib-UDPPump-0.01/
Event::Lib event type for high performance UDP applications.
----
Finance-TickerSymbols-0.02
http://search.cpan.org/~jezra/Finance-TickerSymbols-0.02/
Perl extension for getting symbols lists from web resources
----
Games-FlipCoin-1.00
http://search.cpan.org/~denkinger/Games-FlipCoin-1.00/
Simulates a coin flip
----
JavaScript-Code-0.08
http://search.cpan.org/~esskar/JavaScript-Code-0.08/
A JavaScript Code Framework
----
Lingua-JA-Summarize-Extract-0.01
http://search.cpan.org/~yappo/Lingua-JA-Summarize-Extract-0.01/
summary generator for Japanese
----
Mac-Glue-1.28
http://search.cpan.org/~cnandor/Mac-Glue-1.28/
Control Mac apps with Apple event terminology
----
Net-DNS-LivedoorDomain-DDNS-0.01
http://search.cpan.org/~masahito/Net-DNS-LivedoorDomain-DDNS-0.01/
Update your livedoor DOMAIN (http://domain.livedoor.com/) DynamicDNS records.
----
Net-SFTP-Foreign-0.90_14
http://search.cpan.org/~salva/Net-SFTP-Foreign-0.90_14/
Secure File Transfer Protocol client
----
Parallel-Mpich-MPD-0.1.0
http://search.cpan.org/~alexmass/Parallel-Mpich-MPD-0.1.0/
Mpich MPD wrapper
----
RunApp-0.13
http://search.cpan.org/~clkao/RunApp-0.13/
A generic module to run web-applications
----
SVN-Notify-Config-0.0904
http://search.cpan.org/~jpeacock/SVN-Notify-Config-0.0904/
Config-driven Subversion notification
----
SVN-Notify-Config-0.0905
http://search.cpan.org/~jpeacock/SVN-Notify-Config-0.0905/
Config-driven Subversion notification
----
Sledge-View-0.08
http://search.cpan.org/~tokuhirom/Sledge-View-0.08/
abstract base class for Sledge's view(EXPERIMENTAL!!)
----
Test-LongString-0.11
http://search.cpan.org/~rgarcia/Test-LongString-0.11/
tests strings for equality, with more helpful failures
----
Test-Run-CmdLine-0.0101
http://search.cpan.org/~shlomif/Test-Run-CmdLine-0.0101/
Analyze tests from the command line using Test::Run
----
Test-Run-CmdLine-Plugin-ColorSummary-0.0101
http://search.cpan.org/~shlomif/Test-Run-CmdLine-Plugin-ColorSummary-0.0101/
Color the summary in Test::Run::CmdLine.
----
Test-Run-Plugin-ColorSummary-0.0101
http://search.cpan.org/~shlomif/Test-Run-Plugin-ColorSummary-0.0101/
A Test::Run plugin that colors the summary.
----
Text-Password-Pronounceable-0.27
http://search.cpan.org/~clkao/Text-Password-Pronounceable-0.27/
Generate pronounceable passwords
----
WWW-Mechanize-Pliant-0.12
http://search.cpan.org/~reitman/WWW-Mechanize-Pliant-0.12/
----
onto-perl-0.20
http://search.cpan.org/~easr/onto-perl-0.20/
----
onto-perl-0.21
http://search.cpan.org/~easr/onto-perl-0.21/
----
onto-perl-0.22
http://search.cpan.org/~easr/onto-perl-0.22/
----
onto-perl-0.23
http://search.cpan.org/~easr/onto-perl-0.23/


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 08 Nov 2006 23:49:05 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: perl & lsof kind
Message-Id: <mIWdnT6NwtUwQM_YnZ2dnUVZ_sWdnZ2d@comcast.com>

gmlvsk2@gmail.com wrote:
> Is there a perl module that will give me process name for a port?
> I would give it open  port and it would give me executable name that
> listens on that port.

This is what I use:

      linux% perl -e 's/\s+(TCP|UDP) / $1 /&&print for `lsof`'


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

Date: Thu, 9 Nov 2006 12:44:38 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: PERL can't open file for logging (world writable directory Windows XP Home/ Active Perl / Apache)
Message-Id: <45528926$0$23136$afc38c87@news.optusnet.com.au>


"PGPS" <premgrps@gmail.com> wrote in message
news:1163026204.175252.217270@e3g2000cwe.googlegroups.com...
 .
 .
>
> 4. With this setup, I get an error "Cannot open file" in the error logs
> of Apache.

Can you extend that error message to include the name of the file that perl
couldn't open (in case it's not the file you think it was), and to include
the contents of $!.

Cheers,
Rob




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

Date: Thu, 09 Nov 2006 00:51:34 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: PERL can't open file for logging (world writable directory Windows XP Home/ Active Perl / Apache)
Message-Id: <4rf904Fr66mmU1@mid.individual.net>

PGPS wrote:
> 1. I have a perl program which logs user inputs. It was working fine on
> Linux system.
> 
> 2. I moved my entire work onto my home PC with XP-Home/Active
> Perl/Apache and running the program as a cgi-script. It was working
> fine and was able to perform logs as usual, but I was unable to view
> it.
> 
> 3. Apache woudn't display .html files if they are in cgi-bin directory.

That's how it should be.

> I had to move it out to htdocs and change the path of the file in PERL
> program to point to the file in htdocs.
> 
> 4. With this setup, I get an error "Cannot open file" in the error logs
> of Apache. I can view the file on the internet, but the program is not
> able to open to save the logs.
> 
> Can someone tell me what's going on. And how to fix it.

Not based on what you've told us.

> Either at
> Apache end (to be able to view .html files in cgi-bin directory) OR on
> the PERL end, where I want to be able to make the file world writable
> and perform logs.

I think there is some fundamental misconception here. The fact that you 
cannot read files with your browser when they are located in the cgi-bin 
is unrelated to whether they can be opened for writing. Neither of these 
things is Perl related.

Nevertheless, if you post some Perl code, somebody may be able to put 
you in the right direction.

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


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

Date: Thu, 09 Nov 2006 03:51:19 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Regular expressions
Message-Id: <XAx4h.48285$P7.22389@edtnps89>

Ben Morrow wrote:
> Quoth "Paul Lalli" <mritty@gmail.com>:
>>Jørn Dahl-Stamnes wrote:
>>>Paul Lalli wrote:
>>>>Page 184 in the Regexp section on Caputring and Clustering, and page
>>>>668 in the list of all special variables.   In the 3rd edition, at
>>>>least. . .
>>>I only got the 2nd edition... :-(
>>>And it does not have any "Update book" function... guess I must buy a new
>>>version.
>>You should *really* *really* consider doing so.  Perl has changed quite
>>a bit since version 5.0 was released, which is what the 2nd ed of the
>>Camel covers.
> 
> OTOH, Perl has also changed quite a bit since 5.6.0, which is what the
> Blue Camel covers.

Both the 2nd and 3rd editions have blue covers.


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: Wed, 8 Nov 2006 18:13:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: sorting array in multiple columns
Message-Id: <slrnel4slf.k7p.tadmc@tadmc30.august.net>

kenlo888@gmail.com <kenlo888@gmail.com> wrote:

> I have data in an array like:
>
> (1,'black'), (2,'black'), (1,'orange'), (2,'brown'), (1,'green')


OK, if you say so...


-------------------------------
#!/usr/bin/perl
use warnings;
use strict;

my @array = (1,'black'), (2,'black'), (1,'orange'), (2,'brown'), (1,'green');
print "unsorted:\n";
print "$_\n" for @array;

print "\n";
print "there are ", scalar(@array), " elements in \@array\n";
print "\n";

my @sorted = sort @array;
print "sorted:\n";
print "$_\n" for @sorted;
-------------------------------

outputs:
Useless use of a constant in void context at ./temp line 5.
Useless use of a constant in void context at ./temp line 5.
Useless use of a constant in void context at ./temp line 5.
Useless use of a constant in void context at ./temp line 5.
Useless use of a constant in void context at ./temp line 5.
Useless use of a constant in void context at ./temp line 5.
unsorted:
1
black

there are 2 elements in @array

sorted:
1
black


> I want to sort the first column, then the second column.


There are only 2 elements in your array, and they are already
in sorted order.

Have you seen the Posting Guidelines that are posted here frequently?


> @sorted_Array=sort{$a->[$sort_row]cmp$b->[$sort_row]}@array;


Whitespace is not a scarce resource, feel free to use as much of it
as you like to make your code easier to read and understand.

   @sorted_Array = sort { $a->[$sort_row] cmp $b->[$sort_row] } @array;


> If you have any examples of
> multiple row sorts, that would be great.


Everybody, including you, already have examples of multiple row sorts
on their own hard disks.

   perldoc -q sort

Please check the Perl FAQ *before* posting to the Perl newsgroup!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 8 Nov 2006 17:55:01 -0800
From: "Chris Johnson" <effigies@gmail.com>
Subject: Re: What is the diff between PerlCE and Perl?????????
Message-Id: <1163037301.669807.141680@k70g2000cwa.googlegroups.com>


Paviii wrote:
> Hi,
> I want to know is there any difference between PerlCE and Perl???

I'm curious what the semantic difference between "???" and "?" is.

Also, are you familiar with Google? I just searched for "perlce", and
the first result points to the project page, which is entitled "Perl
for WinCE devices". And if we pretend for the moment that we don't know
what Windows CE is, Google answers that question too.



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

Date: 8 Nov 2006 20:43:06 -0800
From: "grocery_stocker" <cdalten@gmail.com>
Subject: Re: What is the diff between PerlCE and Perl?????????
Message-Id: <1163047386.179722.198630@b28g2000cwb.googlegroups.com>


Chris Johnson wrote:
> Paviii wrote:
> > Hi,
> > I want to know is there any difference between PerlCE and Perl???
>
> I'm curious what the semantic difference between "???" and "?" is.
>
> Also, are you familiar with Google? I just searched for "perlce", and
> the first result points to the project page, which is entitled "Perl
> for WinCE devices". And if we pretend for the moment that we don't know
> what Windows CE is, Google answers that question too.

I pretend we live in a world full of peace and harmony. I then pretend
I go stomping
through this world with my army boots. By the way, the heck is google?



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

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


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