[13048] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 458 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 11 06:07:15 1999

Date: Wed, 11 Aug 1999 03:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 11 Aug 1999     Volume: 9 Number: 458

Today's topics:
    Re: <== Help with date sorting==> (Abigail)
    Re: <== Help with date sorting==> (Andreas Fehr)
    Re: Browser detection - write different html (Abigail)
    Re: Browser detection - write different html <Mark@Mark.Com>
    Re: Browser detection - write different html (Mike Bristow)
    Re: Creating variables on the fly with CGI.pm? (Anno Siegel)
    Re: DBI - how to insert and retrieve BLOBs in Oracle 8i <vitus@zinc.fe.msk.ru>
    Re: Encryption with sendmail (Abigail)
    Re: finding array size (Abigail)
        Getting perl to accept a flat table file <Paul.Foran@analog.com>
    Re: Getting perl to accept a flat table file (Andreas Fehr)
    Re: is our reese the author of mysql book? (Abigail)
    Re: list length <gmuth@bytecare.com>
    Re: Looking for a good Perl Book <JFedor@datacom-css.com>
        LWP for a secure server <david.oukrat@livre.net>
        Re:Re: Re: pipes and file handles slmlambert@my-deja.com
    Re: require mylib.pl (Kvan)
        searching complex data structure <Joe.Kline@sdrc.com>
    Re: Should I use fork to "parallel process"? <gmuth@bytecare.com>
    Re: Slight problem with :i in Getopt::Long <mike@crusaders.no>
        Some help needed <bsv@mega.kemerovo.su>
    Re: turn $6 into $6000 (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 11 Aug 1999 02:35:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: <== Help with date sorting==>
Message-Id: <slrn7r29u7.cat.abigail@alexandra.delanet.com>

Kevin Howe (khowe@performance-net.com) wrote on MMCLXX September MCMXCIII
in <URL:news:7a_r3.37796$5r2.74576@tor-nn1.netcom.ca>:
~~ I am looking to sort a set of dates with the following format in
~~ most_recent-least_recent order.
~~ 
~~ August 10, 1999
~~ September 20, 1999
~~ December 13, 1999

Well.... this is a bit problematic. Since 2 out of 3 dates are in the
future, how can you sort from most *recent* to least *recent*?

I assume you want to sort from first date to last. The reverse is
left as an exercise to the reader.


Surprisingly, Usenet dates aren't just for fun. They are very handy
to sort dates as well!


# Please note the magic constant 2449231. Do not alter, or your
# camel may give birth in your bed.

print map  { $^W = $ W;
             $_  -> [0]}
      sort { $a  -> [1] <=> $b -> [1]}
      map  {  require Time'ParseDate;
              require Time'JulianDay;   # All hail the Emperor!
             $ W = $^W unless defined $ W;
             $^W = 0;
            [$_  => (Time'JulianDay'gm_julian_day (
                     Time'ParseDate'parsedate ($_, ZONE        => 'MET',
                                                   UK          =>  1,
                                                   PREFER_PAST =>  1))
                     - 2449231) . " September MCMXCIII"]} <DATA>;
__DATA__
September 20, 1999
December 13, 1999
August 10, 1999
January 1, 1998
August 10, 1998
November 30, 1997
__END__



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 11 Aug 1999 08:42:15 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: <== Help with date sorting==>
Message-Id: <37b135d3.11354957@news.uniplus.ch>

On Tue, 10 Aug 1999 13:12:27 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:

>
>In any case, the slice is less to type, so less error-capable (that's 
>nicely alliterative in German: fehlerfähig):
>

I guess prone to errors: fehleranfällig
Fähig means capable. People might be capable but errors aren't.
Although this might be object interpretation.

But you German is still better than my Perl... (grumble)

Andreas


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

Date: 11 Aug 1999 03:16:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Browser detection - write different html
Message-Id: <slrn7r2caa.cat.abigail@alexandra.delanet.com>

Robert (ducott@intergate.bc.ca) wrote on MMCLXX September MCMXCIII in
<URL:news:37b02e4e@carrera.intergate.ca>:
?? What we are looking for is a perl/cgi script or a java script that will
?? accomplish the following...When a user comes to our page, the script will
?? detect the browser app ver # and take an action base on that result. What we
?? want is when a browser is 4.0 or better, we want the page to load a
?? shockwave slideshow, if the browser is lower and can't handle shockwave we
?? want the page to load a java applet slide show. Now, were not sure if this
?? can be done so we'll end by saying this. Our company is will to pay top
?? dollar for a working script that will do this. Please reply or send to
?? enquiries to ducott@intergate.bc.ca

<rant offtopic>

Djees. Downgrading gracefully has been important in HTML from before
you know what it was. There's a solution that doesn't require *ANY*
server-side action and certainly doesn't depend on faulty assumptions
as "4.0 means the browser can do shockwave" and "if lower, it can't".

Here's a hint: Netscape runs on more platforms than shockwave does.
Here's another hint: Shockwave also runs on some Unix platforms.
Here'a third hint: Not being version 4.0 does not imply Java can be used.

Here's a suggestion: Save yourself a few dollars and read the HTML
specification over lunch. It ain't that big, and it isn't more complicated
than the instruction of how to clean your coffee maker.

</rant>

Of course, I could write the script for you. But that would be below
my standards.


Followups set.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 11 Aug 1999 09:21:14 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: Browser detection - write different html
Message-Id: <37B1327A.5A03E25C@Mark.Com>



Robert wrote:

> What we are looking for is a perl/cgi script or a java script that will
> accomplish the following...When a user comes to our page, the script will
> detect the browser app ver # and take an action base on that result. What we
> want is when a browser is 4.0 or better, we want the page to load a
> shockwave slideshow, if the browser is lower and can't handle shockwave we
> want the page to load a java applet slide show. Now, were not sure if this
> can be done so we'll end by saying this. Our company is will to pay top
> dollar for a working script that will do this. Please reply or send to
> enquiries to ducott@intergate.bc.ca

I know how to do this! Can I have top dollar please?

Anyway, here it is:

In any CGI script, the env variable HTTP_USER_AGENT contains the name of the
requesting client. You can figure out from this ($ENV{'HTTP_USER_AGENT'}) what
version of a browser and what browser you are running. You then dump out the
appropriate HTML e.g.

    if ($ENV{'HTTP_USER_AGENT'} =~ /MSIE 3/) # IE 3.0
            ....
            ....
            ....
    elsif ($ENV{'HTTP_USER_AGENT'} =~ /MOZILLA\/4.61 /) # Netscape 4.6

The following cgi snippet tells you all your env variables:

NOTE: PLease use the CGI module!

use CGI;
$q = new CGI;
$q->print ($q->header(), $q->start_html(-title=>'Env Vars'));
foreach $key (sort keys %ENV)
{
 $q->print($q->h2($key,"->",$ENV{$key}));
}
$q->print($q->end_html());






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

Date: Wed, 11 Aug 1999 08:56:14 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Browser detection - write different html
Message-Id: <slrn7r2ele.8te.mike@lindt.fat.dotat.at>

On Wed, 11 Aug 1999 09:21:14 +0100, Mark <Mark@Mark.Com> wrote:
>
>
>Robert wrote:
>
>> What we are looking for is a perl/cgi script or a java script that will
>> accomplish the following...When a user comes to our page, the script will
>> detect the browser app ver # and take an action base on that result. What we
>> want is when a browser is 4.0 or better, we want the page to load a
>> shockwave slideshow, if the browser is lower and can't handle shockwave we
>> want the page to load a java applet slide show. Now, were not sure if this
>> can be done so we'll end by saying this. Our company is will to pay top
>> dollar for a working script that will do this. Please reply or send to
>> enquiries to ducott@intergate.bc.ca
>
>I know how to do this! Can I have top dollar please?
>
>Anyway, here it is:
>
>In any CGI script, the env variable HTTP_USER_AGENT contains the name of the
>requesting client. 

Wrong.  It'll happen sometimes, but not always, depending on the
server and the client.

If you must do this kind of disgusting, evil, hack, do
if (defined $ENV{'HTTP_USER_AGENT'}) {
	# ...
}

-- 
Mike Bristow, Geek-At-Large.                GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!



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

Date: 11 Aug 1999 08:48:00 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Creating variables on the fly with CGI.pm?
Message-Id: <7ordc0$ofu$1@lublin.zrz.tu-berlin.de>

Makarand Kulkarni  <makarand_kulkarni@my-deja.com> wrote in comp.lang.perl.misc:
>[In article <7omgen$t6r$1@news.servint.com>,
>  <vlad@doom.net> wrote:
>> I did this, which is a lot smaller obviously:
>> my @fields = param ();
>> for (@fields) {
>> 	${$_} = param ($_);
>> }
>..{rest of the code snipped...}
>]
>-
>If you are using CGI.pm then the params
>are already cached by the CGI module in
>a hash for quick access. Storing them
>in your hash is not going to make access

He's not storing them in a hash.  Look again, ${$_} is a symref.

>to these any faster than a regular call
>to param() provided by CGI.

Not faster?  Not that it will usually make a noticeable difference,
but on my machine accessing a hash directly is almost six times
faster than doing the same thing through a method call.  Objects
may have many desirable properties, but speed is not among them.

Anno


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

Date: 11 Aug 1999 13:51:56 +0400
From: Victor Wagner <vitus@zinc.fe.msk.ru>
Subject: Re: DBI - how to insert and retrieve BLOBs in Oracle 8i?
Message-Id: <37b147bc.0@news.rtsnet.ru>

Simon Twigger <simont@mcw.edu> wrote:
> Hi there,

> I'm writing a perl/CGI/web based application which is using an Oracle8i
> database to store assorted data. What I would like to be able to do is
> have people upload files to the database (eg. Excel, PDF, images, etc)
> where they would be stored and then served back for download or on-line
> viewing as required.

There is README.longs in the DBD::Oracle distribution. There is all
things written.

Shortly:

1. If you use LONG field in Oracle 8 database, you just use normal
  fetchrow_array with appropriate set LongReadLen.
2. If you use BLOB fields you should use blob_read methods
  Same stands for LONG and LONG RAW in Oracle 7.x
3. Inserting is always done with usial inserts. Use bind symbol (?)

--------------------------------------------------
Victor Wagner			vitus@ice.ru
Programmer			Office:7-(095)-964-0380
Institute for Commerce 		Home: 7-(095)-135-46-61
Engineering                     http://www.ice.ru/~vitus


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

Date: 11 Aug 1999 03:22:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Encryption with sendmail
Message-Id: <slrn7r2cle.cat.abigail@alexandra.delanet.com>

stirling@banet.net (stirling@banet.net) wrote on MMCLXX September
MCMXCIII in <URL:news:37b07c36@news1.us.ibm.net>:
[]
[]     Does anybody know of method's in which to do sendmail with encryption
[] tools such as PGP? If you could please point me in the right direction I
[] would be very grateful


You have a sendmail written in Perl? Cooooool.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Aug 1999 03:24:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: finding array size
Message-Id: <slrn7r2cpi.cat.abigail@alexandra.delanet.com>

Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote on MMCLXX September
MCMXCIII in <URL:news:slrn7qvj9m.787.sholden@pgrad.cs.usyd.edu.au>:
|| On 10 Aug 1999 06:49:59 GMT,
|| 	Margaret Escherich <glasscat@shell7.ba.best.com> wrote:
|| >
|| >How do you find the size of an array or a splice? how could I, for
|| >example, take 400 bytes of an array?
|| 
|| perldoc -f length


Giving wrong answer is worse than giving no answers at all.

I'd be surprised if the part of the manual that introduced
arrays doesn't mention it.




Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 11 Aug 1999 09:21:20 +0100
From: Paul Foran <Paul.Foran@analog.com>
Subject: Getting perl to accept a flat table file
Message-Id: <37B13280.B43298B7@analog.com>

Hi all,

Can somebody tell me how to get perl to accept a comma delimited txt
file and parse it contents.

paul.




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

Date: Wed, 11 Aug 1999 09:00:08 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Getting perl to accept a flat table file
Message-Id: <37b13af8.12671540@news.uniplus.ch>

On Wed, 11 Aug 1999 09:21:20 +0100, Paul Foran <Paul.Foran@analog.com>
wrote:

>Can somebody tell me how to get perl to accept a comma delimited txt
>file and parse it contents.

Yes, write some Perl code and run it with the filename as parameter.

Andreas


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

Date: 11 Aug 1999 03:03:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: is our reese the author of mysql book?
Message-Id: <slrn7r2bi2.cat.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCLXXI September MCMXCIII in
<URL:news:x7g11qanob.fsf@home.sysarch.com>:
,, 
,, i noticed the name george reese as one of the authors of the new
,, o'reilly book mysql & msql. is that the same twit who kept a stupid
,, flame war going for weeks last year? i don't feel like i can stomach
,, reading those old posts again. the book page claims he wrote a jdbc and
,, java book which i seem to recall from the war and that explains his
,, total lunkheadedness about perl.


Seems like the same guy.

I've had the "pleasure" of maintaining "code" written by George Reese.
I still have nightmares of improving a module such that it not longer
tolerates really bad practise, and then find 13 objects out of 10000
that don't compile, 12 of them from George Reese - 100% of his objects
that use said module. And that happened repeatedly.

I've also tried reading manuals/tutorials written by George Reese, 
which I had to toss away screaming after the first 2 paragraphs.

I've quit reading/posting in several newsgroups, just because 90% of the
traffic in the group was about George Reese, and not about the topic of
the group. 95% of that 90% were flames produced by George Reese himself.

I'd rather have a Matt Wright every day, then a George Reese once in
a lifetime.


Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 11 Aug 1999 10:17:18 +0100
From: Gerhard Muth <gmuth@bytecare.com>
Subject: Re: list length
Message-Id: <37B13F9E.BD114C29@bytecare.com>

Abigail wrote:
[...]
> There isn't a buildin function that does that.
That's it essentially.
To summarize the "list length" thread:

1) There is NO buildin function to determine the length of a list
   WITHOUT the use of variable
   (even ()=Thread->list must be assigned to a variable)

2) You can use $#.. or a loop like this instead:
   do {my $c; map {$c ++} Thread -> list; --$c};

[...]
> Nope. You can easily write a sub that returns the appropriate number,
> but then, things would be assigned to @_, and for some odd reason,
> you are scared of variables.

Not really ;-) (ever had nightmares about vars?, not yet :-()

I just want to avoid using variables where not appropriate.
Think of that:

while( <there_is_still_a_thread_in_the_pool_trying_to_win_the_race> )
{
  print "Hey User, The race is not finished yet\n";
  ...
  print "$leader is could win the race ...\n";
}

An appropriate conditional expressions would be:

while( do {my @l = Thread -> list; $#l} )
{
 ...
}

or 

while( do {my $c; map {$c ++} Thread -> list; --$c} )
{
  ..
}

The --$c is probably only valid for the "use Thread" context.

I personally prefer the 1st variant which still has got
this var in it, damned ;-)

Never mind.
I guess I should learn more about perl's concept of
dealing with lists, as Randal said.

Thanks a lot for your help,
Gerhard


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

Date: Wed, 11 Aug 1999 04:19:47 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: Looking for a good Perl Book
Message-Id: <7or9li$fnp$1@plonk.apk.net>


Michael Prendergast wrote in message <37AFE1C0.BF1239E5@virtualis.com>...
>Hello everyone,
>
>I'm new to this forum, so none of you will probably recognise me.
>
>I'm looking for a good Perl book to learn from. I do have programming
>experience and I was wondering if any of you have a suggestion as to
>which is a good book to introduce me to the Perl language. I'm not
>*just* looking for an intro book though, I mean one with depth also, and
>some assignments/quizzes also.


Mike - Datacom has most of O'Reilly's books at a very good discount.

Check out:  http://www.datacom-css.com/books/perl.htm

I think you have to call to order because their on-line ordering system
isn't up yet.  It's
toll free.

Jody





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

Date: Wed, 11 Aug 1999 09:55:27 +0200
From: David Oukrat <david.oukrat@livre.net>
Subject: LWP for a secure server
Message-Id: <37B12C6F.AD70E154@livre.net>

Il s'agit d'un message multivolet au format MIME.
--------------E7A8EC0C087BF10369CE116D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,
i make a  perl cgi
who must execute another script, this another script is on a 'https'
server
i use LWP package for a 'http' server


i want use a similar function for a 'https' server
LWP gives "server down" with a 'https' server
this is my function for a 'http' server
sub Connect_server {
        local ($url) = @_;


        my $ua = new LWP::UserAgent;
        $ua->agent("MoXWorld Web Agent/$v ");


        if ($url_proxy ne "") {
                $ua->env_proxy;
                $ua->proxy('http',$url_proxy);
        }
        my $req = new HTTP::Request 'GET' => $url;
        $req->header('Accept' => 'text/html');

        # send request
        my $rez = $ua->request($req);
        my $res1=$rez->content();

# Serveur Down
        if ($res1 eq '') {return "Server Down"}



        return $res1;

}
somebody have a solution to solve my problem?




--------------E7A8EC0C087BF10369CE116D
Content-Type: text/x-vcard; charset=us-ascii;
 name="david.oukrat.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Carte pour David Oukrat
Content-Disposition: attachment;
 filename="david.oukrat.vcf"

begin:vcard 
n:Oukrat;David
tel;fax:01 43 36 16 15
tel;work:01 44 08 68 00
x-mozilla-html:FALSE
url:http://www.livre.net
org:Planète Livre Multimédia
adr:;;6 rue lacépède;Paris;;75015;France
version:2.1
email;internet:david.oukrat@livre.net
x-mozilla-cpt:;-15920
fn:David Oukrat
end:vcard

--------------E7A8EC0C087BF10369CE116D--



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

Date: Wed, 11 Aug 1999 08:49:16 GMT
From: slmlambert@my-deja.com
Subject: Re:Re: Re: pipes and file handles
Message-Id: <7ordeb$rtb$1@nnrp1.deja.com>


> >>my $pid = open(CHILD, '|-');
> >>die "Error creating child: $!" unless defined $pid;
> >>if ($pid)
> >>{
> >>  print CHILD $gibberish;
> >>  close CHILD or die "Child died: $?";
> >>}
> >>else
> >>{
>
> >>  my $ftp = Net::FTP->new($remote_host)
> >>	or die "ftp connection failed";
> >>  $ftp->login($username, $password)
> >>	or die "ftp login failed";
> >>  $ftp->put(\*STDIN, $remote_filename)
> >>	or die "ftp put failed";
> >>  $ftp->quit;
> >>  exit 0;
> >>}

> This is where I get to say "what happened when you tried it?".

Yeah - I initially tried it at work under NT much to my pain.  No luck
and some really bizzarre error msgs.  I think that it has a problem
with the '|-'.

> Incidentally, I've been remiss in not commenting on portability.
> I suspect that this would *not* work under Windows (of any flavour)
> at present, due to its inability to fork processes.

I took it home last night and tried it under Linux and there were no
problems.  Why are there no suprises there?

I think that it might be time to change tack.  If NT has an issue with
the pipes then it may be easier to ftp manually via socket connection.
Thoughts?

Thanks for all your help,

Simon


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 11 Aug 1999 08:03:37 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: require mylib.pl
Message-Id: <37b12e07.76736210@news.newsguy.com>

On Tue, 10 Aug 1999 14:25:03 -0700, David Cassell
<cassell@mail.cor.epa.gov> wrote:

>And he was trying to work from the Ram too, which has quite a
>lot of detail on this topic.

One of these days, I'll find the time to read that book.

Kvan.

-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- |  dumb, panicky, dangerous animals
                                 |  and you know it.'
                                 |        - "K" in Men in Black.


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

Date: Wed, 11 Aug 1999 03:53:15 -0400
From: Joe Kline <Joe.Kline@sdrc.com>
Subject: searching complex data structure
Message-Id: <37B12BEB.C8262476@sdrc.com>

I am searching a complex data structure (hohohohol).

The key structure that I've pared down my search looks something like
this.

/       \                       /         \
| alpha |                       | apples  |
| beta  |   /   \    /     \    | oranges |
| gamma |-> | A | -> | dog | -> | bananas |-> [list of stuff]
|   .   |   | B |    \     /    |    .    |
|   .   |   \   /               |    .    |
\       /                       \         /

   V          W         X            Y             Z


Where V is all possible keys at that level.
      W only 2 possible keys
      X only 1 possible key
      Y is all possible keys at that level
      Z all elements of the list

     call the structure %stuff

I am looking for a specific Y and Z (my search criteria).

I can only think of 2 ways to search this.

1) loop through all levels and dump them into a list where the elements
are basically flat text:

   V:W:X:Y:Z[0]
   V:W:X:Y:Z[1] ... ad nauseaum

   Then I grep through that finding all matches.
   This seems rather "wrong" on a gut level.

2) Loop through the keys thusly:

$k4 = 'criterium1';
$v  = 'criterium2';
$k3 = 'dog';

K1:foreach $k1 ( keys %stuff )
{
    K2:foreach $k2 ( qw/A B/ )
    {
        if ( exists ( $stuff{$k1}{$k2}{$k3}{$k4} ) )
        {
            push(@matches, grep( @{$stuff{$k1}{$k2}{$k3}{$k4}}) )
        }
        else
        {
            next K2;
        }
    } # K2
} # K1


This is the search I am using, but I feel there is a more idiomatic
method of doing this (and probably more efficient).

TIA,

joe

--

/===================================================\
| Joe Kline                       | I used to be    |
| E-Mail: Joe.Kline@sdrc.com      |   anonymous     |
\===================================================/


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

Date: Wed, 11 Aug 1999 10:17:15 +0100
From: Gerhard Muth <gmuth@bytecare.com>
Subject: Re: Should I use fork to "parallel process"?
Message-Id: <37B13F9B.15738DB1@bytecare.com>

"Matthew O. Persico" wrote:
> 
> revjack wrote:
> >
> > I have a clumsy little script I use to perform a 'whois' query on a name
> > given at the command line. It serially queries internic, APNIC, RIPE,
> > ARIN, etc., saving me a little typing when I want to check out a name.
> >
> > I'm guessing it would run faster if it performed the queries at (roughly)
> > the same time, instead of serially.
> >
> > Forking each query into its own process seems like a logical approach.

Forking looks alright if it's only a small number of queries.

> > Generally speaking, is this a stupid idea?
> 
> Only if you have a perl version compiled with threads.

Threads could help a lot as long as the Libs/Modules your are using
are Thread compatible. (LWP 5.44 isn't from my experience).

Gerhard


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

Date: Wed, 11 Aug 1999 10:47:56 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Slight problem with :i in Getopt::Long
Message-Id: <BNas3.77$wU.692@news1.online.no>


Johan Vromans <JVromans@Squirrel.nl> wrote in message
news:wl3lnbjvitk.fsf@plume.nl.compuware.com...

> With the current Getopt::Long this is not exactly possible. But if you
> make debug take an optional string (instead on integer), you can
> discriminate between any values and the empty string. It makes the
> GetOptions call a little more complex, but it is an elegant and
> powerful solution that is useful in a lot of other situations as well.
>
>   GetOptions (%opt, "debug=s" => \&handle_debug, ...)

(I assume =s was a typo for :s)

Thank you. This worked very well. The only minor problem now is that
if -debug is the last option for Getopt::Long and I supply additional
arguments that should be passed on to @ARGV, then the first of those will be
considered an argument for -debug

So I can't write

 ./program.pl -force -debug vg

however

 ./program -force -debug 1 vg
or
 ./program -force -debug -- vg
or
 ./program -debug -force vg

will work.

I can definately live with this.

--
Trond Michelsen




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

Date: Wed, 11 Aug 1999 08:09:35 +0700
From: "S.Berezin" <bsv@mega.kemerovo.su>
Subject: Some help needed
Message-Id: <7or5q0$e2m@jumbo.cyberp.kemerovo.su>

Hello all!
I need counter for web pages. It must works without any other programms and
providers.
(CGI or Perl script).
Pls. help me to find it.
servber@mail.ru





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

Date: 11 Aug 1999 03:07:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: turn $6 into $6000
Message-Id: <slrn7r2bpf.cat.abigail@alexandra.delanet.com>

Matthew O. Persico (mpersico@erols.com) wrote on MMCLXXI September
MCMXCIII in <URL:news:37B0E571.AC227A25@erols.com>:
%% $x='$6';
%% $x += '000';
%% print $x;


$x = '$6';
$x ++ until $x =~ /^6/ && $x =~ /.(.)\1\1/;
print $x;



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 458
*************************************


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