[11491] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5091 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 9 01:07:24 1999

Date: Mon, 8 Mar 99 22:00:20 -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           Mon, 8 Mar 1999     Volume: 8 Number: 5091

Today's topics:
        8.3 problem / win32 perl pl2bat trickito@my-dejanews.com
        [HOW TO?] Strip all but certain characters from a strin <Jason@InsideMedicine.com>
    Re: A Question? (Steve Linberg)
        ActivePerl - How to drag and drop? (Nathan Neulinger)
    Re: constant in Perl? (Mark-Jason Dominus)
    Re: constant in Perl? (Mark-Jason Dominus)
        Copying perl cgi to the server? rcole6808@my-dejanews.com
    Re: Cross Platform DBMs (Steve .)
        FAQ 3.8: Is there a ctags for Perl?   <perlfaq-suggestions@perl.com>
        FAQ 3.9: Is there an IDE or Windows Perl Editor?   <perlfaq-suggestions@perl.com>
    Re: foreach question <amwalker@gate.net>
    Re: Help with an array <varnavas@iname.com>
        Hotmail style mail system needed (Brian Browning)
    Re: How to do a Case-insensitive Sort? (Ronald J Kimball)
        how to execute a script on a remote NT machine or commu (Ernie Mercer)
        how to execute a script on a remote NT machine or commu (Ernie Mercer)
        net sockets (Jim and Paula)
    Re: OLE, DBI-ODBC conflicts? <lynn@swcp.com>
        Q: How do i? <john_zaitsev@my-dejanews.com>
    Re: Q: How do i? <dimitrio@sympatico.ca>
        Question -- perl cgi running on local web app <smith.will@epa.gov>
        remote registry modules <kimntodd@dontspamus.execpc.com>
        Sendmail <raj@nyct.net>
        sigals <cm3eg@scms.rgu.ac.uk>
    Re: split? jwmauney@yahoo.com
    Re: Upload: 0 Bytes remnants@my-dejanews.com
        Using Multiple Servers <support@onlineauctions.co.uk>
    Re: voting application sample code wanted <mpflasch@3-cities.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 09 Mar 1999 02:22:36 GMT
From: trickito@my-dejanews.com
Subject: 8.3 problem / win32 perl pl2bat
Message-Id: <7c20l4$99v$1@nnrp1.dejanews.com>

hello all.  i have a question.	i have written a small perl program that will
upload files from a workstation to a server (both NT).	i have run it through
pl2bat so it will run as a batch file ('upload.bat') that takes an argument
via drag and drop.  that's all fine and good, works as advertised.

i want the file to be uploaded to the same directory on machine2 as it came
from on machine1 (the directory structures/drive letters are identical)
without the user doing anything more than dragging and dropping the file to
be uploaded onto upload.bat.

the problem is that the path info on the file that perl 'recieves' is 8.3 (in
other words /interf~1/blahbl~1/...).  my local machine as well as the target
machine both run the newest versions of dos and don't normally constrain me to
8.3 directory names.  is it the fact that i'm running it as a batch file?  why
is this happening?  anyone know a work-around???

thankx in advance!

todd
sf, ca

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


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

Date: Mon, 8 Mar 1999 22:03:49 -0500
From: "Jason Hatcher" <Jason@InsideMedicine.com>
Subject: [HOW TO?] Strip all but certain characters from a string
Message-Id: <7c27f6$dpo@enews2.newsguy.com>

I am looking for an efficient way to strip a string down to only certain
characters.

The output is 8 numbers followed by a the letter "S" or a number.

example   "4321-8765-S" would return 43218765S
or  "4321 876A5     A S" would return 43218765S
or  "432 1876-58 " would return 432187658

Any advice would be appreciated.

Thanks Again, Jason Hatcher




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

Date: Tue, 09 Mar 1999 02:50:08 GMT
From: slinberg@crocker.com (Steve Linberg)
Subject: Re: A Question?
Message-Id: <slinberg-0803992150090001@cc11620-a.lwmrn1.pa.home.com>

In article <36e55dd0.6429765@news.swbell.net>,
thrashem@fuckspam_swbell.net (Mega-thrasher) wrote:

> My question is, I have someone who sent me several e-mail attachments
> of .PL file type, does _anyone_ know where I could locate a
> plug-in type application/x-perl? 

If they're perl scripts (which often end in .pl), you just open them with
a text editor to read them.  If you want to run them (and running anything
blind without knowing what it does is always risky, even from trusted
sources), you will need to invoke the perl interpreter, whose details will
vary from platform to platform.

Of course, if you're not familiar with Perl, it would be odd for someone
to mail you scripts.  You might want to ask the sender.


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

Date: 8 Mar 1999 19:52:25 -0600
From: nneul@static-nneul.rollanet.org (Nathan Neulinger)
Subject: ActivePerl - How to drag and drop?
Message-Id: <slrn7e8vmn.74t.nneul@static-nneul.rollanet.org>

Is there any straightforward way to set up a perl script that can accept
drag and drop of files?

Ideally, I'd like to be able to have it handled the same way as @ARGV and <>, 
but a Win32 specific module would be ok.

Any ideas?

-- Nathan



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

Date: 9 Mar 1999 00:29:49 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: constant in Perl?
Message-Id: <7c2bkd$f2l$1@monet.op.net>

In article <36E43A99.554D506B@gte.com>, Yu Fang  <yfang@gte.com> wrote:
>try this --
>header.pl: 
>	sub PI () { 3 }
>	1;
>
>body.pl"
>	#!/usr/local/bin/perl
>	require 'header.pl';
>
>	print PI, "\n";
>
>It won't work, 

Well, that's because you did it wrong.  If you want a compile-time
constant, you have to define it at compile time:

	#!/usr/local/bin/perl
	BEGIN { require 'header.pl' }

	print PI, "\n";


`require' happens at run time, which is too late, so you put it in a
`BEGIN' block to make it happen sooner.






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

Date: 9 Mar 1999 00:35:22 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: constant in Perl?
Message-Id: <7c2buq$f9g$1@monet.op.net>

In article <36E42C37.B2D0B6DF@gte.com>, Yu Fang  <yfang@gte.com> wrote:
>I want to use constants in C-header-file-like file. i.e.
>header.pl:
>	use constant CONSTANT => 1;
>	1;
>
>body.pl:
>	require 'header.pl';
>	$const = CONSTANT; # will fail
>

	BEGIN { require 'header.pl' }


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

Date: Tue, 09 Mar 1999 01:33:46 GMT
From: rcole6808@my-dejanews.com
Subject: Copying perl cgi to the server?
Message-Id: <7c1tpq$6q7$1@nnrp1.dejanews.com>

So I've sweated over my first perl script "htmlcrawl.pl". I've put in some
lines to make a CGI program out of it, renamed this new file "htmlcrawl.pm",
and placed it in the \CGI-Shell directory.

Now I'm trying to get the Netscape Enterprise Server 3.0 (NT) to recognize
this file so I can run the CGI program from my Firm's intranet. I have added
\CGI-Shell to the CGI Directory and CGI Shell Directory. When I enter
 .../CGI-Shell/htmlcrawl.pm into the browser, the server never sends the page.

What can I do to get the server to serve the CGI program? Do I need to run the
file through a CGI compiler? Do I need to register the CGI directory in NES3
Content Management?

Any help would be greatly appreciated. Thanks  RC

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


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

Date: Tue, 09 Mar 1999 05:38:10 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: Re: Cross Platform DBMs
Message-Id: <36e4b350.49711335@news.enteract.com>

Actually, if I'm not mistaken, the perl dbm files are portable to any
platform that supports perl.  You just need to convert the database to
ASCIIi and then back again.  We do it all the time between our boxes.
As a matter of fact one of our developers does his scripts on an NT
box and I run them on an SGI, Solaris, and Linux boxes.  All work fine
converting to ascii and then back to a dbm file on the selected
system.

Steve

Remove nospam when responding thru email.

On 5 Mar 1999 16:29:31 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:

> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, 
>    Simeon McAleer <mcaleer@jlab.org> writes:
>:I am trying to use a internal PERL DBM database to record the output of
>:some programs I am running. On Sun machines perl database files are
>:created in pairs with the file extensions .dir and .pag. On Linux there
>:is only one file created with a .db extension. The files created on one
>:platform can not be accessed by PERL on the other platform. Does any one
>:know how to get around this problem? Thanks in advance.
>
>Put a
>
>    use DB_File;
>
>in the top of the script.  This will require some more work on the
>Sun to get the thing installed, but at least now it should work.
>
>--tom



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

Date: 8 Mar 1999 19:43:39 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.8: Is there a ctags for Perl?  
Message-Id: <36e48adb@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  Is there a ctags for Perl?

    There's a simple one at
    http://www.perl.com/CPAN/authors/id/TOMC/scripts/ptags.gz which
    may do the trick. And if not, it's easy to hack into what you
    want.

-- 
"In 1980, a single person could understand the UNIX kernel. In
1990, a single person couldn't even lift it!"
                              - Steve Zucker (as qutoed by Dick Dunn )


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

Date: 8 Mar 1999 22:13:42 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.9: Is there an IDE or Windows Perl Editor?  
Message-Id: <36e4ae06@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  Is there an IDE or Windows Perl Editor?

    If you're on Unix, you already have an IDE -- Unix itself. You
    just have to learn the toolbox. If you're not, then you probably
    don't have a toolbox, so may need something else.

    PerlBuilder (XXX URL to follow) is an integrated development
    environment for Windows that supports Perl development. Perl
    programs are just plain text, though, so you could download emacs
    for Windows (XXX) or vim for win32
    (http://www.cs.vu.nl/~tmgil/vi.html). If you're transferring
    Windows files to Unix, be sure to transfer in ASCII mode so the
    ends of lines are appropriately converted.

-- 
You are the sponsor for the account andrew (Andrew Hume).


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

Date: Mon, 08 Mar 1999 21:41:25 -0500
From: Aaron Walker <amwalker@gate.net>
To: "Mark P." <mag@imchat.com>
Subject: Re: foreach question
Message-Id: <36E48A55.8780D43C@gate.net>

Actually, here is what I'm trying to do.  I should've just posted the
complete script in the first place.

Okay, I am attempting to write my own small search engine for my intranet...

here's what I have so far:

#!/usr/bin/perl
# simple search engine CGI script

print "Content-type: text/html\n\n";

@dir = ("/www/htdocs");      #directories to search in
$ls = `ls $dir[0]`;                  #list files in that directory
@ls_output = $ls;                 #assign output of ls command to array

print "<html>";

#this is all the URL encoding stuff
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
     ($name, $value) = split(/=/, $pair);
     $value =~ tr/+/ /;
     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
     $value =~ s/~!/ ~!/g;
     $FORM{$name} = $value;
}

#assign value of text box to search_string
$search_string = $FORM{'search_string'};

#error checking on the form, although
#it is not completely foolproof.
#Someone could just press spacebar...
#TODO: find a better way to do this.

if ($FORM{'search_string'} eq "")
{
     print "<head><title>ERROR</title></head>";
     print "<body><center><h3>You left the text box blank!</h3></center>";
}

else {
     foreach $file (@ls_output)

     ^^^^^^ THE PROBLEM is here...
     the output of "ls" is multiple files.
     so, below it is trying to open all the files as one filename.
     I want it to sort through the @ls_output array and try to
     open one file at a time.  This is what I do not know how to
     do.   Could someone be kind enough to explain?

     {
          open(FILE, $file);
          @contents = <FILE>;
          close(FILE);

          foreach $line (@contents)
          {
               chop $line;
               if ($line =~ /$search_string/i)
               {
                    print "<body><h2>match found - $file</h2></body>";
               }
          }
     }
}

Thanks very much for your help,
Aaron

"Mark P." wrote:

>         Try something like this.
>
> $datadir = "./";
>
>   opendir(COP, "$datadir") || die $!;
> @filenames = grep (/\.*$/i,readdir(COP));
> closedir(COP);
>
>         print "Content-type: text/plain\n\n";
>
>  foreach $file (@filenames)
>      {
>         print "$file\n";
> # you can do any sub routine here like a grep. I just printed it for
> grins.
> }
>
> On Mon, 08 Mar 1999 19:24:43 -0500, Aaron Walker <amwalker@gate.net>
> wrote:
>
> >hello,
> >
> >here's the program I have:
> >
> >---- start ----
> >#!/usr/bin/perl
> >$ls = `ls`;
> >@ls_output = $ls;
> >
> >foreach $file (@ls_output)
> >{
> >        print $file;
> >}
> >---- end ----
> >
> >say I'm in the directory: /home/amwalker.
> >in that dir are three files: file1, file2, file3.
> >
> >The above script will print out:
> >file1
> >file2
> >file3
> >
> >What I want is to process each file separately
> >for example, say I am going to search file1 for something.
> >if I use the foreach loop, then it will try to look for the file called
> >"file1file2file3" but
> >it won't exist.  How would I go about looking at one file at a time?
> >
> >I hope the above is not confusing anyone :-)
> >
> >thanks for the help,
> >Aaron
> >



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

Date: Mon, 08 Mar 1999 20:15:45 -0500
From: Frank Varnavas <varnavas@iname.com>
To: Steve Jackson <steve@cyber-distributors.com>
Subject: Re: Help with an array
Message-Id: <36E47641.B61179F@iname.com>

This is one of those times when you need to create a simple case and
figure out where your problem really is.

like:

         open(FILE,"all.txt") || die "DONT FORGET THIS NEXT TIME\n";
         @c1 = <FILE>;
         close(FILE);
         $try=0;

         $c1[$try] = $allenter;     <-- doesnt work ??

         open(FILE,">all.txt") || die "HERE EITHER!\n";
         print FILE @c1;
         close(FILE);


Steve Jackson wrote:
> 
> Ok I thought I could do it - but can't figure one line out.
> basically i want to take a variable $allenter (inside that is
> a varable called $item3) and replace the existing line in @c1.
> 
> Here's a snip of the code (simplified) basically all rems taken out:
> 
> (There is an incoming variable called $in{'itemnum'})
> 
> sub editrev{
>         #this is the new information
>         $allenter = $all3;
> 
>         open(FILE,"all.txt");
>         @c1 = <FILE>;
>         close(FILE);
>         $try=0;
> 
>         foreach $thing(@c1) {
>                 @stuffy = split(/\(\(/, $thing);
> 
>                 $item1 = $stuffy[0];
>                 $item2 = $stuffy[1];
>                 $item3 = $stuffy[2];
>                 $item4 = $stuffy[3];
>                 $item5 = $stuffy[4];
>                 $item6 = $stuffy[5];
>                 $item7 = $stuffy[6];
>                 $item8 = $stuffy[7];
>                 $item9 = $stuffy[8];
> 
>                 if ($in{'itemnum'} eq $item3) {
> 
>                         $c1[$try] = $allenter;     <-- doesnt work ??
>                 }
> 
> }
> 
>                 open(FILE,">all.txt");
>                 print FILE @c1;
>                 close(FILE);
>                 print "Content-type: text/html\n\n";
>                 print "DONE...\n";
>                 exit;
> }
> 
> Thanks!
> 
> Steve


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

Date: Tue, 09 Mar 1999 04:51:36 GMT
From: bbrowning@hotmail.com (Brian Browning)
Subject: Hotmail style mail system needed
Message-Id: <sN1F2.11$rU5.68@news.rdc1.ab.wave.home.com>

We are looking into adding a free email service to our consumer websites.  
Does anyone know of a cgi script or other type of program that can accomplish 
this for us.

We are currently using a Virtual Hosting service and not our own dedicated 
server.  However we do have unlimited POP mail privledges.

Thanks for your assistance.

Brian Browning
North Pole Media
bbrowning@home.com


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

Date: Mon, 8 Mar 1999 23:19:10 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: How to do a Case-insensitive Sort?
Message-Id: <1dode6k.198xng41g947ccN@bay1-149.quincy.ziplink.net>

Larry Rosler <lr@hpl.hp.com> wrote:

> 2.  Nevertheless, your generalization that a Schwartz Transform loses
> when the comparison function is simply lc() is correct.  Greg Bacon sees
> 'Too many lc()s' and concludes incorrectly that this is expensive.  It
> is not.  lc() is a built-in function whose execution is not 
> significantly more expensive than other Perl expressions, such as array
> access through a reference.


use Benchmark;

$uc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' x 10;

$lc_ref = [ $uc, lc $uc ];

timethese(1 << 17, {
  lc_ => sub { lc $uc },
  deref => sub { $lc_ref->[1] },
});
__END__
Benchmark: timing 131072 iterations of deref, lc...
     deref:  1 secs ( 0.64 usr  0.01 sys =  0.65 cpu)
       lc_:  3 secs ( 1.39 usr  0.00 sys =  1.39 cpu)


Here, it appears that lc() is slower than array access through a
reference.

Of course, that's with a somewhat lengthy string.  What if $uc is, say,
empty?


use Benchmark;

$uc = '';

$lc_ref = [ $uc, lc $uc ];

timethese(1 << 17, {
  lc_ => sub { lc $uc },
  deref => sub { $lc_ref->[1] },
});
__END__
Benchmark: timing 131072 iterations of deref, lc...
     deref:  0 secs ( 0.64 usr  0.00 sys =  0.64 cpu)
       lc_:  0 secs ( 0.50 usr  0.00 sys =  0.50 cpu)


Okay, a moderate difference in the other direction.


So, lc() is somewhat faster than array access through a reference, but
only for short strings.  For long strings, array access through a
reference is clearly faster.


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


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

Date: Tue, 09 Mar 1999 03:59:55 GMT
From: emercer@wma.com (Ernie Mercer)
Subject: how to execute a script on a remote NT machine or communication between Tk windows on separate machines?
Message-Id: <36e48e08.260552254@news.wma.com>


I'm trying to develop a fairly simple "chat" type application to allow
two people to communicate from separate workstations. I've created a
functioning gui front-end using Perl/Tk. What I need to do though is
once the user clicks the "send" button it must then execute/launch the
corresponding script on the remote Windows NT machine (identified by
machine name/IP or user login), while passing the necessary arguments
to display the message to the receiver of the chat session.

I've seen some vague references in the Perl/Tk documentation and mail
groups about "send" and "rmt" commands for communicating between
Perl/Tk applications and remote machines, but have been unable to find
any documentation or examples on how to use them.

I also tried using the remote console funtion from the NT resource
kit, but while it would execute the perl script on the remote machine
(it shows as running in the processes window) the Tk window never
displays for the user.

I also tried co-opting the NT "net send" function, but it's not
possible to put a wrapper around it to intercept it's messages.

Does anyone have suggestions on how this can be accomplished?

Thanks.

Ernie Mercer
emercer@wma.com




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

Date: Tue, 09 Mar 1999 04:07:29 GMT
From: emercer@wma.com (Ernie Mercer)
Subject: how to execute a script on a remote NT machine or communication between Tk windows on separate machines?
Message-Id: <36e49e18.264664237@news.wma.com>

I'm trying to develop a fairly simple "chat" type application to allow
two people to communicate from separate workstations. I've created a
functioning gui front-end using Perl/Tk. What I need to do though is
once the user clicks the "send" button it must then execute/launch the
corresponding script on the remote Windows NT machine (identified by
machine name/IP or user login), while passing the necessary arguments
to display the message to the receiver of the chat session.

I've seen some vague references in the Perl/Tk documentation and mail
groups about "send" and "rmt" commands for communicating between
Perl/Tk applications and remote machines, but have been unable to find
any documentation or examples on how to use them.

I also tried using the remote console funtion from the NT resource
kit, but while it would execute the perl script on the remote machine
(it shows as running in the processes window) the Tk window never
displays for the user.

I also tried co-opting the NT "net send" function, but it's not
possible to put a wrapper around it to intercept it's messages.

Does anyone have suggestions on how this can be accomplished?

Thanks.

Ernie Mercer
emercer@wma.com


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

Date: Tue, 09 Mar 1999 03:17:31 GMT
From: gemhound@gemhound.com (Jim and Paula)
Subject: net sockets
Message-Id: <36e49250.31627066@news.primeline.com>

I'm trying to learn internet sockets and having no luck at all.  Could
someone just post or send a small Working example of connecting and
gettting a domain Name from a Number i.e.  translate 12.18.59.111 to
somebody.com   That's all I need to do for a server log analysis
program I'm working on.  Or tell me where a script is that has that.
If I can get one thing working that I can put in a useful program, I
think I can go on from there.

I'm using ActiveState Win32 Perl, which may be one problem, at least
as regards references, since out of the five b Perl books I have, the
only one with explicit detail  on sockets that actually tells you what
all the variables are for is not Win32 oriented.  Also, the title of a
good book on this would be appreciated, although I just blew well over
a hundred bucks on those five, so I'll wait a bit on that ;')  Boy,
these computer books are high.

My apologies if this is a dupe. My rotten ISP has been promising to
fix News for nine months now, since you usually can't post to their
stuffed disk, and updating is flukey.  I think this went out on deja
but it hasn't downloaded to our ISP yet.  And they are the only game
in a small town, alas.


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

Date: Mon, 08 Mar 1999 20:32:31 -0700
From: Lynn Wilson <lynn@swcp.com>
To: Jan Dubois <jan.dubois@ibm.net>
Subject: Re: OLE, DBI-ODBC conflicts?
Message-Id: <36E4964F.E92C88B@swcp.com>



Jan Dubois wrote:
> 
> It would help if you would at least show how it fails (error message). Are you
> running your program with "perl -w"?
> 
> You could try to insert the following statement directly after your
> "use Win32::OLE;" statement and see if it helps.
> 
>     Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE);
> 


The 'Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE);' did the
trick!!!
Now I've got to go find out what it is that it does.

Many, many thanks!
smiles,
Lynn


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

Date: Tue, 09 Mar 1999 02:07:47 GMT
From: John Zaitsev <john_zaitsev@my-dejanews.com>
Subject: Q: How do i?
Message-Id: <7c1vpd$8e5$1@nnrp1.dejanews.com>

I have a little problem. Now I'm trying to write search engine for my site
(lyrics search engine). And I gat a problem. I have a couple of files and
common info in it (artist, single, year, songs, etc.). How can I organise
hash to best processing? (first of all, engine will search only artists,
albums and songs). At the present time I use lame algorithm with counter as a
hash. Such this: $index = 0; $hash{$index} = $artist_name; $hash{"$index
album"} = $album; $hash{"$index year"} = $year;

etc.
What the best way to organise my hash?
Thanks for all, whose listen my rave.

SY,
   John

PS/2: Sorry for my lame English :( I'm from Russia
PPS/2: You can either answer to my Fidonet address: 2:5037/24@Fidonet.

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


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

Date: Tue, 09 Mar 1999 04:42:30 GMT
From: Dimitri Ostapenko <dimitrio@sympatico.ca>
Subject: Re: Q: How do i?
Message-Id: <36E4A208.6FB7DABE@sympatico.ca>



John Zaitsev wrote:

> I have a little problem. Now I'm trying to write search engine for my site
> (lyrics search engine). And I gat a problem. I have a couple of files and
> common info in it (artist, single, year, songs, etc.). How can I organise
> hash to best processing? (first of all, engine will search only artists,
> albums and songs). At the present time I use lame algorithm with counter as a
> hash. Such this: $index = 0; $hash{$index} = $artist_name; $hash{"$index
> album"} = $album; $hash{"$index year"} = $year;
>
> etc.
> What the best way to organise my hash?
> Thanks for all, whose listen my rave.
>
> SY,
>    John
>
> PS/2: Sorry for my lame English :( I'm from Russia
> PPS/2: You can either answer to my Fidonet address: 2:5037/24@Fidonet.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Why not:
%artist = ('Presniakov:Best Album' => 'Year:song1:song2:song3',
                'Mashina:Life sucks' => 'year:song1:song2:song3);

this hash can be written easily into dbm file. (See dbmopen/dbmclose and tie in
Camel book)

Then you can use power of Perl to parse key=>value pairs.

This is very primitive way to do it, ideally you want to use data records and
database, but I found that Perl is very efficient in parsing  relatively large
text files. Of course it depends on complexity of the grammar, but in this case
it seems to be *very* straightforward, which means high efficiency.

--
Dimitri OstapenkO
CAD Designer/Sys. Admin.
Fantom Technologies Inc.




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

Date: Mon, 8 Mar 1999 11:34:31 -0700
From: "William Smith" <smith.will@epa.gov>
Subject: Question -- perl cgi running on local web app
Message-Id: <7c0u9j$elb1@valley.rtpnc.epa.gov>

Is there a way for a web app to run a perl cgi on the local PC, rather than
on the server.

I want to distribute a web app on CD so the users can run it locally. The CD
would contain perl and all data the the web app requires. The web app uses a
perl cgi and I want the cgi to run on the local machine and send the html
back to the browser. Is there a way to do this other than running server
software on the local machine?




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

Date: Mon, 8 Mar 1999 19:25:30 -0600
From: "End User" <kimntodd@dontspamus.execpc.com>
Subject: remote registry modules
Message-Id: <7c1tag$eb9@newsops.execpc.com>

I am sure that someone out there has had cause to write a module to interact
with the registries of remote NT systems that are on thier network. I am in
need of such a module or routine, and being more an admin type than a
programmer, i came here to ask for your wizzardly assistance.

I want to be able to read and write to the registry on about 70+ servers in
my datacenter, but havent a clue how to do it. It would also be stellar if
there was a way to interact with the compaq eisa partition on those machines
as well.

Any takers?

Thank you in adavance.
--
Todd Hayward
Global Analyst, Systems Engineer
MCSE, Compaq ACT
noc at bakernet dot com




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

Date: Tue, 9 Mar 1999 00:31:44 GMT
From: Rajan Alexander <raj@nyct.net>
Subject: Sendmail
Message-Id: <36E46BF0.69D1@nyct.net>

I am using Matt Kruse's sendmail script and it gives the error "Broken
Pipe" without a line number.  Here are most likely the offending lines:

open (SENDMAIL,"$SENDMAIL") || die "Ain't Gonna Happen";
print SENDMAIL "To: raj\@nyct.net\n";
print SENDMAIL "Subject: \$SUBJECT\n";
 ...

close(SENDMAIL);  


Does anyone have any experience with this?  I am using my ISP's server.


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

Date: Mon, 08 Mar 1999 20:00:07 +0000
From: Edwin Garland <cm3eg@scms.rgu.ac.uk>
Subject: sigals
Message-Id: <36E42C46.FC1A5A0@scms.rgu.ac.uk>

Hi all,

Does anyone know how you catch a signal from a child process once it has
finished?



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

Date: Tue, 09 Mar 1999 01:30:17 GMT
From: jwmauney@yahoo.com
Subject: Re: split?
Message-Id: <7c1tj9$6nq$1@nnrp1.dejanews.com>

In article <36E44928.F3FBA29E@giss.nasa.gov>,
  jglascoe@giss.nasa.gov wrote:
> [courtesy copy of post sent to cited author]
>
> bing-du@tamu.edu wrote:
> >
> > Hello there,
> >
> > There is a string  $test = "3:http://www.test.edu/building.html".
> >
> > How to split this string to get two parts.  One is "3" and the other is
> > "http://www.test.edu/building.html"?

> how about:
>
> ($first, @rest) = split /:/, $test;
> $second = join '', @rest;
                 ^^
Maybe            ':'    would be a better choice here.

>
> OR [snip}
>
> 	Jay Glascoe

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


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

Date: Tue, 09 Mar 1999 00:47:08 GMT
From: remnants@my-dejanews.com
Subject: Re: Upload: 0 Bytes
Message-Id: <7c1r29$4dl$1@nnrp1.dejanews.com>

Toggweiler Mike <ntogmi@abs.ascom.ch> wrote:
    >
    > Wenn ich diese im Netscape mit folgender Routine uploade,
    > funktionert es. Sobald ich aber IE (3 oder 4) benutze,
    > werden zwar die Dateien kreiert, aber keine Daten darin
    > gespeichert (0 Bytes).

As shipped, MSIE 3 & 4 do NOT support uploads via multipart/form-data
form encoding, but Microsoft do offer patches to fix this in 3.02+.  For
3.02, you can find the patch at ...

    http://mskyus.www.conxion.com/msdownload/ieinstall/en/rfc1867.exe

For 4.0+, I believe the fix is in the first service pack.


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


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

Date: Tue, 09 Mar 1999 03:45:20 +0000
From: On Line Auctions UK <support@onlineauctions.co.uk>
Subject: Using Multiple Servers
Message-Id: <36E49950.4FBE2EEE@onlineauctions.co.uk>

I have got two servers one with the main script on it and another that i
want to pass data to. I need to post two variables like
http://host.com/cgi-bin/script.cgi?var1=thing&var2=thing2 to the script
on the other server. But how do actually code this in Perl.

any ideas

Thanks

Gary



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

Date: Mon, 8 Mar 1999 21:57:45 -0800
From: "MPFlasch" <mpflasch@3-cities.com>
Subject: Re: voting application sample code wanted
Message-Id: <36e4b713@news-out2.newsnerds.com>

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Survey_and_Voting/

lots of good scripts there, worth a look.  Hope this helps.

     Relic

Greg N. > <"Greg N." <yodel_dodel@yahoo.com> wrote in message
news:7c18mj$jpg$1@nnrp1.dejanews.com...
>I need a simple voting application written in Perl/CGI.  It should work
like
>this:
>
>- There is a table of data, where each row has one cell containing a voting
>counter, and a voting button.
>
>- If a user clicks a voting button, the corresponding counter is increased
>
>- If the voter's IP address is the same one as the one where the last vote
>for that item came from, the vote is ignored.
>
>- all votes (time, IP addr, item) are logged in a sequential file
>
>Does anybody have a piece of code along those lines?  Can anybody point to
>some publicly available code?
>
>Any response highly appreciated.
>
>Greg N.
>http://www.neatone.com
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

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

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