[23149] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5370 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 16 00:05:59 2003

Date: Fri, 15 Aug 2003 21:05:09 -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           Fri, 15 Aug 2003     Volume: 10 Number: 5370

Today's topics:
    Re: 'make' implemented in Perl <pkent77tea@yahoo.com.tea>
    Re: Can't see http_referrer in IE <pkent77tea@yahoo.com.tea>
    Re: finding subdirectories without parsing every file (James Willmore)
    Re: hand crafting soap for google api's <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: hand crafting soap for google api's <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: hand crafting soap for google api's <uri@stemsystems.com>
    Re: hand crafting soap for google api's <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: hand crafting soap for google api's (Tad McClellan)
    Re: hand crafting soap for google api's <uri@stemsystems.com>
    Re: hand crafting soap for google api's <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: How to create a  Perl module to be used in a CGI sc (David Efflandt)
    Re: How to create an array from a string? (Tad McClellan)
    Re: How to create an array from a string? <spamblock@junkmail.com>
    Re: HTTP::Request failed on HTTP/1.1 and Connection: Ke (trwww)
        MIME::Lite won't send simple email with "foreign" chars <mbudash@sonic.net>
    Re: Newbie: How to read metadata from a windows DLL <jkeen@concentric.net>
    Re: Newbie: How to read metadata from a windows DLL <bwalton@rochester.rr.com>
    Re: Perl and recursive copying? (James Willmore)
    Re: Perl and recursive copying? (Tad McClellan)
        Perl for Sharp SL-5500 Zaurus (Linux PDA) <spamblock@junkmail.com>
    Re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc <uri@stemsystems.com>
    Re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc <uri@stemsystems.com>
    Re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc <uri@stemsystems.com>
    Re: strange error  "Unsuccessful stat on filename " (James Willmore)
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 16 Aug 2003 04:59:55 +0100
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: 'make' implemented in Perl
Message-Id: <pkent77tea-678998.04595516082003@usenet.force9.net>

In article <eto3cg5mk92.fsf@wormtongue.emschwar>,
 Eric Schwartz <emschwar@pobox.com> wrote:

> Ted Zlatanov <tzz@lifelogs.com> writes:
> > Actually there's quite a few Perl users, myself included, who think a
> > Perl-based make would be much better than relying on the standard
> > one that may or may not be installed, available, or functioning.  For
> > modules that require C compilation, maybe.  But for pure Perl
> > installs?  That's silly, given Perl's power.
 ...

I missed the start of this thread but this reminds me of:
http://magnonel.guild.net/~schwern/talks/MakeMaker_Is_DOOMED/slides/

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: Sat, 16 Aug 2003 04:56:06 +0100
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Can't see http_referrer in IE
Message-Id: <pkent77tea-BC1133.04560616082003@usenet.force9.net>

In article <Pine.LNX.4.53.0308131159100.755@lxplus081.cern.ch>,
 "Alan J. Flavell" <flavell@mail.cern.ch> wrote:

> pkent said:
> > It probably depends on your web server software
> This appears to have been a stealth CGI question.  Why should it
> depend?

Because all software sucks, obviously. I know that the above works for 
me but it may not work for the OP.

> > but on my Apache setup the environment variable is called
> > 'HTTP_REFERER'.
> There is a CGI interworking specification.  The whole _point_ of the
> CGI is that it's portable.  If it wasn't portable, then we'd be much
> better off using server-specific APIs.

Ah, so exactly when did I arrive on the planet where people always 
adhered to specs? (why yes I have been building software on assorted 
OSes *sigh*)

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: 15 Aug 2003 20:31:05 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: finding subdirectories without parsing every file
Message-Id: <e0160815.0308151931.95ce925@posting.google.com>

helen@helephant.com (Helen) wrote in message news:<33517f44.0308142312.52443236@posting.google.com>...
<snip>
> On the page where I'm doing the recursing it prints out only the
> subdirectories of the site that don't belong to another subsite. So
> it's really only looking at a small part of the tree. The problem is
> that "small" is a relative term. I'm testing it with a subsite that
> has 800 subdirectories (and over 9000 files) as a worst case scenario
> (which isn't the biggest site on the server). I'm not sure I'll be
> able to get the load time to anywhere near 10 seconds, but I like
> working with such a large site because the effects of changing parts
> of the script are exagerated.

If you want to do benchmarking, you can use the Benchmark module. 
This should give you a snapshot of how the changes you make far as far
as time and CPU are concerned.

> 
> The subsites are stored in a database, but the first thing I did was
> make sure that all the database accesses happened at the same time. So
> there are only two calls to the database (no matter how big the tree
> gets) and they both use the same database handle. The database stuff
> happens before I go looking for the subdirectories.
> 
> my $nodePath = "$basePath/".$node->getDirectory();
> find(\&wanted, "$basePath/".$node->getDirectory());
> 
> sub wanted {
> 	my $currentFile = $File::Find::name;
> 	if(-d $currentFile) {
> 		if($currentFile ne $nodePath) {
> 			my $newDir = $currentFile;
> 			$newDir =~ s/$basePath\///;
> 			
> 			# if this directory is actually a site, 
> 			# we only want to recurse it
> 			# if we're told to by the recurseSubSites parameter
> 			if(!$siteTree->isNodeSite($newDir)) {
> 				# if this directory isn't a site, 
> 				# add the directory to the site tree
> 				$siteTree->addDirectory($newDir);
> 			} elsif(!$recurseSubSites) {
> 				# we don't want to recurse any of this directory's subdirs
> 				$File::Find::prune = 1;
> 			} # end if
> 		} # end if
> 	} # end if
> } # end wanted

At first glance, it appears that you have everything in place to do
what you want.  Just a suggestion - given the amount of files you are
dealing with and what you want the end result to look like, have you
considered writing out to file in, maybe XML or CSV?  This would free
up memory and save the information you already processed in the event
your script is killed for some reason.  Then you could also just
process the directories with one script and do something with the
results with another.  Again, it's just a suggestion and may lead to
other issues.

HTH

Jim


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

Date: Fri, 15 Aug 2003 21:40:15 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <97drjv82ef9sce2j2856jgh05iumtunv1g@4ax.com>

>>>> &print_prompt($query);
>>>
>>>
>>>   perldoc -q "&"
>>>
>>>      What's the difference between calling a function as &foo and foo()?
>> 
>> to tell you the truth, I really don't understand the cgi.pm and rather
>> like doing it by hand, but this is old code from last month.
>
>
>That's nice, but it has nothing to do with the text that you quoted.
>
>I didn't say anything about CGI.pm or modules or even CGI programming.
>
>You are calling your functions incorrectly.

Oh...sorry Tad, the reason I mentioned CGI.pm is that I copied and
pasted that part a few weeks ago...I really don't understand CGI.pm so
well...I am much better off parsing the cgi myself. So when you
mentioned &print_prompt($query); it made me think of CGI.pm...

OK...so I got a lot of reading to do and will one day understand all
about calling functions ;-)


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

Date: Fri, 15 Aug 2003 21:43:34 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <didrjvs4jo2ma6favbmp0giboub080vm7f@4ax.com>

On Fri, 15 Aug 2003 09:10:31 -0500, tadmc@augustmail.com (Tad
McClellan) wrote:

>>>You really need to learn about "here-doc"s, see perlop.pod.
>
>> yes, but with the ".=" method, you get to see all your request on one
>> page ;-)
>
>
>Huh?
>
>You can see _more_ of the string with a here-doc than with cat-equals,
>so I dunno what you are talking about there...

Hmmmm...I am sure you are probably right and I am just being
strong-headed because I am in love with my own methods ;-)


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

Date: Sat, 16 Aug 2003 03:32:14 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <x7he4itgzm.fsf@mail.sysarch.com>

>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:

  H> Oh...sorry Tad, the reason I mentioned CGI.pm is that I copied and
  H> pasted that part a few weeks ago...I really don't understand CGI.pm so
  H> well...I am much better off parsing the cgi myself. So when you
  H> mentioned &print_prompt($query); it made me think of CGI.pm...

you don't understand parsing cgi queries at all. the virally spread code
you pasted is broken and insecure among other problems. again, the
module is tested, stable and easier to use (especially with complex
operations)

  H> OK...so I got a lot of reading to do and will one day understand all
  H> about calling functions ;-)

and about code reuse. now why don't you stop all this defensive behavior
and just realize that professionals reuse code for many good
reasons. you will learn them over time but in the meantime stop (poorly)
reinventing every wheel you see.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Fri, 15 Aug 2003 23:42:55 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <hdkrjvoacok3me2o9r9fsrgsqcsqdu26lm@4ax.com>

On Sat, 16 Aug 2003 03:32:14 GMT, Uri Guttman <uri@stemsystems.com> wrote:

>>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:
>
>  H> Oh...sorry Tad, the reason I mentioned CGI.pm is that I copied and
>  H> pasted that part a few weeks ago...I really don't understand CGI.pm so
>  H> well...I am much better off parsing the cgi myself. So when you
>  H> mentioned &print_prompt($query); it made me think of CGI.pm...
>
>you don't understand parsing cgi queries at all. the virally spread code
>you pasted is broken and insecure among other problems. again, the
>module is tested, stable and easier to use (especially with complex
>operations)
>
>  H> OK...so I got a lot of reading to do and will one day understand all
>  H> about calling functions ;-)
>
>and about code reuse. now why don't you stop all this defensive behavior
>and just realize that professionals reuse code for many good
>reasons. you will learn them over time but in the meantime stop (poorly)
>reinventing every wheel you see.
>
>uri

that's not true...I understand CGI parsing very well. CGI.pm I don't understand,
but understand that it is not so great. I don't use it. So the code I posted I
wrote last month before I got into CGI.

I know how to taint and untaint and what the dangers are...it is no big deal.

Stop being a troll with me...thank you.



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

Date: Fri, 15 Aug 2003 22:43:52 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: hand crafting soap for google api's
Message-Id: <slrnbjra3o.alj.tadmc@magna.augustmail.com>

Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:

> I am much better off parsing the cgi myself.


No you're not.

Get some liability insurance if you are getting paid for
this home-rolled form parsing.


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


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

Date: Sat, 16 Aug 2003 03:59:24 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <x71xvmtfqc.fsf@mail.sysarch.com>

>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:

  H> On Sat, 16 Aug 2003 03:32:14 GMT, Uri Guttman <uri@stemsystems.com> wrote:

  >> you don't understand parsing cgi queries at all. the virally spread code
  >> you pasted is broken and insecure among other problems. again, the
  >> module is tested, stable and easier to use (especially with complex
  >> operations)
  >> 
  H> that's not true...I understand CGI parsing very well. CGI.pm I
  H> don't understand, but understand that it is not so great. I don't
  H> use it. So the code I posted I wrote last month before I got into
  H> CGI.

i doubt you do. there is much more to it than just splitting query
strings. you have admitted you are a total beginner, so please drop the
attitude about how easy everything is. you don't know anything and
accept that truth for a long while. getting a simple setup like cgi or
soap to work on one shot bases is one thing. getting them to work for
all possible cases is another. but at least you are using CGI.pm now.

  H> I know how to taint and untaint and what the dangers are...it is no
  H> big deal.

  H> Stop being a troll with me...thank you.

hahah, i will stop helping you is what you mean. you don't know from
trolls either. just read moronzilla's stuff to see a real troll.

goodbye little kiddie,

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Sat, 16 Aug 2003 00:06:13 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <5tlrjvcq0lk9up8gslk3kh8b65dud9qn3n@4ax.com>

On Sat, 16 Aug 2003 03:59:24 GMT, Uri Guttman <uri@stemsystems.com> wrote:

>you have admitted you are a total beginner

stop it, uri..........!!

I am not a total beginner...ok, so I am not the expert either, but I think you
should knock off this crap.

Thanks,

Steve



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

Date: Sat, 16 Aug 2003 03:05:07 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: How to create a  Perl module to be used in a CGI script
Message-Id: <slrnbjr7r3.bf1.efflandt@typhoon.xnet.com>

On 15 Aug 2003 10:52:03 -0700, James <jwong1@mail.arc.nasa.gov> wrote:
> Hi, 
> 
> I have the following:
> 
> filename: Module1.pm
> 
> package Module1;
> 
> BEGIN {
>     use Exporter();
>     @ISA = qw(Exporter);
>     @EXPORT = qw(&subroutine1);
> }
> 
> sub subroutine1 {print "Hello!\n";}
> return 1;
> END { }
> ---------------------------------------------------
> Filename: Trial.cgi running in Tomcat 4.1.27
> 
> #!c:\Perl\bin\perl.exe
> 
> use CGI
> use Module1;
> 
> subroutine1();
> .
> .
> . 
> .
> 
> 
> When I run the script from my html page it asks for a file download. What am 
> I doing wrong?

Besides forgetting to output a Content-type header followed by a blank
line (unless your server somehow guesses that), I suspect you are using
MSIE, which does not necessarily pay attention to MIME headers anyway.  
So it guesses based on its own criteria, which might include filename
extension of the script.  If that filename extension is associated with
Perl.exe, it considers that insecure and asks if you want to download or
execute it (not that you would have normally much luck executing CGI
output).

Note that MSIE considers "Content-type: text/plain" to be ambiguous (since
it often a default for unknown filetypes), and would go through its
guessing game for any text/plain content.

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Fri, 15 Aug 2003 20:05:40 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How to create an array from a string?
Message-Id: <slrnbjr0r4.ahm.tadmc@magna.augustmail.com>

Francesco Moi <francescomoi@europe.com> wrote:

> I would like to create an array from a string.


That is a bad thing to want.

Luckily, that isn't really what you want.

You want to _populate_ an array from a string, not create an array.

Yes?


   my @array1 = split /\s+/, "1 2 3";


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


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

Date: Fri, 15 Aug 2003 20:18:23 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Re: How to create an array from a string?
Message-Id: <vjr8nkg01bsd9d@corp.supernews.com>


"Francesco Moi" <francescomoi@europe.com> wrote in message
news:5b829932.0308151533.18c7de64@posting.google.com...
> Hello.
>
> I would like to create an array from a string. I tried with:

There is more than one way to do it.....

If you want to use some form of literal to enumerate the values assigned to
elements of an array, you can do any of the following:

The list method:

my @array = ( 1, 2, 3 );


The string method:

my @array = split /\s+/, "1 2 3";

The list constructor operator method:

my @array = ( 1 .. 3 );

The word method:

my @array = qw(1 2 3);

There are others that deal with looping and such.  But these ought to be
enough.





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

Date: 15 Aug 2003 18:13:50 -0700
From: toddrw69@excite.com (trwww)
Subject: Re: HTTP::Request failed on HTTP/1.1 and Connection: Keep-Alive
Message-Id: <d81ecffa.0308151713.791158a2@posting.google.com>

simon.tneoh@mybiz.net (Simon Tneoh) wrote in message news:<a07bdd22.0308041753.2c82307d@posting.google.com>...
> Hi Abigail,
>    I know that the error comes from the Java program, the nullpointer error.
>    But what it confused me is: if I'm using an Internet Explorer version 5 to
> access the page, it's working fine. If I use HTTP::Request, it'll fail. I tried
> to simulate the headers in the IE's request in HTTP::Request, but I failed to
> make it work. I just wonder if it's because HTTP::Request doesn't support
> HTTP/1.1 and Keep-Alive properly?
>    Thanks.
> 

I highly doubt it. I know it is easy to blame the perl end of the
connection when one sees something like the above, but it is usually
not the case.

For instance, developing an asp.net app, my code used the
HttpContext.Current.Request.UserAgent object from the .NET class
library. When I made requests via IE or NS, everything was gravy. But
when I used LWP::Simple to develop a test suite, the app would crash
saying I was using a null value as an object.

After stepping through the code with the debugger, I saw
HttpContext.Current.Request.UserAgent was null when using LWP::Simple.

HttpContext.Current.Request.UserAgent is a convience object and is by
no means obligated to be instantiated ( by specification or otherwise
).

So while it was easy to immediately think the problem was in the
client side perl logic, some digging proved the problem was indeed on
the server side.

Todd W.


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

Date: Sat, 16 Aug 2003 02:59:48 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: MIME::Lite won't send simple email with "foreign" chars
Message-Id: <mbudash-43596D.19594715082003@typhoon.sonic.net>

hey all -

i'm using MIME::Lite to send emails. works great. now i need to send 
this in an email:

http://66.221.117.199/email_student

and it won't. period. no error. just no sendy. tried EVERYTHING (except, 
of course what i need to try to make it work). if i take out the foreign 
characters, it sends. what am i doing wrong???

here's my test script:

#!/usr/bin/perl

use strict;
use CGI qw/:standard escape/;
use CGI::Carp qw/fatalsToBrowser/;
use MIME::Lite;

        my $S = gettemplate('email_student');
        $S =~ s/\[\[(.+?)\]\]/param($1)/eg;

        my $msg = new MIME::Lite
                From     => 'info@medalis.com',
                To       => 'mbudash@sonic.net',
                Subject  => 'Confirmation',
                Type     => 'TEXT',
                Data     => $S;

        $msg->send() or die ($!);

#--------------------------------------------------------------------
sub gettemplate {
#--------------------------------------------------------------------

    my $template = shift;

    open (T, "./$template")
       or die ("Can't open template ($template): $!");
    binmode (T);
    my $T = do { local $/; <T>; };
    close (T);

    return $T;

}

-- 
Michael Budash


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

Date: 16 Aug 2003 01:24:34 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Newbie: How to read metadata from a windows DLL
Message-Id: <bhk14i$mhp@dispatch.concentric.net>


"Frank Foss" <fozzie_beer@hotmail.com> wrote in message
news:bhjtsa$b4fd$1@ID-190416.news.uni-berlin.de...
> My company is making software, and part of the release notes are details
> about the files included in the release, timestamp, version, checksum, and
> so on. This info is gathered in a very manual process:
> In Windows Explorer, highlighting the file, ALT+Enter to bring up a
> "Properties" window.
> In this window, there are tabs, "General","Version", and so on.
>
> What I would like to do, is to write a quick Perl script that will
traverse
> a directory,
> look "inside" each .DLL or what ever type of file, read the metadata
> attributes, and write to a file.
>
To start, take a look at:
http://search.cpan.org/author/GSAR/libwin32-0.191/File/File.pm




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

Date: Sat, 16 Aug 2003 01:34:38 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Newbie: How to read metadata from a windows DLL
Message-Id: <3F3D8A2A.7050308@rochester.rr.com>

Frank Foss wrote:

 ...


> My company is making software, and part of the release notes are details
> about the files included in the release, timestamp, version, checksum, and
> so on. This info is gathered in a very manual process:
> In Windows Explorer, highlighting the file, ALT+Enter to bring up a
> "Properties" window.
> In this window, there are tabs, "General","Version", and so on.
> 
> What I would like to do, is to write a quick Perl script that will traverse
> a directory,
> look "inside" each .DLL or what ever type of file, read the metadata
> attributes, and write to a file.
> 
> I am using ActiveState Perl, 5.6.1 on Windows 2000.
> 
> Guess my questions are:
> Is there a Perl module that allows me to read this info from the files?


I'm not aware of any, but you might check on CPAN.  Maybe something
like Win32::File::Ver ?

    http://www.cpan.org


> What methods to use?
> Examples of code to do this?
> Module to compute checksums?


You might check the Digest::MD5 module.


> 
 ...


> Foz


Here is some really kludgy code to return the 

version number of a typical DLL file.  It works

for both 16-bit and 32-bit DLL's, but knows nothing
of the real file format of a DLL, and could
conceivably be fooled.  This is an excerpt from a
program I use to look for "DLL Hell" on my computer.
Start with the full path to the DLL in $fn and the
base file name in $file:


	open IN,$fn or die "Oops, couldn't open $fn, $!";
	binmode IN;
	$in='';while(read(IN,$a,4000)){$in.=$a}
	close IN;
	if($in=~/\0F\0i\0l\0e\0V\0e\0r\0s\0i\0o\0n\0(.{30})/){
		$ver=$1;
		while($ver=~s/([^\0])\0([^\0])/$1$2/g){};
		$ver=~s/^\0+//;
		$ver=~s/^([^\0]+).*/$1/;
		$file=$file."|$ver";
	}
	elsif($in=~/\0FileVersion\0(.{30})/){
		$ver=$1;
		$ver=~s/^\0+//;
		$ver=~s/^([^\0]+).*/$1/;
		$file=$file."|$ver";
	}
	else{
		$file=$file."|--not specified--";
	}
         print $file;

You can probably find some more "meta-info" near the places
where the FileVersion appears.  HTH.
-- 
Bob Walton



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

Date: 15 Aug 2003 20:13:52 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: Perl and recursive copying?
Message-Id: <e0160815.0308151913.77bf4f31@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbjopo1.8ei.tadmc@magna.augustmail.com>...
> James Willmore <jwillmore@cyberia.com> wrote:
> 
> > use vars qw/$joe $bill/;
> 
> 
>    You should always prefer lexical variables over package
>    variables, except when you can't.
> 
> 
> And you can, but you aren't, and you should:
> 
>    my( $joe, $bill );

Okay, now you've given me a concept to read about (lexical).  I seen
it, heard about it, and, I fear greatly to say this, but don't
understand it.

Thanks,

Jim


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

Date: Fri, 15 Aug 2003 22:54:06 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl and recursive copying?
Message-Id: <slrnbjramu.alj.tadmc@magna.augustmail.com>

James Willmore <jwillmore@cyberia.com> wrote:
> tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbjopo1.8ei.tadmc@magna.augustmail.com>...


>>    You should always prefer lexical variables over package
>>    variables, except when you can't.

> Okay, now you've given me a concept to read about (lexical).  I seen
> it, heard about it, and, I fear greatly to say this, but don't
> understand it.


Lexical variables are the ones that are _easy_ to understand.

It is package variables that are harder to understand.

Use the easy-to-understand kind whenever you can.


See also:

   "Coping with Scoping":

      http://perl.plover.com/FAQs/Namespaces.html


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


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

Date: Fri, 15 Aug 2003 20:31:43 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Perl for Sharp SL-5500 Zaurus (Linux PDA)
Message-Id: <vjr9gm6c24ie7e@corp.supernews.com>

Someone, at some point along the line, created an .arm.ipk of Perl 5.6.1 for
the Sharp SL-5500 Zaurus, which is a Linux based PDA.  The implementation is
incomplete, as many of the core modules were left out, as well as all of the
perldocs.  Getopts:Std isn't there, for example, while Getops:Long is.

Not having access to a compiler on my Sharp Zaurus (nor the technical
know-how to install one of the commercially released compilers which consume
copious amounts of the Z's resources and require special configuration), and
not having access to a cross-compiler for the Zaurus's Strongarm processor
and machine layout, I'm at the whim of other Perl enthusiasts' progress
toward compiling a more complete Perl for the Zaurus.

Why would I want Perl on my Zaurus?  A lot of reasons, not the least of
which is that I prefer tinkering with Perl under a Linux environment than a
Windows environment.

I understand that the Zaurus has limited memory capacity, and that is why
the existing 5.6.1 port has been trimmed so much.  But its porter went a
little too far, cutting it all down to about 4mb.  I can plug a 128k SD card
into the Z, link the SD card into /usr/bin, and use all that extra space to
take advantage of Perl's core module set and the perldocs.

Has anyone in this group made any attempts to bring a more complete version
of Perl to the Sharp Zaurus?

Thanks,

Dave




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

Date: Fri, 15 Aug 2003 21:41:59 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: soap, etc
Message-Id: <qddrjv8vin8cbk0kkj74u3tvo3a78k1e6l@4ax.com>

On Fri, 15 Aug 2003 14:20:51 GMT, Uri Guttman <uri@stemsystems.com>
wrote:

>>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:
>
>  H> I think it is a bad habit the perl community has of doing everything
>  H> through modules, etc...of course, I got no clue as to writing a socket
>  H> in C, so maybe I shouldn't complain.
>
>and you would cut and paste everything? and get rid of cpan? and
>reinvent each wheel? search google for moronzilla and her blatherings on
>why modules are bad (and see her turn around and use them anyway).
>
>if you keep making dumb statements like that, you won't get far in the
>programming world.
>
>as for sockets in perl, read the book network programming in
>perl. sockets are easy even at low level and even easier with those
>dreaded modules.
>
>uri

well...I would say good and bad. I love using modules for sockets,
etc. But it is frustrating that it is so hard to find a simple example
on how to do a soap call without Soap::Lite...this is very easy stuff,
I think...and there is no need for a module here.


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

Date: Fri, 15 Aug 2003 21:47:34 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: soap, etc
Message-Id: <jldrjvg9ai2doma4a7d5qbefe4qsvfk9dg@4ax.com>

On Fri, 15 Aug 2003 09:07:49 -0500, tadmc@augustmail.com (Tad
McClellan) wrote:

>Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
>
>> I think it is a bad habit the perl community has of doing everything
>> through modules,
>
>
>It is clear that you have not had formal education in programming.
>
>Code reuse is a *good* thing.

nope...this is true...no formal training at all...just a little
hacking around and some reading.

But...I have read about code reuse. Of course I agree. I think my
point was that making a soap call is no big deal and it is frustrating
that I can't find examples without Soap::Lite. It is simple:

http header

soap call


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

Date: Sat, 16 Aug 2003 03:28:43 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: soap, etc
Message-Id: <x7k79eth5h.fsf@mail.sysarch.com>

>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:

  H> well...I would say good and bad. I love using modules for sockets,
  H> etc. But it is frustrating that it is so hard to find a simple example
  H> on how to do a soap call without Soap::Lite...this is very easy stuff,
  H> I think...and there is no need for a module here.

then soap is too hard for you in that case. that is the point of
modules. someone solves the soap problem (best done by sending it all to
/dev/null) and you get to reuse it. you really don't seem to get the
concept yet. 

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Fri, 15 Aug 2003 23:35:43 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: soap, etc
Message-Id: <21krjvk403h597vvfg77ku89vqdmae9607@4ax.com>

On Sat, 16 Aug 2003 03:28:43 GMT, Uri Guttman <uri@stemsystems.com> wrote:

>>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:
>
>  H> well...I would say good and bad. I love using modules for sockets,
>  H> etc. But it is frustrating that it is so hard to find a simple example
>  H> on how to do a soap call without Soap::Lite...this is very easy stuff,
>  H> I think...and there is no need for a module here.
>
>then soap is too hard for you in that case. that is the point of
>modules. someone solves the soap problem (best done by sending it all to
>/dev/null) and you get to reuse it. you really don't seem to get the
>concept yet. 
>
>uri

soap is very easy for me...

        my $soap_request .= "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">\n";
        $soap_request .= "<SOAP-ENV:Body>\n";
        $soap_request .= "<ns1:doGoogleSearch xmlns:ns1=\"urn:GoogleSearch\" \n";
        $soap_request .= "SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n";
        $soap_request .= "<key xsi:type=\"xsd:string\">CfVl7PFQFHLYC83Ui/obIpPNFYY/aRYp</key>\n";
        $soap_request .= "<q xsi:type=\"xsd:string\">$keyword</q>\n";
        $soap_request .= "<start xsi:type=\"xsd:int\">0</start>\n";
        $soap_request .= "<maxResults xsi:type=\"xsd:int\">10</maxResults>\n";
        $soap_request .= "<filter xsi:type=\"xsd:boolean\">true</filter>\n";
        $soap_request .= "<restrict xsi:type=\"xsd:string\"></restrict>\n";
        $soap_request .= "<safeSearch xsi:type=\"xsd:boolean\">false</safeSearch>\n";
        $soap_request .= "<lr xsi:type=\"xsd:string\"></lr>\n";
        $soap_request .= "<ie xsi:type=\"xsd:string\">latin1</ie>\n";
        $soap_request .= "<oe xsi:type=\"xsd:string\">latin1</oe>\n";
        $soap_request .= "</ns1:doGoogleSearch>\n";
        $soap_request .= "</SOAP-ENV:Body>\n";
        $soap_request .= "</SOAP-ENV:Envelope>";
    
        my $request = "POST /search/beta2 HTTP/1.1\n";
        $request .= "Host: api.google.com\n";
        $request .= "Accept-Encoding: identity\n";
        $request .= "Content-length: ".length($soap_request)."\n";
        $request .= "SOAPAction: \"urn:GoogleSearchAction\"\n";
        $request .= "Content-Type: text/xml\; charset=utf-8\n\n";
        $request .= "$soap_request";        

        my $socket = IO::Socket::INET->new(PeerAddr => "api.google.com",
                                           PeerPort => 80,
                                           Proto    => "tcp",
                                           Type     => SOCK_STREAM,
                                           Timeout  => 5);
        print $socket $request;

I got no problems with soap ;-)


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

Date: Sat, 16 Aug 2003 03:43:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: soap, etc
Message-Id: <x74r0itggt.fsf@mail.sysarch.com>


please learn to use here docs already. that code is unreadable.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Fri, 15 Aug 2003 23:50:37 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: soap, etc
Message-Id: <pskrjv80mbhacj1ue95fmrb5v86viupqhn@4ax.com>


>>then soap is too hard for you in that case. that is the point of
>>modules. someone solves the soap problem (best done by sending it all to
>>/dev/null) and you get to reuse it. you really don't seem to get the
>>concept yet. 
>>
>>uri
>
>soap is very easy for me...

and that...god damnit...is the point of my post!!!

soap is very easy...that's the point...why use a module for something so easy???

OK...write your own module...that is fine...but why create more complexity by
bringing in blackboxes for things so easy? And why is it so hard to find simple
information about this on the net?


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

Date: Fri, 15 Aug 2003 23:52:48 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: soap, etc
Message-Id: <o4lrjvkaqo5htldnau55t2udi6b1bpke02@4ax.com>

On Sat, 16 Aug 2003 03:43:30 GMT, Uri Guttman <uri@stemsystems.com> wrote:

>
>please learn to use here docs already. that code is unreadable.
>
>uri

uri...I like my code...I know how to use here docs...but my code makes me happy
the way it is ;-)



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

Date: Sat, 16 Aug 2003 04:02:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: soap, etc
Message-Id: <x7y8xus11i.fsf@mail.sysarch.com>

>>>>> "H" == Hudson  <scripts_you-know-the-drill_@hudsonscripting.com> writes:

  H> On Sat, 16 Aug 2003 03:43:30 GMT, Uri Guttman <uri@stemsystems.com> wrote:
  >> 
  >> please learn to use here docs already. that code is unreadable.
  >> 
  >> uri

  H> uri...I like my code...I know how to use here docs...but my code
  H> makes me happy the way it is ;-)

but your code is poorly written. you don't seem to want to learn better
style. also learn this little truth:

	code is for other people to read, not for the computer or
	yourself.

think about that for a decade or so. you might understand it then.

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: 15 Aug 2003 20:40:05 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: strange error  "Unsuccessful stat on filename "
Message-Id: <e0160815.0308151940.79b0e856@posting.google.com>

"pitt" <randy_chang@sohu.com> wrote in message news:<bhi4i8$j79$1@mail.cn99.com>...
> I got the error when i install Compress::zlib
> when run "perl Makefile.PL"
> there two statement as following:
> 
> "Unsuccessful stat on filename containing newline at
> /usr/local/lib/perl5/5.8.0/IA64.ARCHREV_0/Cwd.pm line 213.
> Parsing config.in...
> Looks Good.
> Up/Downgrade complete.
> Unsuccessful stat on filename containing newline at
> /usr/local/lib/perl5/5.8.0/ExtUtils/MM_Unix.pm line 2775.
> WARNING: CAPI is not a known parameter.
> Writing Makefile for zlib
> Writing Makefile for Compress::Zlib
> 
> "
> It seems the "Unsuccessful stat..."    does not lead errors.
> another question is that in make file  ,the CC is defined to gcc ,but i have
> no gcc in system ,why they do so?

To change the compiler setting for the makefile, type the following:

perl Makefile.PL CC=<your compiler> LD=<your linker>

HOWEVER, you should find out what Perl was built with.  Type:

perl -V

This will give you all the various options, directories, compiler,
etc. that was used to build Perl.  If you got a package instead of
building Perl yourself, the producers of the package may have used the
gcc compiler.  I ran into a similar issue using Solaris at work.  The
admin later installed the gcc compiler and all was right after that. 
You may not want to go that route, but life appears to be so much
easier if you do.

You're getting a CAPI warning, but it doesn't say it's harmless.  I'm
not sure if using a different compiler, or setting your compiler
option while building the makefile will solve this.  You'll have to
investigate this further or perhaps someone else knows what that's
refering to.

As far as why that's the default ... I defer to others who know the
in's and out's of Perl much better than myself.  I have only opinions
about it, but they may be very far off base.

HTH

Jim


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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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.  

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


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