[11587] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5187 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 20 16:07:25 1999

Date: Sat, 20 Mar 99 13:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 20 Mar 1999     Volume: 8 Number: 5187

Today's topics:
        Accessing database on a PC via ODBC (Ron)
    Re: Accessing database on a PC via ODBC <gellyfish@btinternet.com>
        Berkley DB and Variable <gaving@enter.net>
    Re: Berkley DB and Variable (Ronald J Kimball)
    Re: Can an unchecked checkbox input pass a different va <flavell@mail.cern.ch>
    Re: CPAN (Randal L. Schwartz)
        Expect in perl scripts - repost <m.usman.ghani@prodigy.net>
    Re: Filehandle Q... <jdf@pobox.com>
    Re: Forwarding to home directory using Net::FTP <gellyfish@btinternet.com>
    Re: FTP Recursive Directory Listing <gellyfish@btinternet.com>
        GMT offset for clocks? (Ron Charest)
        Help please - can't open .pl file <austin.m@virgin.net>
    Re: help with perl and win98 <gellyfish@btinternet.com>
    Re: HELP: Script would not execute but rather "save as" (Ronald J Kimball)
    Re: How to find individual undefined array values? (Larry Rosler)
        Mapping of Perl Extension in Personal Web Server <simon_ng@pacific.net.sg>
        Mapping of Perl Extension.... <simon_ng@pacific.net.sg>
    Re: Mapping of Perl Extension.... <gellyfish@btinternet.com>
    Re: Need Faster Approach (Earl Hood)
    Re: problem with fnctl F_GETFL in Perlf5 (Ronald J Kimball)
        sort a 2dim Array <pgasser@access.ch>
    Re: sort a 2dim Array (Ronald J Kimball)
    Re: Text Wrapping without Text::Wrap <revjack@radix.net>
        Webresource.net rishi_bhat@my-dejanews.com
    Re: Webresource.net <flavell@mail.cern.ch>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 20 Mar 1999 19:09:36 GMT
From: e_ron.no.spam@netvision.net.il (Ron)
Subject: Accessing database on a PC via ODBC
Message-Id: <36f3f204.800814@news.netvision.net.il>

Can someone explain how can I do it using Perl


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

Date: 20 Mar 1999 21:01:43 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Accessing database on a PC via ODBC
Message-Id: <7d12bn$4pm$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Ron <e_ron.no.spam@netvision.net.il> wrote:
> Can someone explain how can I do it using Perl

Err,

Using one of Win32::ODBC or DBD::ODBC which ever way you prefer -
probably the latter if you want to be more or less platform indpendent.

Please do not cross post to alt.perl if you want *me* to see your posts

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Mar 1999 12:48:51 -0500
From: "Gavin" <gaving@enter.net>
Subject: Berkley DB and Variable
Message-Id: <36f3deb7@news3.enter.net>

I am currently trying to store a graphic image into a DB File which is using
the MLDBM module.  The program is storing it properly, but when I try and
stream it to a web browser it appears the browser does not see the end of
the file.  I have already taken the value of $db{temp} and saved it to a
file.  It is storing the image perfectly into the DB.  It just wont send it
to the web browser.  If I cat the file and send that variable out it works.
I am wondering if there is some kind of buffering issue or something to that
effect.  Any help would be appreciated.  Please email me back

Program:

#!/usr/bin/perl5
$| = 1;
use DB_File;
use MLDBM qw (DB_File);
use Fcntl;
$dbfile = 'ads.db';


&opendb;

print "Content-Length: 15680\n";
print "Content-type: image/gif\n\n";
print $db{temp};
print "Connection: close\n";

## If I use this code it works properly
#
# $temp = `cat imagename`;
# print "Content-Length: 15680\n";
# print "Content-type: image/gif\n\n";
# print $temp;
# print "Connection: close\n";

&closedb;

sub opendb {
        tie (%db, 'MLDBM', $dbfile, O_CREAT|O_RDWR, 0666 || die $!);
}

sub closedb {
        untie %db;
}





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

Date: Sat, 20 Mar 1999 14:33:57 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Berkley DB and Variable
Message-Id: <1doyxog.1dzn96i7kbr4wN@p110.block2.tc4.state.ma.tiac.com>

[posted and mailed]

Gavin <gaving@enter.net> wrote:

> I am currently trying to store a graphic image into a DB File which is using
> the MLDBM module.  The program is storing it properly, but when I try and
> stream it to a web browser it appears the browser does not see the end of
> the file.  I have already taken the value of $db{temp} and saved it to a
> file.

How do you know that the image is being stored properly?

You haven't shown us that code, so we can't verify it.


> It is storing the image perfectly into the DB.  It just wont send it
> to the web browser.  If I cat the file and send that variable out it works.
> I am wondering if there is some kind of buffering issue or something to that
> effect.  Any help would be appreciated.  Please email me back
> 
> Program:
> 
> #!/usr/bin/perl5
> $| = 1;
> use DB_File;
> use MLDBM qw (DB_File);
> use Fcntl;
> $dbfile = 'ads.db';
> 
> 
> &opendb;
> 
> print "Content-Length: 15680\n";

Are you sure the image is 15680 bytes long?  Wouldn't it make more sense
to

print "Content-Length: ", length($db{temp}), "\n";


> print "Content-type: image/gif\n\n";
> print $db{temp};
> print "Connection: close\n";

What's this "Connection: close" thing?  I don't think I've ever seen
that before.


> ## If I use this code it works properly
> #
> # $temp = `cat imagename`;
> # print "Content-Length: 15680\n";
> # print "Content-type: image/gif\n\n";
> # print $temp;
> # print "Connection: close\n";

Okay, it works here, but you should still print the actual length,
and 'Connection: close' still baffles me.

> &closedb;
> 
> sub opendb {
>         tie (%db, 'MLDBM', $dbfile, O_CREAT|O_RDWR, 0666 || die $!);
> }

Try including the O_BINARY flag as well.  What OS are you on, BTW?


> sub closedb {
>         untie %db;
> }


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 20 Mar 1999 17:27:49 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Can an unchecked checkbox input pass a different value?
Message-Id: <Pine.HPP.3.95a.990320171044.27506C-100000@hpplus01.cern.ch>

On Fri, 19 Mar 1999, Greg wrote:

> Can un unchecked checkbox input still pass a value (i.e. it passes a value
> if checked, but can it pass a different value if unchecked)?

You seem to be somewhat confused.  If you are talking about a checkbox
in an HTML form, then the question is an HTML question (at the outside,
it's a CGI question), it has nothing specific to do with the Perl
language.  So look in the HTML spec or your favourite HTML tutorial.

Perl is a convenient language for processing the results of the form
submission, but Perl can have no influence over what a browser does or
doesn't do when it submits a form.

If you could tell us what you are trying to achieve, rather than
presenting a partially sketched-out (and evidently unworkable, as you
give it) solution to some unstated problem, perhaps you'd get better
help.  The HTML spec defines what happens with form "controls" when a
form is submitted: "successful" controls are included in what is
submitted, the rest are not included. An unchecked checkbox is not a
successful control, within the meaning of the HTML4.0 spec. Therefore
the answer to your question is "no". 

>  Perhaps I need
> to be looking to javascript to do this?

To do what?  The fact that the checkbox was not checked is communicated
to your script by the fact that its name=value pair is not present in
the submission.  So deal with that in your script.  And why risk
Javascript? It can implement useful enhancements, for those who consent
to enable it, but it's a mistake on the WWW to make anything critically
dependent on it unless there is no alternative. Anyhow, it has its own
group.  And FAQ, and resources. 

Take several steps back and consider what you are trying to achieve. 
Asking a Perl group whether Javascript is the answer to an HTML problem
for achieving some unstated purpose, does not seem a very efficient way
to proceed.

Good luck.



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

Date: 20 Mar 1999 09:24:27 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: CPAN
Message-Id: <m1ww0caxbo.fsf@halfdome.holdit.com>

>>>>> "Jonathan" == Jonathan Stowe <gellyfish@btinternet.com> writes:

Jonathan> Why would you *want* all of CPAN in one large file ?  There
Jonathan> are literally thousands of files and many of these are
Jonathan> various revisions of the same Modules.  The tar file of the
Jonathan> entire contents of CPAN would certainly be in the tens of
Jonathan> Megabytes if not more.

I just checked -- today's CPAN is 742 megs, and it's not likely to
compress much since nearly everything in it is already a .tar.gz.

FYI.

print "Just another Perl Hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 20 Mar 1999 11:04:03 -0600
From: "M. Usman Ghani" <m.usman.ghani@prodigy.net>
Subject: Expect in perl scripts - repost
Message-Id: <7d0k9t$csj0$1@newssvr04-int.news.prodigy.com>

Hi All,

I am writing a perl script to ftp some files.
The name of the files and how many are there is
not known.  So i am using mget * with interactive mode off.

I copied the ftp script from the book "perl 5 complete" and it
works.  It uses expect and part of the script is shown below:
$line = '';
$line .=<<"EOL"
set timeout -1
spawn $opt{'protocol'} -i $opt{'site'}

expect {
        "Name*):*" { send "$opt{'user'}\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        timeout  { puts "Timed Out\\n"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        "ftp>*" { send "quit\\r"; exit 1 }
}

expect {
        "Password:" { send "$opt{'pass'}\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout  { puts "Timed Out\\n"; exit 1; }
}

expect {
        "ftp>" { send "$opt{'mode'}\\r" }
        "successful" { send "$opt{'mode'}\\r" }
        "onnected to*" { send "$opt{'mode'}\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout { puts "Timed Out\\n"; exit 1; }
}

expect {
        "ftp>"  { send "cd $opt{'srcDir'}\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout { puts "Timed Out\\n"; exit 1; }
    }

expect {
        "ftp>"  { send "lcd $opt{'destDir'}\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout { puts "Timed Out\\n"; exit 1; }
    }

expect {
        "ftp>"  { send "mget *\\r" }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout { puts "Timed Out\\n"; exit 1; }
    }

expect {
        "ftp>"  { send "quit\\r\\r";  exit 0; }
        "failed" { send "quit\\r"; exit 1; }
        "error*" { send "quit\\r"; exit 1; }
  "No such file or directory" {send "quit\\r";
   puts "There are no files to be transferred"; exit 1; }
        "Service not available" { puts "Connection Dropped\\n"; exit 1; }
        timeout { puts "Timed Out\\n"; exit 1; }
}
EOL
;

open (EXPECT, "| /usr/local/bin/expect");
print EXPECT $line;
close (EXPECT);


My questions are as follows:

I would like to log detailed messages at every step if anything
goes wrong.  How can I either use print statements using a FILEHANDLE
from withing the above (i.e., expect) sigement.  I have tried to return
different values ( by replacing exit with return) but it did not work.

would someone help me
1) How can I return different values, depending on the success or failure of
   an instruction in expect, from the above segment.
2) Is it possible to print statements to two differnt filehandes.
   defined in the calling program, from the above ftp segment.
   puts in the expect segment prints to STDOUT which I am writing to a file
through
   Filehandle.  But how to print to another file as well?

3) Does signal handling work from the above segment.  I have tried to
   do that but it does not seem to work.  As an example, if ftp
   connection is not made for some time, signal INT (control-C) does not
   print the error message in the signal handling sub shown below:

 sub sighandler
{
local ($signal) = @_;
if ("$signal" eq "INT" || "$signal" eq "TERM") {
 print LOGIT "Interrrup of Terminate signal received -- Terminating\n";
 print STDOUT "Interrrup of Terminate signal received -- Terminating\n";
 exit;
}
}

In the calling part the following are defined:

$SIG{'INT'}      =  'sighandler';
$SIG{'TERM'}     =  'sighandler';

Any help will be appreciated.

Thank you.

M. Usman Ghani




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

Date: 20 Mar 1999 13:37:00 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Filehandle Q...
Message-Id: <m37lscatyr.fsf@joshua.panix.com>

bart.lateur@skynet.be (Bart Lateur) writes:

> I've always wondered why Perl has that many different different
> variables to return an error message? It makes no sense. I know of:
> 
> 	$!
> 	$?
> 	$@
> 	$^E
> 
> and I still may have missed a few.

They are orthogonal.  Have you read perlvar about each of them?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 20 Mar 1999 20:39:46 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Forwarding to home directory using Net::FTP
Message-Id: <7d112i$4n9$1@gellyfish.btinternet.com>

In comp.lang.perl.misc "Kevin S (xS)" <xs@dmusic.com> wrote:
> Hey,
> 
> I have had success with Net::FTP on most ftps, yet for some reason it does
> not seem to work on ftps where your home directory is not the root dir.
> Unlike other ftp clients, Net::FTP does not automatically forward you there,
> and it does not seem to set a variable as to what the home dir is. I have
> read the FTP RFC's yet they didn't provide much help.
> 

It really depends on the FTP server - if you login as a user that has a
home directory on the server in question and are not placed as your CWD
into that users home directory then there is something wromg with the ftp
server and not with anything else.

Do not cross post to alt.perl if you want *me* to see your post.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Mar 1999 20:25:25 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: FTP Recursive Directory Listing
Message-Id: <7d107l$4n6$1@gellyfish.btinternet.com>

In comp.lang.perl.misc "Kevin S (xS)" <xs@dmusic.com> wrote:
> Does anyone know how to get the a recursive listing off all the files and
> dirs on an ftp using Net::FTP? 

There is no way I know of directly getting a recursive directory listing
through the FTP protocol.  What you will have to do is get a directory
listing for your top level directory and then enter each subdirectory and
so on and so forth.

Also please do not cross-post to this group and to alt.perl in future if
you want an answer from *me* as I have kill-filled all such postings.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Mar 1999 19:49:26 GMT
From: webmaster@rcmtravelsite.com (Ron Charest)
Subject: GMT offset for clocks?
Message-Id: <36f5fb1c.2795023@news.mindspring.com>

I hope someone can help me with this - I'm brand new at Perl and CGI.
I'd like to build a clock that can be set to different GMT offsets.
I've seen several scripts for putting up clocks with server local
time, but can't see how to calculate the given GMT offset.

Would greatly appreciate any and all assist.

Regards,

Ron Charest
rcharest@mindspring.com


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

Date: Sat, 20 Mar 1999 18:32:11 -0000
From: "Mark Austin" <austin.m@virgin.net>
Subject: Help please - can't open .pl file
Message-Id: <7d0pgh$o3j$1@nclient3-gui.server.virgin.net>

Need to incorporate a Perl / CGI script for my web-site.
Got a freeware script (wwwboard.pl) that is near perfect but need to make a
few amendments (the author states this is allowed).
WWWboard was written for unix and I will be hosting it on a unix server
site.
Downloaded the latest version (5. something) of Perl and the Microsoft fix
thing they say necessary (I'm using Win95).
All auto-installed ok but when I double click on any of the .pl files, the
Perl scripting screen flashes up and then off again in a split second (you
can actually sort of see the script is there).
Also tried clicking on the Perl.exe file to get the scripting window up
(which worked) and then cut and pasted the script via Notepad - only the
first few lines came out.

Any ideas (plain English and non-profane preferred!).

Mark




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

Date: 20 Mar 1999 20:06:14 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: help with perl and win98
Message-Id: <7d0v3m$4n2$1@gellyfish.btinternet.com>

On Thu, 18 Mar 1999 23:29:38 -0500 Andrew Tipson wrote:
> Hi, I'm under the sad restriction of using windows98 for this particular
> server, and I'm trying to access remote documents to parse for a daily
> news update.  Unfortunately, my knowledge of how to do this is limited
> to unix, and none of those system commands work directly from windows.
> How can I do it win windows?  Basically I want to read
> http://www.slashdot.com/ultramode.txt into an array, which I'll then
> parse accordingly.  What should I use to download this remote document?
> Any example code would be very much appreciated.
> 

Well I tried this bit of code (straight outta lwpcook.pd virtually ):


#!/usr/bin/perl

use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("GellZilla GooGoo 666"); 

$req = new HTTP::Request 'GET' => 'http://www.slashdot.com/ultramode.txt';

$res = $ua->request($req);
if ($res->is_success) {
print $res->content;
} else {
print "Error: " . $res->status_line . "\n";
}


But I got :

   gellyfish@gellyfish:/home/gellyfish/clpmtest > getslashdot.pl
   Error: 404 Not Found

So I couldnt test if it worked or not ;-}

However if that is changed to 'slashdot.org' then its all a different
story ...

I suppose you have already sussed out how to split up the file by the '%%'
anyhow ..

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Mar 1999 14:34:00 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: HELP: Script would not execute but rather "save as" when submitted on a form.
Message-Id: <1doyy5r.56x9wahn4y9sN@p110.block2.tc4.state.ma.tiac.com>

KEhlar <KEhlarQUASH@SPAMMERtheglobe.com> wrote:

> I have a Perl script that's supposed to execute when the "submit" button
> is pressed on a form.  It was working okay for a while then all of a
> sudden it no longer executes, instead the "Save as" window comes up.  I
> was making changes to the script when it happened which led me to believe
> that it has nothing to do with the server or the file property of the
> script.  Also I was able to execute another Perl script that was in the
> same directory so the server is supporting Perl.  It seems that I must
> have removed something critical in the script that led to this.

With the situation you describe, it is likely that your script is not
outputting the proper Content-type header so the browser knows that it
should display the output rather than saving it.

If you do save to a file, what are the contents of that file?

You might also want to check your server's error logs, in case there's a
clue there to the problem.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 18 Mar 1999 21:14:14 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to find individual undefined array values?
Message-Id: <MPG.115b7cf886e47f0989787@nntp.hpl.hp.com>

In article <36F1D4DD.E4765ECF@yahoo.com> on Thu, 18 Mar 1999 22:38:54 -
0600, David <dave_illini_remove@yahoo.com >says...
> I've looked in my perl book, man pages, and web sites, but I can
> not find out how to check for individual undefined array
> elements? For example:
> $array[5..7]=23,29,44;
> How do I find out if any other array element is undefined.

  $n_undefined = grep !defined, @array;

 ...
>     Last, is there a way to specifically set any array value
> which is not specifically assigned a value to zero?  It's
> possible that my algorithm will call out
> $array[9]++; only. That would leave $array[0..8] with undefined
> values.

  defined or $_ = 0 for @array;

> Thanks for the help.  If you wish to only respond by email, then
> get rid of
> "_remove" from my Reply-To address.

If you wish to be responded to by email, then get rid of
"_remove" from your Reply-To address. 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 21 Mar 1999 01:05:09 +0800
From: Simon Ng <simon_ng@pacific.net.sg>
Subject: Mapping of Perl Extension in Personal Web Server
Message-Id: <36F3D545.FB49249E@pacific.net.sg>

Hi, anybody know how to map the perl extension into the window's
registry under the script map.

Thanks/Simon Ng





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

Date: Sun, 21 Mar 1999 00:45:43 +0800
From: Simon Ng <simon_ng@pacific.net.sg>
Subject: Mapping of Perl Extension....
Message-Id: <36F3D0B7.3226CF@pacific.net.sg>

Hi, anybody know how to map the perl extension into the window's
registry under the script map.

Thanks/Simon Ng




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

Date: 20 Mar 1999 18:58:39 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Mapping of Perl Extension....
Message-Id: <7d0r4v$4ij$1@gellyfish.btinternet.com>

On Sun, 21 Mar 1999 00:45:43 +0800 Simon Ng wrote:
> Hi, anybody know how to map the perl extension into the window's
> registry under the script map.
> 

Of course this not really a Perl question but something that is more to
do with the server.  But as luck would have it I have neglected to delete
the documentation for this from my web space - you can find the relevant
part of the MS documentation at :

<http://www.btinternet.com/~gellyfish/docs/map.html>

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Mar 1999 19:54:21 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Need Faster Approach
Message-Id: <7d0udd$bk3@news.service.uci.edu>

In article <MPG.11575678b709089798975d@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:

>In article <7ckafs$es1@news.service.uci.edu> on 16 Mar 1999 01:00:44 
>GMT, Earl Hood <ehood@medusa.acs.uci.edu> says...
>> In article <7ck0hd$krn$1@nnrp1.dejanews.com>,
>>  <frogsmock@my-dejanews.com> wrote:

>> >However,
>> >what I'm hoping for is a faster way (impossible?) to get to the 75,000th item
>> >instead of splitting off each preceding item.
>> 
>> Have looked into using index()/rindex()?

>How would one use either of those functions effectively to find the 
>75,000th item in a comma-delimited string, as requested?  Looping 
>through 75000 index() calls to find the 75,000th comma sounds like a 
>*very* costly procedure.

What do you think split does internally?

The first obvious advantage of using index() is that you save memory by
avoiding building a large list structure.

As for speed, one needs to determine if the apparent "extra" work going
into using an index() approach is faster or slower than the overhead
that a basic split() approach has building a list with many elements.

Of course, using Benchmark will help determine the fastest approach,
and I leave that as an exercise for the reader :-)

BTW, I think functions like index() and substr() get overlooked often
by using a regex instead, where the non-regex would be more efficient
even though the "amount" of Perl code is larger using index() and/or
substr().  For example, a base64 decoder using substr() instead of
any regexes, actually runs faster (assuming base64 decoding is done
all with pure Perl and and unpack()).

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Sat, 20 Mar 1999 14:34:01 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: problem with fnctl F_GETFL in Perlf5
Message-Id: <1doyyli.y0ylgs19gpzp8N@p110.block2.tc4.state.ma.tiac.com>

William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de> wrote:

> The value returns seems to be correct and the error occurs only once. I
> can get around it by leaving off the & before F_[S|G]ETFL. Is this some
> problem with Fcntl, with the documentation, or with my understanding?

This is a problem with the example in the Camel book.


perlsub:

    To call subroutines:

        NAME(LIST);    # & is optional with parentheses.
        NAME LIST;     # Parentheses optional if predeclared/imported.
        &NAME;         # Passes current @_ to subroutine.


Calling a subroutine with the &NAME syntax passes the current @_ to that
subroutine.  NAME and &NAME() pass an empty list to the subroutine.


As you discovered, you should leave off the & when using Fcntl's
exported items.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 20 Mar 1999 18:07:16 +0100
From: Philipp Gasser <pgasser@access.ch>
Subject: sort a 2dim Array
Message-Id: <36F3D5C4.E9FC83A0@access.ch>

Hello,

I would like to sort a 2dim array, but only on the column.
What's the perl syntax?
sort { $a[1][1] <=> $b[1][1] } @array

This way doesnt work!

Thanks philipp


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

Date: Sat, 20 Mar 1999 14:34:02 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: sort a 2dim Array
Message-Id: <1doyyyj.1c3kw2tx3c3mzN@p110.block2.tc4.state.ma.tiac.com>

Philipp Gasser <pgasser@access.ch> wrote:

> Hello,
> 
> I would like to sort a 2dim array, but only on the column.
> What's the perl syntax?
> sort { $a[1][1] <=> $b[1][1] } @array
> 
> This way doesnt work!

You're using elements of @a and @b in that sort subroutine.


Try the following instead:

sort { $a->[1][1] <=> $b->[1][1] } @array

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 20 Mar 1999 20:31:04 GMT
From: Armstrong Boca <revjack@radix.net>
Subject: Re: Text Wrapping without Text::Wrap
Message-Id: <7d10i8$3tk$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Allan M. Due explains it all:

:Nordstrom Walt <revjack@radix.net> wrote in message
:news:7d07c3$fjs$1@news1.Radix.Net...

:: Has anyone ever coded their own text wrap routine successfully?

:Once upon a time Tim Gim Yee posted that his cat had walked across his
:keyboard and came up with a subroutine to do just this.  The great thing is
:that it is really easy to find in dejanews.  Just search for cat walked
:across my keyboard.  It is a very nice little bit of code that lets you wrap
:where you like while not splitting words, and it allows you to specify the
:size of tabs.

It's rare that I actually smile while employing Dejanews, thanks.

I found it with no trouble, and it works like a charm.

-- 
  /~\  orate paraboloidal plunge administrate pyrite euphemism squirm 
 C oo  regrettable demolish yore acquittal yipping industrial applican
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://3509641275/~revjack  03/20/99 15:18:13 revjack@radix.net


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

Date: Sat, 20 Mar 1999 18:45:38 GMT
From: rishi_bhat@my-dejanews.com
Subject: Webresource.net
Message-Id: <7d0qcf$ob2$1@nnrp1.dejanews.com>

Hello,

My name is Rishi Bhattacharya.	I am the webmaster of webresource.net, a site
devoted to helping webmasters of all ranges of skill.  After a long break, we
have decided to 'start up' the site again.  I encourage you to view the
website before continuing.

http://www.webresource.net/

I am looking for writers for the CGI/Perl section of the website.  This is by
no means a 'brand new' site ... That is, you will not have to worry about
layout, templates for your articles, etc.  If you have a plethora of
knowledge on the subject, and have always wanted to write articles, this is
your chance!! Applicants should at least have 1 year of experience
programming perl/cgi and good writing skills.  Please include a few urls of
your work in your application.

Description of Webresource.Net

Webresource.net is a new web site devoted to archiving and sharing a complete
set of resources for web developers. Webresource.net is divided into
convenient sections, such as HTML, Databases, CGI, Java, etc... each
containing a thorough and carefully selected library of articles, scripts,
consulting services, and tutorials to assist web developers of all ranges of
skill.

Compensation will be discussed on a case by case basis.  If you are
interested, please send an email along with a few urls of your work to
rb25@hotmail.com.

Thank you for your time.

----
Rishi Bhattacharya             rishi_bhat@hotmail.com
Electrical Engineer            webmaster@webresource.net
NASA/Lockheed Martin    ---    http://www.lmco.com/
Webmaster, Founder      ---    webresource.net

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 20 Mar 1999 20:19:25 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Webresource.net
Message-Id: <Pine.HPP.3.95a.990320200315.27506F-100000@hpplus01.cern.ch>

On Sat, 20 Mar 1999 rishi_bhat@my-dejanews.com wrote:

> My name is Rishi Bhattacharya.	I am the webmaster of webresource.net, a site
> devoted to helping webmasters of all ranges of skill.
                                   ^^^^^^^^^^^^^^^^^^^

Except, it seems, for those who like to see valid HTML syntax, and those
who like to avoid adding pointless inaccessibility features to their web
pages.  I only spotted one of the many HTML syntax errors that seemed to
have any justifiable reason to be there; the rest were just pointless
carelessness like mis-matched tags, missing ALT attributes etc.

>  After a long break, we
> have decided to 'start up' the site again.  I encourage you to view the
> website before continuing.
> 
> http://www.webresource.net/

   [INLINE] Please visit our sponsor
                                                      Please Visit Our
   Sponsor

Not a good start.

                                   [LINK]

                      [Choose your destination!_______]

It doesn't work.  If you want to create javascript-only features, why
not create them with javascript, so that they are invisible to users who
don't wish (or aren't allowed by site policy) to enable javascript? 

   This week, we discuss a few ways to get streaming
   multimedia to your audience. August 24, 1998.

This week?  August?  Which calendar are you using?

And the HTML source:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

yeah, really.  Some "designer".



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5187
**************************************

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