[23909] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6111 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 06:05:39 2004

Date: Wed, 11 Feb 2004 03: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           Wed, 11 Feb 2004     Volume: 10 Number: 6111

Today's topics:
        [SpreadSheet::ParseExcel] How to get the Cell comment <FILTERjvsSPAM@india.ti.com>
        A Newbie Array Problem <iamdownloading@yahoo.com>
    Re: A Newbie Array Problem <tadmc@augustmail.com>
    Re: A Newbie Array Problem <uri@stemsystems.com>
    Re: A Newbie Array Problem <dwall@fastmail.fm>
        a2p (Scottie)
        a2p (Scottie)
    Re: a2p <usenet@morrow.me.uk>
    Re: Comparing a string to filenames in a directory <me@privacy.net>
    Re: Encrypt and Decrypt for text ... <spamhole@klaas.ca>
    Re: Encrypt and Decrypt for text ... (Walter Roberson)
    Re: excel export (John McNamara)
    Re: executing from command line (Eric SALGON)
        Help with https request (Michael Tully)
    Re: Help with https request <gnari@simnet.is>
    Re: How to call a perl script that returns nothing in a <noreply@gunnar.cc>
    Re: How to call a perl script that returns nothing in a <noreply@gunnar.cc>
        how to convert a string to an escaped string <lkirsh@cs.ubc.ca>
    Re: how to convert a string to an escaped string <noreply@gunnar.cc>
    Re: how to convert a string to an escaped string <lkirsh@cs.ubc.ca>
    Re: how to convert a string to an escaped string <noreply@gunnar.cc>
    Re: HTTP Get <tom@nosleep.net>
    Re: Launching an .exe <jurgenex@hotmail.com>
    Re: Perl usage these days? thumb_42@yahoo.com
    Re: Regex: How to escape + sign? (J. Romano)
    Re: Software Quality & Fault Measurement <jackklein@spamcop.net>
    Re: substitution fails for long line <a__pranav@rediffmail.com>
    Re: UNIX Find on Windows <lv@aol.com>
    Re: use IO::Socket; <tom@nosleep.net>
    Re: use IO::Socket; <tom@nosleep.net>
        why does chomping a list remove all its elements <lkirsh@cs.ubc.ca>
    Re: why does chomping a list remove all its elements <noreply@gunnar.cc>
    Re: Why is Perl losing ground? (John M. Gamble)
    Re: Why is Perl losing ground? <dd-b@dd-b.net>
    Re: Why is Perl losing ground? <bart.lateur@pandora.be>
    Re: Why is Perl losing ground? <bart.lateur@pandora.be>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 11 Feb 2004 09:58:59 GMT
From: Jahagirdar Vijayvithal S <FILTERjvsSPAM@india.ti.com>
Subject: [SpreadSheet::ParseExcel] How to get the Cell comment
Message-Id: <c0cud3$5js$1@home.itg.ti.com>

I am trying to Parse  a set of Excelsheet's using
SpreadSheet::ParseExcel and need to access the Comment field foreach
cell where applicable. The doc does not specify any attribute for
comments. I tried loading the code snippet provided in the document
synopsys with a sample xls sheet in the perl debugger and examined the
value of each element of the hash but was not able to find the comment
string.
Is there a way to access the comment field for a given cell using this
module? 
Regards
Jahagirdar Vijayvithal S



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

Date: 10 Feb 2004 20:26:52 -0600
From: Perl Newbie <iamdownloading@yahoo.com>
Subject: A Newbie Array Problem
Message-Id: <402992ec_1@127.0.0.1>

Here's my problem.

I have an array of email addresses.  (No, I'm not spamming)  The  
addresses are for about 15 different domains, so they are mixed 
in both usernames and domain names.  Some of the usernames are 
the same for different domains, and may appear more than once 
for each domain.

For example...

array =  a@a, b@a, c@a, a@a, a@b, b@b, c@b, a@d

I'm wanting to parse/sort/massage such that I get a report that 
says something like

domain a = 4 entries
           a = 2
           b = 1
           c = 1

domain b = 3 entries
           a = 1
           b = 1 
           c = 1

domain d = 1 entry
           a = 1

a = 4
b = 2
c = 2

I'm not worried about formatting the report, just how to parse 
over the original array and pull the info out.  Obviously I'm 
going to have to split each array element on @ and work with 
each half of the element.  But this is a bit deep for me.  I'd 
like to work it out myself, but if someone can give me a gentle 
push in the right direction, I'd be grateful.



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


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

Date: Tue, 10 Feb 2004 21:36:40 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: A Newbie Array Problem
Message-Id: <slrnc2j8q8.64f.tadmc@magna.augustmail.com>

Perl Newbie <iamdownloading@yahoo.com> wrote:

> array =  a@a, b@a, c@a, a@a, a@b, b@b, c@b, a@d
> 
> I'm wanting to parse/sort/massage such that I get a report that 
> says something like
> 
> domain a = 4 entries
>            a = 2
>            b = 1
>            c = 1
> 
> domain b = 3 entries
>            a = 1
>            b = 1 
>            c = 1
> 
> domain d = 1 entry
>            a = 1
> 
> a = 4
> b = 2
> c = 2


Once you discover a good data structure, the coding it up is easy(ish).


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

my @array =  qw/ a@a b@a c@a a@a a@b b@b c@b a@d /;

my %domains;  # a hash-of-hashes (HoH)
foreach my $adr ( @array ) {
   my($acct, $domain) = split /@/, $adr;
   $domains{$domain}{$acct}++;
}

my %acct_totals;
foreach my $domain ( sort keys %domains ) {
   my($total, @accts);
   foreach my $acct ( sort keys %{$domains{$domain}} ) {
      $acct_totals{$acct} += $domains{$domain}{$acct};
      $total              += $domains{$domain}{$acct};
      push @accts, "           $acct = $domains{$domain}{$acct}\n";
   }
   print "domain $domain = $total entries\n";
   print for @accts;
   print "\n";
}

print "$_ = $acct_totals{$_}\n" for sort keys %acct_totals;
-----------------------------


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


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

Date: Wed, 11 Feb 2004 04:39:21 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: A Newbie Array Problem
Message-Id: <x7isie9qme.fsf@mail.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:

  TM> my %acct_totals;
  TM> foreach my $domain ( sort keys %domains ) {
  TM>    my($total, @accts);
                    $acct_text


  TM>    foreach my $acct ( sort keys %{$domains{$domain}} ) {
  TM>       $acct_totals{$acct} += $domains{$domain}{$acct};
  TM>       $total              += $domains{$domain}{$acct};
  TM>       push @accts, "           $acct = $domains{$domain}{$acct}\n";
            $acct_text .= <<ACCT ;
           $acct = $domains{$domain}{$acct}
ACCT
  TM>    }
  TM>    print "domain $domain = $total entries\n";
  TM>    print 
  TM>    print "\n";

   print <<ACCT ;
domain $domain = $total entries
$acct_text
ACCT

  TM> }

  TM> print "$_ = $acct_totals{$_}\n" for sort keys %acct_totals;

no reason for the @accts array as you don't do anything but print it.

and just to keep mentioning my rule:

	print rarely, print late.

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: Wed, 11 Feb 2004 05:59:51 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: A Newbie Array Problem
Message-Id: <Xns948CA255E9C2dkwwashere@216.168.3.30>

Uri Guttman <uri@stemsystems.com> wrote:

> and just to keep mentioning my rule:
> 
>      print rarely, print late.

We can call it Guttman's Output Rule, then you can be Uri of GOR.



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

Date: 10 Feb 2004 19:11:52 -0800
From: Scott_Starker@sil.org (Scottie)
Subject: a2p
Message-Id: <899d28b2.0402101911.534c97d0@posting.google.com>

I have a bunch of awk programs which I want to convert to Perl. I have
a Windows XP system which includes DOS. I'm learning Perl. Where can I
find the a2p?

Scottie


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

Date: 10 Feb 2004 21:46:25 -0800
From: Scott_Starker@sil.org (Scottie)
Subject: a2p
Message-Id: <899d28b2.0402102146.299abd2f@posting.google.com>

I'm learning Perl and I want to covert awk scripts to Perl using DOS.
Can you tell me where to look?

Scott


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

Date: Wed, 11 Feb 2004 03:56:56 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: a2p
Message-Id: <c0c968$30e$1@wisteria.csv.warwick.ac.uk>


Scott_Starker@sil.org (Scottie) wrote:
> I have a bunch of awk programs which I want to convert to Perl. I have
> a Windows XP system which includes DOS.

No it doesn't (thank God).

> I'm learning Perl.

If you're learning Perl, the output of a2p is not a good place to
start. If you just want to get the things working under win32,
though... 

> Where can I find the a2p?

 ...you can get perl for windows from activestate.com. a2p is included.

Ben

-- 
And if you wanna make sense / Whatcha looking at me for?          (Fiona Apple)
                            * ben@morrow.me.uk *


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

Date: Wed, 11 Feb 2004 20:21:53 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: Comparing a string to filenames in a directory
Message-Id: <c0cl9r$15crb7$1@ID-172104.news.uni-berlin.de>


"nj_perl_newbie" <aotoole@optonline.net> wrote in message
news:d7fb9254.0402101129.6b9130a1@posting.google.com...
> Thanks for the quick feedback.

Who are you talking to?  Please learn how to reference, attribute and quote
correctly.

>
> I have made some edits based on your suggestions, and I have a better
> unserstanding of what was happening in the script.

Unfortunately, you ignored most of the good suggestions.

> I still do not
> understand how the script knows that it should compare the second
> field in the file to the filenames in the limbo dir.
>

[snip of essentially the same script as the original]




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

Date: 11 Feb 2004 06:56:58 GMT
From: Klaas <spamhole@klaas.ca>
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <Xns948BE9C5BE28Fnothing@209.98.50.131>

After careful consideration, Gregory Toomey muttered:

> The best known algorithm is DES
> http://www.itl.nist.gov/fipspubs/fip46-2.htm

Surely you jest?  DES can be broken in a matter of hours.  AES is the 
current standard.

-Mike


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

Date: 11 Feb 2004 08:24:15 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <c0corf$j5q$1@canopus.cc.umanitoba.ca>

In article <Xns948BE9C5BE28Fnothing@209.98.50.131>,
Klaas  <spamhole@klaas.ca> wrote:
:Surely you jest?  DES can be broken in a matter of hours.

Yes, it can be broken in a matter of hours -- if you devote several
thousand computers to the task. I would tend to doubt anyone would
bother for whatever the original poster intended to use the
encryption for.

Encryption doesn't have to be perfect: it just has to be good
enough to not be worth the bother of breaking.
-- 
   I was very young in those days, but I was also rather dim.
   -- Christopher Priest


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

Date: 11 Feb 2004 01:22:05 -0800
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: excel export
Message-Id: <8cceb2da.0402110122.ec5891d@posting.google.com>

naren wrote:

> But the script is failing at $workbook->add_worksheet(), 
> here is the error message:
> ---
> Can't locate object method "add_worksheet" via package
> "Spreadsheet::WriteExcel" (perhaps you forgot to load
> "Spreadsheet::WriteExcel"?) at /cgi-excel.pl line 19.

Hi,

The method names add_worksheet() and add_format() were added in
version 0.41 of the Spreadsheet::WriteExcel. From the changelog:

0.41 April 24 2003 - Minor

    ! Renamed addworksheet() and addformat() to add_worksheet()
      and add_format() for consistency with other method names.
      Older names are supported but deprecated.


If you have an older version use addworksheet() and addformat()
instead.

John.
--


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

Date: Wed, 11 Feb 2004 07:03:07 +0000 (UTC)
From: eric.salgon@mane.com (Eric SALGON)
Subject: Re: executing from command line
Message-Id: <c0ck3b$c7d$1@s1.read.news.oleane.net>

That's right, if fact it's a way to run a command remotely. But it works now 
!!!

Basically the problem was that I'm trying to execute a system command with an 
"anonymous" account. With an administrative account who has right to log on 
locally on the server, it's much better (of course ...)

I have appreciated your efficient help 

Thanks to all

Eric


In article <LCEUb.19176$xq.8881@newssvr16.news.prodigy.com>, ceo@nospan.on.net 
says...
>
>Monkey Man wrote:
>> Hey there,
>> I have a perl script that i would like to run it on a windows server.  
Since
>> there is no command line with windows, i want to execute script from a web
>> page.  Is that possible?  Or am i just dreaming?
>> 
>
>I think Brian McCauley successfully interpretted your question here, and 
>now you can, with his help, receive a reasonable answer.
>
>Yes, you can do this with Windows (assuming Brian is right and I think 
>he is -- you want to know if you can host a web page that executes a 
>command on another machine and writes the results of the commend 
>executed on the remote machine to a web page), but just be aware you are 
>opening up a (huge) security hole on the remote machine when you do this.
>
>On Windows, you can do this natively in ASP, or you can do it through a 
>Perl CGI script.
>
>See these programs for direction here:
>
>CGI: 
>http://www.technologease.com/cgi-bin/listing.cgi?config=resume&tmpl=listing&s
etid=2&progid=3
>
>ASP: 
>http://www.technologease.com/cgi-bin/listing.cgi?config=resume&tmpl=listing&s
etid=5&progid=1
>
>Both are written in Perl.  One is CGI and the other requires the 
>PerlScript Classic ASP engine installed.  If you want to (horrors) do 
>this in VBScript, then the essential code is:
>
>Sub Shell( strCmd )
>    Set WshShell = Server.CreateObject( "WScript.Shell" )
>    Set oExec = WshShell.Exec( "%COMSPEC% /c " & strCmd )
>    Set oExec = Nothing
>    Set WshShell = Noting
>End Sub
>
>I'll leave it to you to translate the complete Perl examples I gave you 
>above into VBScript using the above fragment if you want since this IS a 
>Perl NG and other than providing you with Perl code to do what (I think) 
>you want, this has nothing to do with Perl.  (I should be shot for 
>posting VB code, probably.)
>
>I would post a disclaimer about you opening up some huge security hole 
>using the above code, but since your target is a Windows box, no 
>disclaimer will be necessary since Windows is basically Swiss Cheese 
>right out of the box as it is...  8-(  But don't blame me if you get 
>into trouble with the above code.  I run that code, but locked down 
>(which I won't get into here.)
>
>Finally, Windows DOES have a remote command utility called RCMD which 
>you can install from the Windows Resource Kit CD...
>
>Chris
>-----
>Chris Olive
>chris -at- --spammers-are-vermin-- technologEase -dot- com
>http://www.technologEase.com
>(pronounced "technologies")



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

Date: 10 Feb 2004 20:46:01 -0800
From: michael@dntenterprises.com (Michael Tully)
Subject: Help with https request
Message-Id: <395feb14.0402102046.59c7ac33@posting.google.com>

I am trying to get a page from a secured site that uses digital
certificates and https. I am using LWP and CRYPT::SSLEAY for accessing
the site. The question that I have has been perplexing me for days...

If I go to the site and request the page in question, I can do a 'View
Source' and see all the <Option> tags just fine within the only form
that is on the page, but when I request the page via LWP, I get the
first <Option> tag (Which happens to be the one that is 'selected'),
but then the rest do not show up.

Any ideas?

Thanks in advance,

Michael Tully
Web Developer, Sempra Energy Trading


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

Date: Wed, 11 Feb 2004 08:48:53 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Help with https request
Message-Id: <c0cq7s$j97$1@news.simnet.is>

"Michael Tully" <michael@dntenterprises.com> wrote in message
news:395feb14.0402102046.59c7ac33@posting.google.com...
> I am trying to get a page from a secured site that uses digital
> certificates and https. I am using LWP and CRYPT::SSLEAY for accessing
> the site. The question that I have has been perplexing me for days...
>
> If I go to the site and request the page in question, I can do a 'View
> Source' and see all the <Option> tags just fine within the only form
> that is on the page, but when I request the page via LWP, I get the
> first <Option> tag (Which happens to be the one that is 'selected'),
> but then the rest do not show up.

maybe you are just printing the content to a terminal. if the option
tags are in lines terminated only with \r, it may look like some
lines are missing

output it to a file and examine it by using a browser, or a tool like 'od',
or just do s/\r/\n/g before printing

gnari






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

Date: Wed, 11 Feb 2004 10:33:24 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to call a perl script that returns nothing in an HTML
Message-Id: <c0ct1r$15e8af$1@ID-184292.news.uni-berlin.de>

Danny wrote:
> Newbie here

So what? ;-)

> Thanks for the help with this command:
> 
> print "Status: 204 No Content\n\n";
> which returns nothing in a perl script.

You're welcome, but you should have replied to a message in the same
thread instead of starting a new thread.

> This is great because I just want my perl script to increment a
> counter and put result in a text file which it does fine how.
> But now how do I call this from an .html?  I used to call it like
> this <img src="path to cgi script">

Aha. I took for granted that the script was invoked through SSI.

> this increments the counter but there is a little box where an
> actual image should be, so how do I:
> 1. have the script return a bogus image (using below)
> 
>       print "Content-type: image/gif\n\n";
>       (not sure how I would print a graphic here)

Personally I haven't played much with images, but I suppose you can
do:

     print "Content-type: image/gif\n\n";
     open IMG, '< /path/to/blank.gif' or die "Couldn't open image $!";
     print while <IMG>;

> 2. or have the call html file run this script somehow without using
> the image tag so I dont get that little empty graphic display.

You can invoke it via SSI:

     <!--#exec cgi="path to cgi script" -->

Note that the HTML file may need to have the extension .shtml for that
to work. (And SSI must be enabled on the server, of course.)

Have you considered to use some other counter script that does not
make use of any executable? Or write your own?

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



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

Date: Wed, 11 Feb 2004 11:03:46 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to call a perl script that returns nothing in an HTML
Message-Id: <c0cuqk$165gep$1@ID-184292.news.uni-berlin.de>

Gunnar Hjalmarsson wrote:
> 
>     print "Content-type: image/gif\n\n";
>     open IMG, '< /path/to/blank.gif' or die "Couldn't open image $!";
>     print while <IMG>;

Should better be:

     print "Content-type: image/gif\n\n";
     open IMG, '< /path/to/blank.gif' or die "Couldn't open image $!";
     binmode IMG;
     print while <IMG>;

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



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

Date: Wed, 11 Feb 2004 01:35:47 -0800
From: Lowell Kirsh <lkirsh@cs.ubc.ca>
Subject: how to convert a string to an escaped string
Message-Id: <c0ct1k$qgu$1@mughi.cs.ubc.ca>

I want to convert:
   blah blah "foo" blah
to
   blah\ blah\ \"foo\"\ blah

Is there an easy way to do it?

Lowell


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

Date: Wed, 11 Feb 2004 10:39:29 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to convert a string to an escaped string
Message-Id: <c0ctd2$15e8af$2@ID-184292.news.uni-berlin.de>

Lowell Kirsh wrote:
> I want to convert:
>   blah blah "foo" blah
> to
>   blah\ blah\ \"foo\"\ blah

Seems as if you just did so.

> Is there an easy way to do it?

Wasn't the way you used easy enough?

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



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

Date: Wed, 11 Feb 2004 01:43:13 -0800
From: Lowell Kirsh <lkirsh@cs.ubc.ca>
Subject: Re: how to convert a string to an escaped string
Message-Id: <c0ctfi$qj3$1@mughi.cs.ubc.ca>

Very funny... How about a perl function that can convert a string to 
another string in which special chars are represented as escaped 
versions of themselves...

Gunnar Hjalmarsson wrote:

> Lowell Kirsh wrote:
> 
>> I want to convert:
>>   blah blah "foo" blah
>> to
>>   blah\ blah\ \"foo\"\ blah
> 
> 
> Seems as if you just did so.
> 
>> Is there an easy way to do it?
> 
> 
> Wasn't the way you used easy enough?
> 


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

Date: Wed, 11 Feb 2004 10:49:46 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to convert a string to an escaped string
Message-Id: <c0cu0c$15l6qu$1@ID-184292.news.uni-berlin.de>

Lowell Kirsh wrote:
> Very funny...

Glad you think so. Don't top post, btw.

> How about a perl function that can convert a string to 
> another string in which special chars are represented as escaped 
> versions of themselves...

Yes, there is such a function.

     perldoc -f quotemeta

Why didn't you just look it up instead of posting here?

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



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

Date: Tue, 10 Feb 2004 20:52:09 -0800
From: "Tom" <tom@nosleep.net>
Subject: Re: HTTP Get
Message-Id: <4029be18$1@nntp0.pdx.net>

> > Using NTTP, they always showed up, but can't use that anymore, getting
bad
> > requests.
>
> Rip out all the IO code in your program and replace it with
>    use LWP::Simple;
> It will take care of all the "bad request" problems.
> -Joe

Thanks, already did this and it works great.




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

Date: Wed, 11 Feb 2004 05:09:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Launching an .exe
Message-Id: <1OiWb.9671$%X3.5059@nwrddc01.gnilink.net>

lmm wrote:
[...]
> The problem I am having is that the the script stops after the
> executable is launched. [...]
> I have tried the following code to launch the exe:
>
> my $exe = '"C:/Program Files/SonicWALL/SonicWALL Global VPN
> Client/SWGVpnClient.exe"' ;
> exec $exe ;

Well, if you ask the Perl interpreter to replace itself with the program,
then how do expect the Perl script to continue?

Please read the documentation for the functions you are using.
"perldoc -f exec":
     The "exec" function executes a system command *and never
     returns*-- [...]
     Since it's a common mistake to use "exec" instead of "system",
     Perl warns you if there is a following statement.

jue




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

Date: Wed, 11 Feb 2004 02:33:42 GMT
From: thumb_42@yahoo.com
Subject: Re: Perl usage these days?
Message-Id: <awgWb.277936$na.440399@attbi_s04>

pkent <pkent77tea@yahoo.com.tea> wrote:
 
> It could be that the sites you happen to use are ones that seem to use 
> PHP or Java, and you don't visit sites that seem to use perl.

True, I suppose people could be using the .php extension for anything, but I
can't see why one would do that. (also, .html's are in many cases perl I
know, because I've done that myself. :-)

> Anyway, to answer your original question we use perl to provide several 
> hundred metric shedloads of dynamic content, a lot of constantly-updated 
> content, searches, quizzes, games, user personalization, community 
> software, message boards, weather forecasts, geographical data, 
> syndication feeds, data capture, and Much Much More, and that's just the 
> stuff on the web site.

Have you ever regretted using perl? Ever get any flack from others about
using it, and are there maintenance issues that say, wouldn't be there with
other languages? 

Have you considered going with PHP/JSP/etc.. on the web side, but having
those languages talk to a perl daemon? (I didn't ask would you consider, I
wonder if you had already or perhaps the manager types tried to push it.)

I've used perl on large projects before, I liked parts of it. seemed to work
pretty good overall, except for the web interface stuff. (was an N-tier
design) 

But, I got tons of flack for the 'perl' part. When I left they re-did all my
work using EJB's. (and then the company more or less fell over.. :-/ )

Now I'm wondering, if I ever do anything commercial, would it happen it
again?

It's kind of funny I went to one of suns java conventions. Got into
conversations with people and sometimes when I'd say (somewhat shyly, this
was a flipping java convention afterall) that my main project was in perl,
the reaction was a hushed 'cool', I got the impression some of the
developers there would actually perfer perl.

Jamie









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

Date: 10 Feb 2004 18:35:03 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Regex: How to escape + sign?
Message-Id: <b893f5d4.0402101835.16a5dc3b@posting.google.com>

Vito Corleone <corleone@godfather.com> wrote in message news:<20040210191503.022fb2ac.corleone@godfather.com>...

> How can I escape + sign from regex?
> 
> Here is what I did:
>
> $text = "C++";
> $source = "Perl c++ c-- Java C-- C++";
> $source =~ s#$text#<b>$text</b>#ig;

Vito,

   Another way to do that is to change the line:

      $text = "C++";

to:

      $text = quotemeta("C++");

   This will escape all non-alphanumeric characters so that the '+'
signs will match only to '+' signs if placed in a regular expression. 
You can even print out $text after you set it to see what it looks
like -- it might help you understand what is happening.

   -- Jean-Luc


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

Date: Wed, 11 Feb 2004 02:24:49 GMT
From: Jack Klein <jackklein@spamcop.net>
Subject: Re: Software Quality & Fault Measurement
Message-Id: <2h4j20hp3tkhm11lq6ptu7rl103f72c458@4ax.com>

On Tue, 10 Feb 2004 06:58:32 +0000 (UTC), Michael Kelly
<kelly@cs.dal.ca> wrote in comp.lang.c:

> I'm trying to locate information on quality measurement studies that have 
> been done on projects using C, C++, Ada, Java, and Perl. I'm particularly 
> interested in materials regarding fault measurements. Any pointers would 
> be greatly appreciated.
> 
> If these are not the proper newsgroups to post this to, please disregard.
> 
> thanks,
> -Mike

I would say that this if off-topic in every group you posted it to,
with the possible exception of the advocacy group.

The groups you want are:

news:comp.programming

news:comp.software-eng

-- 
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html


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

Date: Wed, 11 Feb 2004 11:54:49 +0530
From: "Pranav Agarwal" <a__pranav@rediffmail.com>
Subject: Re: substitution fails for long line
Message-Id: <X0kWb.27$XU5.174@news.oracle.com>

Thanks for the reply!
You were correct, this regex completes after taking a lot of time more than
1 hour.
my actual regular expression was taking around 4 hrs to complete.
You input really helped me to solve the problem.
In a part of my regular expression I was matching with the white spaces at
multiple places, I have removed that from the original regex and implemented
the same in new regex for the subset of the the sentence.

Thanks again for your useful input.

Regards,
-Pranav.


<ctcgag@hotmail.com> wrote in message
news:20040209202603.919$C8@newsreader.com...
> "Pranav Agarwal" <a__pranav@rediffmail.com> wrote:
> >
> > The problem I am facing is when i try to run my a.pl i.e.
> > open(FH,"$ARGV[0]");
> > while(<FH>){
> >    $x=$_;
> >    $len = length($_);
> >    print ("$len\n");
> >    $x =~ s/(\s*)(nothingtomatch)/$1/g;
> >    print $x;
> > }
> > My perl program hangs when the value for $_ is that particular long
line.
> > %perl a.pl x.1
> > 20
> > <H3>References</H3>
> > 23646
> > ^C (!!! HANGED !!!)
>
> Is it spinning the CPU or is just sleeping?
>
> What is the exact regex you are matching?  If the regex engine
> has to march back and forth over a very long line a very high number
> of times, it may take a very long time to do it.
>
> Xho
>
> -- 
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service              New Rate! $9.95/Month 50GB




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

Date: Tue, 10 Feb 2004 21:58:29 -0600
From: l v <lv@aol.com>
Subject: Re: UNIX Find on Windows
Message-Id: <FLhWb.6479$5M.212727@dfw-read.news.verio.net>

Brian wrote:
> I'm fairly new to using Perl on Windows.  I need to find all of the
> files in a folder and its sub folders that match a pattern.  On UNIX I'd
> do:
> 
> $FOUND = `find $DIRROOT -name "$PATTERN" -print`;
> 
> Is there a way to do this on Windows using Perl and/or native Windows
> commands?
> 
> Brian
If you must backtic

$FOUND = `dir /b /s c:\\dir\\*.txt`;

/b give just the file name
/s search sub dirs

However, depending on how much of a pattern $PATTERN is, you might want 
to use File::Find as others have suggested.

Len



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

Date: Tue, 10 Feb 2004 20:53:10 -0800
From: "Tom" <tom@nosleep.net>
Subject: Re: use IO::Socket;
Message-Id: <4029be55$1@nntp0.pdx.net>


"Ben Morrow" <usenet@morrow.me.uk> wrote in message
news:c0732d$pss$1@wisteria.csv.warwick.ac.uk...
>
> "Tom" <tom@nosleep.net> wrote:
> > Hi
> >
> > I've been using use IO::Socket;
> >
> > and this to get web pages for a long time now, without problems:
> >
> >     $lrem = IO::Socket::INET->new(
> >               Proto => "tcp",
> >               PeerAddr => "$lhost",
> >              PeerPort => "http(80)",
> >             );
> >
> > Nothing has changed on my side, but now all I get 90% of the time is
this:
> >
> > Bad request
> > Your browser sent a request that this server could not understand.<P>
> >
> > client sent HTTP/1.1 request without hostname (see RFC2616 section
14.23):
> > /q<P>
>
> The problem is further down your program, where (presumably) you send
> an HTTP/1.1 request without supplying a Host: header.
>
> I would strongly suggest you use LWP, which will track changes to
> protocols like this.
>
> Ben

Thanks, already done and works great.




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

Date: Tue, 10 Feb 2004 20:53:30 -0800
From: "Tom" <tom@nosleep.net>
Subject: Re: use IO::Socket;
Message-Id: <4029be69$1@nntp0.pdx.net>


"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7n07skgdi.fsf@mail.sysarch.com...
>
> use LWP;
>
> uri
Roger...works great!




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

Date: Wed, 11 Feb 2004 02:16:31 -0800
From: Lowell Kirsh <lkirsh@cs.ubc.ca>
Subject: why does chomping a list remove all its elements
Message-Id: <c0cve1$qk7$1@mughi.cs.ubc.ca>

Why does the following not work?

open(FILES, "< musiclist2.txt");
@files = <FILES>;
print "unchomped\n";
print @files;
print "chomped\n";
chomp @files;
print @files;

It gives:

unchomped
(Cream) - the very best of cream
(Janis Joplin) - Greatest Hits
(Jethro Tull) - Heavy Horses
(Jethro Tull) - Thick As A Brick
chomped


Lowell


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

Date: Wed, 11 Feb 2004 11:42:53 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: why does chomping a list remove all its elements
Message-Id: <c0d141$15cc9q$1@ID-184292.news.uni-berlin.de>

Lowell Kirsh wrote:
> Subject: why does chomping a list remove all its elements

It doesn't.

Please post a *complete* script that people can copy and paste, and 
that, unlike the code you posted, illustrates the problem you say you 
have.

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



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

Date: Wed, 11 Feb 2004 02:06:25 +0000 (UTC)
From: jgamble@ripco.com (John M. Gamble)
Subject: Re: Why is Perl losing ground?
Message-Id: <c0c2n1$fco$4@e250.ripco.com>

In article <m2hdxz93jl.fsf@gw.dd-b.net>,
David Dyer-Bennet  <dd-b@dd-b.net> wrote:
>Ben Morrow <usenet@morrow.me.uk> writes:
>
>> Robert <bobx@linuxmail.org> wrote:
>>> David Dyer-Bennet wrote:
>>> <snip>
>>> > PHP out-performs Perl by a tremendous margin in a shared hosting
>>> > environment, which is where most sites are implemented.  mod_perl
>>> > doesn't isolate the various users enough to be very safe in a shared
>>> > hosting environment, and you need mod_perl to get performance.
>>> 
>>> mod_php out-performs mod_perl? Really? Show me the tests...
>>
>> No, he said mod_php outperforms CGI Perl (duh) and that he doesn't
>> trust mod_perl.
>
>Well, mostly.  I trust mod_perl just fine, so long as I'm the only
>user. 

Are there any real-world examples documenting mod_perl problems?
You've mentioned the concerns of sites that you've worked on, but
if they're just repeating something that they've heard, it may be
just something that's become urban legend.

-- 
	-john

February 28 1997: Last day libraries could order catalogue cards
from the Library of Congress.


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

Date: Tue, 10 Feb 2004 22:47:56 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: Why is Perl losing ground?
Message-Id: <m2d68m2pdv.fsf@gw.dd-b.net>

jgamble@ripco.com (John M. Gamble) writes:

> In article <m2hdxz93jl.fsf@gw.dd-b.net>,
> David Dyer-Bennet  <dd-b@dd-b.net> wrote:
>>Ben Morrow <usenet@morrow.me.uk> writes:
>>
>>> Robert <bobx@linuxmail.org> wrote:
>>>> David Dyer-Bennet wrote:
>>>> <snip>
>>>> > PHP out-performs Perl by a tremendous margin in a shared hosting
>>>> > environment, which is where most sites are implemented.  mod_perl
>>>> > doesn't isolate the various users enough to be very safe in a shared
>>>> > hosting environment, and you need mod_perl to get performance.
>>>> 
>>>> mod_php out-performs mod_perl? Really? Show me the tests...
>>>
>>> No, he said mod_php outperforms CGI Perl (duh) and that he doesn't
>>> trust mod_perl.
>>
>>Well, mostly.  I trust mod_perl just fine, so long as I'm the only
>>user. 
>
> Are there any real-world examples documenting mod_perl problems?
> You've mentioned the concerns of sites that you've worked on, but
> if they're just repeating something that they've heard, it may be
> just something that's become urban legend.

As I recall, it's based on warnings in the mod_perl documentation.
-- 
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com> <http://www.dd-b.net/carry/>
Photos: <dd-b.lighthunters.net>  Snapshots: <www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>


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

Date: Wed, 11 Feb 2004 08:45:59 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Why is Perl losing ground?
Message-Id: <1sqj209luoot22t251d1a0q92g1tfhgjar@4ax.com>

Tore Aursand wrote:

>I really don't understand this argument:  What do you actually mean with
>"isolation between clients"?

It means that if you mess things up in one client's setup, it'll affect
everybody.

mod_perl is global, across virtual hosts. It's a major drawback, also
making it unsafe to experiment on a server where a live site is running.

-- 
	Bart.


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

Date: Wed, 11 Feb 2004 09:15:23 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Why is Perl losing ground?
Message-Id: <n3sj20p1fcv0624dul56dfl8qr1r4rohnt@4ax.com>

Matija Papec wrote:

>Are you aware that C isn't replaceable when it comes to platform
>portability?

C isn't portable, that's just an illusion. 

	<http://www.kuro5hin.org/story/2004/2/7/144019/8872>

There's a header "Portability?!", but no anchor.

-- 
	Bart.


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

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


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