[16068] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3480 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 26 11:06:02 2000

Date: Mon, 26 Jun 2000 08:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <962031917-v9-i3480@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 26 Jun 2000     Volume: 9 Number: 3480

Today's topics:
    Re: $$variable_name help <care227@attglobal.net>
    Re: 500 Internal Server Error? twolfmaier@acm.org
    Re: Any Perl experts around? (Michel Dalle)
    Re: C prog access to dbi? <gellyfish@gellyfish.com>
        Changing Case Continued! (Horse Nuts)
        Changing case in a file! (Horse Nuts)
    Re: Changing case in a file! <mike.solomon@eps.ltd.uk>
    Re: Changing case in a file! <mike.solomon@eps.ltd.uk>
    Re: Changing case in a file! <tony_curtis32@yahoo.com>
    Re: Changing case in a file! <rootbeer@redcat.com>
    Re: Concatenate String <abe@ztreet.demon.nl>
    Re: Concatenate String <care227@attglobal.net>
    Re: Creating a cause from information. malverian@my-deja.com
    Re: Creating a cause from information. (Tad McClellan)
    Re: dbi oracle Select example <rootbeer@redcat.com>
    Re: defined() (Tad McClellan)
    Re: Encryption <gellyfish@gellyfish.com>
    Re: Golf (Was: Re: HELP ME PLEASE !!!!) <chez@bigfoot.com>
    Re: Golf (Was: Re: HELP ME PLEASE !!!!) (Keith Calvert Ivey)
    Re: Golf (Was: Re: HELP ME PLEASE !!!!) <uri@sysarch.com>
    Re: Hard Disk Serial# <andy@u2me3.com>
    Re: Hard Disk Serial# <mdemello@pound.ruf.rice.edu>
        help : Posting a file through a form through to email <shepherd@ihug.com.au>
    Re: help : Posting a file through a form through to ema <rootbeer@redcat.com>
        help with forms <andybarlow70NOanSPAM@hotmail.com.invalid>
    Re: HLP: SDBM_File problem concering element length <rootbeer@redcat.com>
    Re: How is a unique sort done? Like unix "sort -u" <Peter.Dintelmann@dresdner-bank.com>
        How to open a FIFO created with C in perl? st95lzd@21cn.com
    Re: How to open a FIFO created with C in perl? nobull@mail.com
    Re: How to open a FIFO created with C in perl? <gellyfish@gellyfish.com>
    Re: howto use the package "Filter::*" ? <rootbeer@redcat.com>
    Re: indentifying country origin using perl?? <gellyfish@gellyfish.com>
    Re: indentifying country origin using perl?? <tony_curtis32@yahoo.com>
    Re: Know of any good perl books? <care227@attglobal.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 26 Jun 2000 09:59:47 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: $$variable_name help
Message-Id: <395761D3.6D379C58@attglobal.net>

Bart Lateur wrote:
> 
> Drew Simonis wrote:
> 
> >> If I have the following variables:
> >>    my $aa = 10;
> >>    my $bb = 'aa';
> 
> >> I would expect $$bb to print 10. Instead it appears to be printing
> >> nothing.
> >
> >Why do you expect that to be the case?
> 
> Drew, Drew, Drew... Don't tell me you've never heard of "symbolic
> references"?

I have too, but the OP was using my().

> 
> And that brings us back to the original problem: symbolic references
> *only* work with global variables.

Which is why I showed how to use non-symbolic reference.


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

Date: Mon, 26 Jun 2000 12:57:15 GMT
From: twolfmaier@acm.org
Subject: Re: 500 Internal Server Error?
Message-Id: <8j7jv3$89h$1@nnrp1.deja.com>


> I am trying to install a cgi/pl script and everytime I click on the
url
> it gives me the following error message....

Two mistakes I always make that could cause this error:

1. Ftp file from Windows to UNIX machine in binary instead of ascii
mode.

2. Forget to set file permissions to 755.

Beyond that, ...

Why don't you install Perl and a webserver (Apache) on your local
machine and test the script first. Both are free and easy to install.

Or if you have telnet access to your account, run the script from the
command line.

Thomas

-----------------------------------------------------
Thomas Wolfmaier
Human-Computer Interaction Resource Network (HCIRN)
25 Bucks Green Road, Thornhill, ON, Canada, L3T 4G1
Tel: +1-905-881-7095
Email: twolfmaier@acm.org
Web: www.hcirn.com
-----------------------------------------------------


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 26 Jun 2000 14:14:44 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Any Perl experts around?
Message-Id: <8j7olm$i4h$1@news.mch.sbs.de>

In article <8j0gmq$iab$1@nnrp1.deja.com>, farahas@my-deja.com wrote:
>Does everybody in NGs have a dry sence of humour as you guys.....or is
>this the way people communicate on NGS??
>Just curious!!!
>
>Farah

Well, let's just say that your post was either very sad or mildly
humorous, depending on how you look at it. I decided to consider
it a bit humorous, and replied in the same manner...

If you had spent even a single day looking at the different articles
posted in this newsgroup before asking your question, you would
have figured out the answer for yourself.

For your future Usenet experience, you might want to check out the
regular posts in news.announce.newusers, or check out the Usenet
Help at http://metalab.unc.edu/usenet-i/usenet-help.html.

HTH,

Michel


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

Date: 25 Jun 2000 20:59:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: C prog access to dbi?
Message-Id: <8j5oam$o73$1@orpheus.gellyfish.com>

On Sun, 25 Jun 2000 11:28:31 -0400 cc wrote:
> Does anyone know how to call dbi from a C program.  We want to
> distribute binaries and source.  Actually, we wrote the whole system in
> java and the performance is not acceptable, so we are exploring the
> possibility of writing a database io component in dbi.  We want to
> distribute binaries if possible to simplify installation.  Ideas?
> 

I dont think that is very sensible.  Most database vendors will provide
a C interface which you can write to.  I would look to the documentation
for the database.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Mon, 26 Jun 2000 13:52:07 GMT
From: hx_101@hotmail.com (Horse Nuts)
Subject: Changing Case Continued!
Message-Id: <39585f3d.243878819@news.dal.ca>

Here is a simple html file that looks lie the following:


<TR><TD><a href="HTTP://XXX.COM/~XX">XXXX</a></td><TD>ALAN
</td></tr><br> 
<TR><TD><a href="HTTP://YYYYY.COM/~YY">YYYY</a> </td><TD>ALBERT
</td></tr><br>
<TR><TD><a href="HTTP://ZZZZZ.COM/~ZZ">ZZZ</a> </td><TD>SALEH
</td></tr><br>


I would like to change ONLY  the URL to lower case in the entire file,
this file could have 100's of entries...

Thanks


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

Date: Mon, 26 Jun 2000 12:53:09 GMT
From: hx_101@hotmail.com (Horse Nuts)
Subject: Changing case in a file!
Message-Id: <395751c6.240431552@news.dal.ca>

I have a bunch of HTML links in a file and would like to change the
case from upper to smaller, is it possible with a perl script????

Thanks


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

Date: Mon, 26 Jun 2000 14:09:12 +0100
From: "mike solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Changing case in a file!
Message-Id: <8j7ko7$67hsg$1@fu-berlin.de>

its certainly possible

how about

$foo =~ lc;


Regards


Mike Solomon

Horse Nuts <hx_101@hotmail.com> wrote in message
news:395751c6.240431552@news.dal.ca...
> I have a bunch of HTML links in a file and would like to change the
> case from upper to smaller, is it possible with a perl script????
>
> Thanks




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

Date: Mon, 26 Jun 2000 14:18:36 +0100
From: "mike solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Changing case in a file!
Message-Id: <8j7lqc$61t99$1@fu-berlin.de>

or as i should have put:

    $foo = lc($foo);

Regards

Mike Solomon

mike solomon <mike.solomon@eps.ltd.uk> wrote in message
news:8j7ko7$67hsg$1@fu-berlin.de...
> its certainly possible
>
> how about
>
> $foo =~ lc;
>
>
> Regards
>
>
> Mike Solomon
>
> Horse Nuts <hx_101@hotmail.com> wrote in message
> news:395751c6.240431552@news.dal.ca...
> > I have a bunch of HTML links in a file and would like to change the
> > case from upper to smaller, is it possible with a perl script????
> >
> > Thanks
>
>




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

Date: 26 Jun 2000 09:11:51 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Changing case in a file!
Message-Id: <87em5kjzvc.fsf@limey.hpcc.uh.edu>

>> On Mon, 26 Jun 2000 12:53:09 GMT,
>> hx_101@hotmail.com (Horse Nuts) said:

> I have a bunch of HTML links in a file and would like to
> change the case from upper to smaller, is it possible
> with a perl script????

    perldoc -f uc

for how to upper-case things.

    perldoc HTML::TokeParse

on how you'll be able to find the markup in the file.

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: Mon, 26 Jun 2000 07:20:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Changing case in a file!
Message-Id: <Pine.GSO.4.10.10006260719140.23149-100000@user2.teleport.com>

On Mon, 26 Jun 2000, Horse Nuts wrote:

> I have a bunch of HTML links in a file and would like to change the
> case from upper to smaller, is it possible with a perl script????

Sure, it's possible. Of course, URLs are, in general, case sensitive, so
you'll probably break some of them in doing this. But see the perlfunc
manpage to find out about some functions that may help you to do this, if
you really want to.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 26 Jun 2000 12:56:07 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Concatenate String
Message-Id: <cfdels84hbkqfs02sj6qmas9bj883pnhkl@4ax.com>

On Fri, 23 Jun 2000 13:09:08 -0400, Drew Simonis <care227@attglobal.net>
wrote:

> $body may contain a string.  @body is an array.  Kinda like a stack
> of strings.  You need to tell perl which piece of the array you want
> to modify:
> 
> @body[4] = "This is the body";

Just for the record, that is a slice, you probably meant:

	$body[4] = 'This is the body';

-- 
Good luck,
Abe


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

Date: Mon, 26 Jun 2000 09:49:55 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Concatenate String
Message-Id: <39575F83.C5496AD9@attglobal.net>

Abe Timmerman wrote:
> 
> On Fri, 23 Jun 2000 13:09:08 -0400, Drew Simonis <care227@attglobal.net>
> wrote:
> 
> > $body may contain a string.  @body is an array.  Kinda like a stack
> > of strings.  You need to tell perl which piece of the array you want
> > to modify:
> >
> > @body[4] = "This is the body";
> 
> Just for the record, that is a slice, you probably meant:
> 
>         $body[4] = 'This is the body';
> 

I'm a horrible typist (thank got for -w) and you are correct.


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

Date: Mon, 26 Jun 2000 13:00:45 GMT
From: malverian@my-deja.com
Subject: Re: Creating a cause from information.
Message-Id: <8j7k5k$8c6$1@nnrp1.deja.com>


> A minimal change to fix this would just be to change the
> assignement from
> $data = <SOCK>;
> to
> $data = $_;

So using $_ = <DATA>; does absolutely nothing to help me >.<
Thanks for clerifying. (Spelling, it's late..)


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 26 Jun 2000 09:19:38 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Creating a cause from information.
Message-Id: <slrn8lem3a.7fu.tadmc@magna.metronet.com>

On Mon, 26 Jun 2000 06:02:36 GMT, Steven Merritt <smerr612@startrekmail.com> wrote:

>After all, what's the point of getting data if you're not going
>to put it anywhere


You can "do something with it" without "putting it somewhere" (assignment):


   if ( <IN> =~ /^yes\b/i ) {
      print "you answered: Yes\n";
   }


   foreach ( split /\s+/, <IN> ) {
      print "a word: $_\n";
   }


   ...


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 26 Jun 2000 07:01:41 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: dbi oracle Select example
Message-Id: <Pine.GSO.4.10.10006260701051.23149-100000@user2.teleport.com>

On Sun, 25 Jun 2000, Robert wrote:

>     Does anyone have a simple dbi based Oracle select query example?  
> I would just like to see how you execute a select statement on an
> oracle db.

That sounds pretty basic. Isn't it covered adequately in the docs? Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 26 Jun 2000 09:34:32 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: defined()
Message-Id: <slrn8lemv8.7fu.tadmc@magna.metronet.com>

On 26 Jun 2000 11:56:37 +0200, Jakob Schmidt <sumus@aut.dk> wrote:
>bart.lateur@skynet.be (Bart Lateur) writes:
>
>> The "defined" test is built-in. [...]
>
>That's what I found out :-)


I spent a few minutes trying to find that in the PODs.


Where is that discussed in the standard docs?


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 25 Jun 2000 12:54:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Encryption
Message-Id: <8j4rua$mdf$1@orpheus.gellyfish.com>

On Sat, 24 Jun 2000 20:02:28 GMT Jimmy Humphrey wrote:
> I made a very basic encryption tool in perl. However, I noticed some
> problems.  For "some" .doc files, and such, the encryption tool seems to
> corrupt. I use pack("c") & unpack("c") to translate my strings into
> ASCII code. But for some reason, when I decrypt the message, on "some"
> .doc files, it makes them become corrupt. This program works with
> regular text files. Could anybody explain why this might happen? Using
> Win32 activestate perl (latest version).
> 

you almost certainly need to use binmode() on your filehandles.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Mon, 26 Jun 2000 12:25:50 +0100
From: "Lee Millard" <chez@bigfoot.com>
Subject: Re: Golf (Was: Re: HELP ME PLEASE !!!!)
Message-Id: <N5H55.2745$F01.59267@news6-win.server.ntlworld.com>

Hi Jakob,

All of these variants seem to work but none of them do the new line bit.....

Also I need to be able add characters before and after each directory
name.....

???? can you assist ???


Jakob Schmidt <sumus@aut.dk> wrote in message
news:8zvs257z.fsf_-_@macforce.sumus.dk...
> Jakob Schmidt <sumus@aut.dk> writes:
>
> > "Lee Millard" <lee.millard@ntlworld.com> writes:
> >
> > > How do I get my script to display a list of directories that are in
the
> > >same directory as the script ???
> >
> > opendir DIR, '.';
> [oops - should have tested for success here I guess]
> > while ( $_ = readdir DIR ) { -d $_ and print $_, "\n" }
>
> Oh man - I suddenly discovered that this was actually an invitation to
golf.
>
> Wonder how this will do:
>
> opendir D, '.'; print join $/, grep -d, readdir D;
>
>
> There are a number of variants of which I'll mention a few:
>
> # if you think it really ought to be a single statement:
> opendir D, '.' and print join $/, grep -d, readdir D;
>
> # if you think it should be nicer:
> opendir D, '.' or die $!; print join $/, grep -d, readdir D;
>
> # if you hate output that ends without a \n:
> opendir D, '.'; print join $/, grep( -d, readdir D ), '';
>
> # if you think it's too dirty to save two chars by relying on the default
$/:
> opendir D, '.'; print join "\n", grep -d, readdir D;
>
> - most these moderations can be combined - but I think the original one
> captures the golf spirit the best.
>
>
> NB: I use a lot of whitespace. Redundant whitespace does not count as
> strokes.
>
> --
> Jakob




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

Date: Mon, 26 Jun 2000 12:04:57 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Golf (Was: Re: HELP ME PLEASE !!!!)
Message-Id: <3957451a.164281422@nntp.idsonline.com>

Jakob Schmidt <sumus@aut.dk> wrote:

>Oh man - I suddenly discovered that this was actually an 
>invitation to golf.
>
>Wonder how this will do:
>
>opendir D, '.'; print join $/, grep -d, readdir D;

   $, = $/; print grep -d, <*>;

[...]
>NB: I use a lot of whitespace. Redundant whitespace does 
>not count as strokes.

If you say so, but that's not the rule in most of the Perl golf
I've seen.  It could affect which entry wins, since some
whitespace can be omitted and some can't.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Mon, 26 Jun 2000 13:54:19 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Golf (Was: Re: HELP ME PLEASE !!!!)
Message-Id: <x7u2egtunp.fsf@home.sysarch.com>

>>>>> "JS" == Jakob Schmidt <sumus@aut.dk> writes:

  JS> - most these moderations can be combined - but I think the original one
  JS> captures the golf spirit the best.

  JS> NB: I use a lot of whitespace. Redundant whitespace does not count as
  JS> strokes.

in the perl golf tournament at tpc4 white space counts. there are
syntactic tricks to lowering the need for white space so counting it
make sense in golf. 

look out for an announcement of the tournament from your local pm group
and in other place (like here) very soon.

and yes, moronzilla won't be allwed to play. :-)

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sun, 25 Jun 2000 13:03:29 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: Hard Disk Serial#
Message-Id: <8j4sgo$mt3$1@uranium.btinternet.com>


>The screwdriver *is* the portable method.

Where can I get Tools::Screwdriver from? Don't see it at CPAN :)


Andy.




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

Date: 26 Jun 2000 12:12:00 GMT
From: Martin Julian DeMello <mdemello@pound.ruf.rice.edu>
Subject: Re: Hard Disk Serial#
Message-Id: <8j7hag$pd6$1@joe.rice.edu>

Andy Chantrill <andy@u2me3.com> wrote:

>>The screwdriver *is* the portable method.

> Where can I get Tools::Screwdriver from? Don't see it at CPAN :)

Of course not - all tools are found under Tools::Hammer

Unless you want to shoot yourself in the foot, in which case 
perldoc perlgun

-- 
Martin DeMello


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

Date: Mon, 26 Jun 2000 21:58:53 +1000
From: "Elliot Shepherd" <shepherd@ihug.com.au>
Subject: help : Posting a file through a form through to email
Message-Id: <8j7gp9$8r2$1@bugstomper.ihug.com.au>

Hi im creating a site for a company that would like users to be able to
upload an image from a form to them in an email, ive been able to find
scripts that do half of this (one will upload a file to the server through a
form, the other with send a file through email from the server). Im not good
enough to try and merge them so im wondering is there a script already
available to do this?

Elliot

Please reply by email if possible.. thanks.




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

Date: Mon, 26 Jun 2000 07:17:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: help : Posting a file through a form through to email
Message-Id: <Pine.GSO.4.10.10006260717170.23149-100000@user2.teleport.com>

On Mon, 26 Jun 2000, Elliot Shepherd wrote a long question which ended up
saying:

> so im wondering is there a script already available to do this?

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 26 Jun 2000 05:28:12 -0700
From: Andy Barlow <andybarlow70NOanSPAM@hotmail.com.invalid>
Subject: help with forms
Message-Id: <34a9e596.e61be555@usw-ex0104-032.remarq.com>

Can anyone tell me the best way to have the info a customer
inputs on to my page to be sent to me, without them having to
read what they've sent.

I currently use FormMail.pl which shows the customer what
they've input in a very scrappy format.  Does anyone know of a
simple, but more effective method?

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Mon, 26 Jun 2000 07:08:19 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HLP: SDBM_File problem concering element length
Message-Id: <Pine.GSO.4.10.10006260707040.23149-100000@user2.teleport.com>

On Mon, 26 Jun 2000, Craig Tataryn wrote:

> On the line where I set %tiedDB = %DBMdb my script dies.  It only dies
> when an element in the DBMdb hash is rather long

> I was wondering if anyone knows if there is a limit to the size of
> hash elements being saved using this method, and if there is, is there
> a work around?

Use a different DBM implementation, or rebuild the one you're using with
a different maximum data size, if that's possible. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 26 Jun 2000 11:59:18 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: How is a unique sort done? Like unix "sort -u"
Message-Id: <8j79hg$7md1@intranews.dresdnerbank.de>

    Hi Robert,

Robert Chalmers schrieb in Nachricht ...
>How do I make a sort do a unique sort ??? this is a real mystery...
>

    --snip--

>where the rows might contain
>
>aaaaaaa.aaaaaaa
>aaaaaaa.aaaaaaa
>bbbbbbb.bbbbbbb
>bbbbbbb.bbbbbbb
>and thats what it returns...

    well that's what you requested. It's in the input
    so it will show up in the sorted output.

>Can't see a way to do this anywhere???/

    So you have to extract the unique elements
    of your resulting list preserving ordering.
    This question is answered in perlfaq4.
    Just have a look...

    Best regards,

        Peter Dintelmann






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

Date: Mon, 26 Jun 2000 13:20:14 GMT
From: st95lzd@21cn.com
Subject: How to open a FIFO created with C in perl?
Message-Id: <8j7l9v$96r$1@nnrp1.deja.com>

I created a FIFO(readFIFO) to read data from script.
Script was writen by perl,How can i send data to FIFO?

fifo.c
#include <stdio.h>
#include <unistd.h>
#include <linux/stat.h>
int main(void)
{  FILE *fp;
   char readbuf[80];
   umask(0);
   mknod("readFIFO",S_IFIFO|0666,0);
   while(1)
   {  fp=fopen("readFIFO","r");
      fgets(readbuf,80,fp);
      printf("%s",readbuf);
      fflush(stdout);
      fclose(fp);   }
   return(0);
}


exam.pl
#!/usr/bin/perl
open(LOG,"|readFIFO") || die("error!!!!!!!!!!!");
print LOG "123456\n";
close(LOG);
exit;


It seemes that the function open() can't open a FIFO
In which way,can i send string "123456" to the FIFO?
that is printf the 123456 on the STDOUT.
Please post in detail,better with source code.
Thanks!!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 26 Jun 2000 14:46:54 +0100
From: nobull@mail.com
Subject: Re: How to open a FIFO created with C in perl?
Message-Id: <u9zoo8y2pd.fsf@wcl-l.bham.ac.uk>

st95lzd@21cn.com writes:

>    mknod("readFIFO",S_IFIFO|0666,0);

> #!/usr/bin/perl
> open(LOG,"|readFIFO") || die("error!!!!!!!!!!!");
                               ^^^^^^^^^^^^^^^^^^

You should print out the actual error here (i.e. $!), then you'd
probably have spotted the mistake yourself.

readFIFO is a FIFO, i.e. a (special) file.  You are trying to run it
as a command.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 26 Jun 2000 14:07:55 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to open a FIFO created with C in perl?
Message-Id: <%sJ55.244$iP2.31710@news.dircon.co.uk>

On Mon, 26 Jun 2000 13:20:14 GMT, st95lzd@21cn.com Wrote:
> I created a FIFO(readFIFO) to read data from script.
> Script was writen by perl,How can i send data to FIFO?
> 

<snip irrelevant rewrite of mkfifo in C>

> 
> exam.pl
> #!/usr/bin/perl
> open(LOG,"|readFIFO") || die("error!!!!!!!!!!!");

Er, should that be :

  open(LOG,">readFIFO") || die "Cant open fifo - $!\n";

> print LOG "123456\n";
> close(LOG);
> exit;
> 
> 
> It seemes that the function open() can't open a FIFO
> In which way,can i send string "123456" to the FIFO?
> that is printf the 123456 on the STDOUT.
> Please post in detail,better with source code.
> Thanks!!
> 

You were opening your fifo as if it were an executable you wanted to pipe
to - a fifo appears largely as a normal file to your program.


/J\


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

Date: Mon, 26 Jun 2000 07:06:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: howto use the package "Filter::*" ?
Message-Id: <Pine.GSO.4.10.10006260702550.23149-100000@user2.teleport.com>

On Mon, 26 Jun 2000, udoline wrote:

> howto use the package "Filter::*" ?
> 
> how make I the perlsource encrypted ?
> 
> Is the security from encrypted perlsource ?

Have you seen the docs which come with the module?

    http://search.cpan.org/search?dist=Filter

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 26 Jun 2000 10:36:22 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: indentifying country origin using perl??
Message-Id: <GmG55.228$iP2.30858@news.dircon.co.uk>

On Mon, 26 Jun 2000 01:25:14 -0700, dagolfmasta Wrote:
> Is it possible to determine the origin of somebody browsing
> my pages?

Not reliably.

> How can I access the IP-adress of the html-page that is
> calling my scripts? 

You mean the host - an HTML page doesnt have an IP number.  The web server
supplies it to your program in an environment variable as described in the
CGI specification : 

    <http://www.golux.com/coar/cgi/draft-coar-cgi-v11-03-clean.html>

>                      Through the IP-adress I could determine
> country origin because I have different sites for different
> countries.
> 


How do propose to do that then ?  


If you need to do this you should use the content negotiation facilities
of your server of simply ask the user.  The chances of you getting it
right are pretty slim.

Anyhow you would be better off asking in comp.infosystems.www.authoring.cgi

/J\


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

Date: 26 Jun 2000 09:09:43 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: indentifying country origin using perl??
Message-Id: <87hfagjzyw.fsf@limey.hpcc.uh.edu>

>> On Mon, 26 Jun 2000 01:25:14 -0700,
>> dagolfmasta <janneNOjaSPAM@funplanet.com.invalid> said:

> Is it possible to determine the origin of somebody
> browsing my pages?

Depends on what you mean by "origin", and "somebody".

> How can I access the IP-adress of
> the html-page that is calling my scripts? Through the

html-pages don't have IP-addresses.
They don't call scripts either.

> IP-adress I could determine country origin because I
> have different sites for different countries.

There is no reliable mapping between IP addresses, users
and the nationality/location of those users.  The question
of what "user" means is also unclear here.

What you want to do isn't possible (in any programming
language).  The closest you could get is to present an
HTML form which asks the "user", but then "users", be they
human or bots, can give the wrong answer.

If you want to pursue this I would suggest taking it over
to comp.infosystems.www.authorig.cgi because it isn't
directly perl related.

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: Mon, 26 Jun 2000 09:52:29 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Know of any good perl books?
Message-Id: <3957601D.71144E32@attglobal.net>

"David H. Adler" wrote:
> 
> >
> >Thanks to the powers that be that Mr. Schwartz is not as picky as
> >a certain monospaced font/no mixed case/no punctuation after the d
> >personage known to pass by this way =)
> 
> The d is also silent...
> 
> ><duck>
> 
> ...aiming low to compensate.  :_)
> 
> dha
> 

How the heck is the d silent??!?!?


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3480
**************************************


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