[13299] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 709 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 3 06:07:23 1999

Date: Fri, 3 Sep 1999 03:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 3 Sep 1999     Volume: 9 Number: 709

Today's topics:
    Re: $x=('a','b','c','d');  $x=('a'..'d');  $x=(($m,$n)= (Bart Lateur)
        Accessing DB2/400 from perl on Linux <jriera@retemail.es>
    Re: Case insensitive SQL query (Sean McAfee)
    Re: Counting duplicate list elements in Perl <nospam.newton@gmx.net>
        file redirect <jimcr@bwn.net>
        Form2Mail without user interaction? (TomTech)
    Re: Form2Mail without user interaction? <mike@crusaders.no>
    Re: Form2Mail without user interaction? <NOSPAMmark@nl.gxn.net>
    Re: Form2Mail without user interaction? <gellyfish@gellyfish.com>
        How to "use strict" in a "perl -s" program? <pierremart@hotmail.com>
        How to add a number to the name of a variable? <abel.almazan@ogilvyinteractive.es>
    Re: How to add a number to the name of a variable? <photo@photoshopsection.com>
    Re: How to add a number to the name of a variable? <dave@dave.org.uk>
    Re: How to add a number to the name of a variable? <gellyfish@gellyfish.com>
        How to match as most as possible ? marcza@my-deja.com
    Re: How to match as most as possible ? (Sam Holden)
        multithread sockets in perl <new_conclusions@bigfoot.com>
        Multithreaded client/server in Perl <new_conclusions@bigfoot.com>
    Re: null character kills CGI script on NT (Larry Rosler)
    Re: Perl a Black Sheep? (Ron Feral)
        problem with Apache::DBI & mod_perl feketeroland11@my-deja.com
        Server/Client for WinNT <john.dryselius@uab.ericsson.se>
        tee cmd in PERL? akluyskens@my-deja.com
        Topsites CGI <c0d3h4ck3r@phreaker.net>
    Re: Topsites CGI <uri@sysarch.com>
        User Id mr_potato_head@my-deja.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 03 Sep 1999 07:13:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $x=('a','b','c','d');  $x=('a'..'d');  $x=(($m,$n)=('a'..'d'))
Message-Id: <37d06eef.799982@news.skynet.be>

Abigail wrote:

>The usefulness of item 7 might be a bit more obscure, but consider:
>
>     $x = () = "a" .. "e";
>     print $x;
>
>That will print `5'. I am not sure if that was a deliberate design decision,
>or something that just happens, and turned out to be (marginally) useful.

What is not so useful is:

	@a = () = 'a' .. 'e';

Now, @a is empty.

I understand that this is necessary, because the value of the whole
assignment is an lvalue, so it needs to be the value of the LHS.

    chomp(($x,$y) = ("a\n", "b\n", "c\n"));

This will chomp $x and $y.

    print "<$x,$y>";
-->
    <a,b>

-- 
	Bart.


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

Date: Fri, 3 Sep 1999 00:13:22 +0200
From: "Juan Riera" <jriera@retemail.es>
Subject: Accessing DB2/400 from perl on Linux
Message-Id: <7qmt5b$2rj1@SGI3651ef0>

hello,
Does anybody knows if is there any way of accessing DB2/400 data on an
AS/400 server from a perl CGI script on a linux box? I have worked with
DBI/DBD for MySQL.

TIA
Juan




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

Date: Fri, 03 Sep 1999 05:30:58 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Case insensitive SQL query
Message-Id: <m2Jz3.4534$J72.1002855@news.itd.umich.edu>

In article <7qmtav$81o$1@nnrp1.deja.com>,  <mrbog@my-deja.com> wrote:
>First of all, no, I will NOT conform to "the usenet standard" of

Let me get this straight...You post here seeking help, and then invite

>responding to posts at the bottom. I dissagree with it and luckily I'm

the very people who might provide that help *not* to do so?  Where's the

>on the *internet* which is at its fundament, a medium of free speech

sense in that?  Not that a lot of people need such an invitation; I myself

>and expression. I happen to dissagree with the standard and I choose to

have once already begun to respond to an article arranged in your obtuse

>respond at the top. If you don't like that, don't read my messages.

style, but then aborted the response when it became obvious that referring

>In article <MPG.12380b6f6545b879989ca1@news-server>,

to parts of the original article that were farther down on the page was

>  elephant@squirrelgroup.com (elephant) wrote:

going to be more trouble than it was worth.

>> first .. please try to follow the posting guidelines for usenet by

By the way; how do you like my new "interleave" posting style?  I'm sure

>> putting your reply AFTER the text that you're replying to - it just

you're all for it, being the big free speech buff that you are.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Fri, 03 Sep 1999 09:46:37 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <37CF7CDD.6B2EE280@gmx.net>

Ala Qumsieh wrote:
> 
> "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
> writes:
> 
> > Uri Guttman wrote:
> > >
> > > a little perl golf here
> > >
> > > perl -lne '$c{$_}++; END{print "$_,$c{$_}" for sort keys %c}'
> >
> >   perl -lne '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
> >
> > Four fewer strokes! (And no closing -n loop with }, either!) Do I
> > get a prize? (Tested, too!)
> 
> Is this considered valid Perl Golf:
> 
>         % alias p perl -nle
>         % p '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
> 
> Eight (yes 8!!!) fewer strokes. That's VERY close to a hole in one!

Well, if you're going this way, you might as well just use 'perl -nl'
without the -e and then type the program in so that perl will read it
from STDIN... allowing you to miss out the single quotation marks as
well.

Cheers,
Philip


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

Date: Fri, 03 Sep 1999 00:35:41 -0600
From: Jim Cromie <jimcr@bwn.net>
Subject: file redirect
Message-Id: <37CF6C3D.435E5FA3@bwn.net>

Hi,

Im having trouble duplicating STDOUT to a file,  Im not able to get
plain old prints to write to both STDOUT and a


$ perl -e  'open( STDOUT, ">swill"); print "junk"'

works as expected, and creates a file "swill" containing "junk".


$ perl -e 'open( STDOUT, ">&swill"); print "junk"'

doesnt work as I expect; it doesnt open a new file "swill",


I read perldoc -f open, and perldoc perlopentut without gaining real
insight
about how to get the above to work, I daresay I dont quite understand
shell semantics for the  ">&" redirector.

What am I missing ?


TIA, jim




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

Date: Fri, 03 Sep 1999 06:17:33 GMT
From: NoOne@Home.Here (TomTech)
Subject: Form2Mail without user interaction?
Message-Id: <37cf6668.9111390@news.gte.net>

Thanks for any help...

Is there a way of using the form2mail system and 
have an email sent triggered by the loading of the 
page by the user alone?

I don't want the user to have to interact at all. 
I want an email sent to me each time the page is 
accessed, automatically.

Thanks

Tom


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

Date: Fri, 3 Sep 1999 11:21:01 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Form2Mail without user interaction?
Message-Id: <1qMz3.100$XR4.666@news1.online.no>


TomTech <NoOne@Home.Here> wrote in message
news:37cf6668.9111390@news.gte.net...
> Is there a way of using the form2mail system and
> have an email sent triggered by the loading of the
> page by the user alone?

Yes, but it won't work on every browser.

> I don't want the user to have to interact at all.
> I want an email sent to me each time the page is
> accessed, automatically.

Then you need to fill out the form with hidden-fields and subit it with
javascript when the page is loaded.

This requires knowledge in HTML and Javascript. Unfortunately, this
newsgroup is for discussing Perl.

--
Trond Michelsen





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

Date: Fri, 3 Sep 1999 11:32:20 +0200
From: "Mark Spring" <NOSPAMmark@nl.gxn.net>
Subject: Re: Form2Mail without user interaction?
Message-Id: <7qo4kl$mh4$1@blue.nl.gxn.net>



> Is there a way of using the form2mail system and
> have an email sent triggered by the loading of the
> page by the user alone?
>
> I don't want the user to have to interact at all.
> I want an email sent to me each time the page is
> accessed, automatically.

Hmm as a newbie and a beginner with Perk and CGI
I'd suggest the use of the ONLOAD fonction in the
body tag of the page (we are talking webpages, right?)
to call a cgi script that will then send an email.
ie

<head> bla bla bla

<script="javascript">
<!--
        function sendmail(){
            call the cgi script here
                            }
//-->
</script

<body bgcolor="........." ......    OnLoad="sendmail()">

Or am I making a wrong approach to this ?

Mark Spring




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

Date: 3 Sep 1999 10:38:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Form2Mail without user interaction?
Message-Id: <37cf971e_2@newsread3.dircon.co.uk>

Mark Spring <NOSPAMmark@nl.gxn.net> wrote:
> 
> 
>> Is there a way of using the form2mail system and
>> have an email sent triggered by the loading of the
>> page by the user alone?
>>
>> I don't want the user to have to interact at all.
>> I want an email sent to me each time the page is
>> accessed, automatically.
> 
> Hmm as a newbie and a beginner with Perk and CGI
> I'd suggest the use of the ONLOAD fonction in the
> body tag of the page (we are talking webpages, right?)
> to call a cgi script that will then send an email.
> ie
> 
> <head> bla bla bla
> 
> <script="javascript">
> <!--
>         function sendmail(){
>             call the cgi script here
>                             }
> //-->
> </script
> 
> <body bgcolor="........." ......    OnLoad="sendmail()">
> 
> Or am I making a wrong approach to this ?
> 

Yes, your answer (indeed any possible solution to this problem) was
entirely Perl free, you should have pointed home to the appropriate
HTML,CGI or Javascript newsgroup.

-- 
"Some saw Noel Edmonds as a stinking slimy downmarket local rep from a
package holiday firm. His critics were less kind" - Victor Lewis-Smith,
TV Offal


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

Date: Fri, 3 Sep 1999 17:56:50 +0800
From: "Pierre Mart" <pierremart@hotmail.com>
Subject: How to "use strict" in a "perl -s" program?
Message-Id: <7qo5tb$oki@netnews.hinet.net>

Dear all,

    Originally my program worked.

#!/usr/bin/perl -s
# usage: hello.pl [-friend=Pierre]

print "Hello $friend\n" if $friend;    # $friend is passed by -s switch

    One day, I put "use strict" to restrict it.  It became

#!/usr/bin/perl -s
# usage: hello.pl [-friend=Pierre]
use strict;
my $friend;    # I have to declare this to pass compiling
print "Hello $friend" if $friend;

    I think the line "my $friend" must be wrong because $friend
was initialized to undef rather than passed by the -s switch.

    Could you please tell me the correct way
to "use strict" in a program with "-s" switch?

    Thank you very much.

Pierre Mart

P.S.  I looked up "perldoc perlrun", "perldoc strict" and perlfaqs
        but got no answer.





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

Date: Fri, 03 Sep 1999 10:04:45 +0200
From: Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
Subject: How to add a number to the name of a variable?
Message-Id: <37CF811D.B5E5531A@ogilvyinteractive.es>

How can I add a number to the name of a var??

I want this effect:

for (i = 0; $i <5; $i++)
{
    $file( i ) = <string>
}

with this code i want the same effect as:

$file0 = <string>
$file1 = <string>
$file2 = <string>
$file3 = <string>
$file4 = <string>


please answer me as quickly as possible

answer me to my email address please

thanks





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

Date: Fri, 3 Sep 1999 11:20:41 +0200
From: "Robert" <photo@photoshopsection.com>
Subject: Re: How to add a number to the name of a variable?
Message-Id: <7qo3jv$n6l$1@cubacola.tninet.se>

Why not use a array?

 @file;
 for ($i = 0; $i <5; $i++)
 {
     $file[$ i ] = <string>;
 }

just an idea!

Abel Almazán <abel.almazan@ogilvyinteractive.es> wrote in message
news:37CF811D.B5E5531A@ogilvyinteractive.es...
> How can I add a number to the name of a var??
>
> I want this effect:
>
> for (i = 0; $i <5; $i++)
> {
>     $file( i ) = <string>
> }
>
> with this code i want the same effect as:
>
> $file0 = <string>
> $file1 = <string>
> $file2 = <string>
> $file3 = <string>
> $file4 = <string>
>
>
> please answer me as quickly as possible
>
> answer me to my email address please
>
> thanks
>
>
>




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

Date: Fri, 03 Sep 1999 10:27:45 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: How to add a number to the name of a variable?
Message-Id: <z5PPN6UZablpFOn28rF92xP+4vSJ@4ax.com>

On Fri, 03 Sep 1999 10:04:45 +0200, Abel Almazán
<abel.almazan@ogilvyinteractive.es> wrote:

>How can I add a number to the name of a var??
>
>I want this effect:
>
>for (i = 0; $i <5; $i++)
>{
>    $file( i ) = <string>
>}
>
>with this code i want the same effect as:
>
>$file0 = <string>
>$file1 = <string>
>$file2 = <string>
>$file3 = <string>
>$file4 = <string>

Sounds like you need an array.

my (@file, $i);
for ($i = 0; $i <= 5; $i++) {
  $file[$i] = <string>;
}

Tho' if (as it seems), you're reading in a file, it would be better to
do

my @file;

@file = <string>;

>please answer me as quickly as possible

Going as quickly as I can!

>answer me to my email address please

Nope.

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: 3 Sep 1999 10:28:00 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to add a number to the name of a variable?
Message-Id: <37cf94a0_2@newsread3.dircon.co.uk>

Abel Almazán <abel.almazan@ogilvyinteractive.es> wrote:
> How can I add a number to the name of a var??
> 

You dont want to do that - you should use an array or a hash instead.

/J\
-- 
"Babylon 5 has some impressive special effects and enough dodgy hairdos
to make the current Conservative front bench look trendy" - Radio Times


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

Date: Fri, 03 Sep 1999 06:55:13 GMT
From: marcza@my-deja.com
Subject: How to match as most as possible ?
Message-Id: <7qnrce$s6e$1@nnrp1.deja.com>

Assume the following code:

$A[3] = "one";
$A[7] = "two";
$A[73] = "three";

$text = "aAbb3a abaA3baaaAAA bAA77aabA73aa\n";
$text =~ s/(A([0..73]{1,2}))/$A[$2]/g;

print "OUT=$text#$1#$2#$3#\n";

In the example A3 and A7 is replaced as desired
but A73 is replaced with $A[7] instead of $A[73].

How can I perform maximal matching ?

Bye

Marcus


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


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

Date: 3 Sep 1999 07:16:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: How to match as most as possible ?
Message-Id: <slrn7sute6.fh1.sholden@pgrad.cs.usyd.edu.au>

On Fri, 03 Sep 1999 06:55:13 GMT, marcza@my-deja.com <marcza@my-deja.com> wrote:
>Assume the following code:
>
>$A[3] = "one";
>$A[7] = "two";
>$A[73] = "three";
>
>$text = "aAbb3a abaA3baaaAAA bAA77aabA73aa\n";
>$text =~ s/(A([0..73]{1,2}))/$A[$2]/g;
               ^^^^^^
That does not do what you think it does. I suggest you read the documentation
that comes with perl and find out what it really does. 'perldoc perlre' might
be a good place to start...

>
>print "OUT=$text#$1#$2#$3#\n";
>
>In the example A3 and A7 is replaced as desired
>but A73 is replaced with $A[7] instead of $A[73].

No it isn't...

Here's my output :
OUT=aAbb3a abaonebaaaAAA bAaabthreeaa
              ^^^             ^^^^^
             $A[3]            $A[73] 


-- 
Sam

I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do.   --Larry Wall


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

Date: Thu, 02 Sep 1999 21:29:39 -1000
From: Govind Shridhare <new_conclusions@bigfoot.com>
Subject: multithread sockets in perl
Message-Id: <37CF78E3.E84D2A4F@bigfoot.com>

This is a multi-part message in MIME format.
--------------799DC76A38682EA462677E87
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Folks
I am trying to write a simple client server program using perl
5.005_03. The server is not able to receive client's data. I wonder how
I can fix this.  The server does acknowledge client's presence but is
unable to read receive data from clients. So

 while (defined ($buf = <$new_sock>)){
      print " $buf";
      print $new_sock "You said: $buf\n";
    }
doesn't seem to work...

Any feedback is greatly appreciated. Here is the code.

# Server
#!/usr/bin/perl
use IO::Socket;
$PORT = 9000;                  # pick something not in use
 $SIG{CHLD} = sub {wait ()};
  $main_sock = new IO::Socket::INET (LocalHost => 'localhost',
                                    LocalPort => $PORT,
                                    Listen    => 5,
                                    Proto     => 'tcp',
                                    Reuse     => 1,
                                   );                     );
 die "Socket could not be created. Reason: $!\n" unless ($main_sock);

while ($new_sock = $main_sock->accept()) {
  $pid = fork();
  die "Cannot fork: $!" unless defined($pid);
  if ($pid == 0){
    print "*** Child process begins\n";
    while (defined ($buf = <$new_sock>)){
      print " $buf";
      print $new_sock "You said: $buf\n";
    }
    print "*** Child process ends\n\n";
    exit(0);
  }
}
close($main_sock);

# Client
#!/usr/bin/perl
use IO::Socket;
$port = 9000;
$host = 'localhost';
$sock = new IO::Socket::INET (PeerAddr => 'localhost',
                               PeerPort => $port,
                               Proto    => 'tcp',
                              );
#$sock = new IO::Socket::INET->new(Proto => "tcp",
#    PeerAddr  => $host,
#      PeerPort  => $port
#     );

die "Socket could not be created. Reason: $!\n" unless $sock;
print $sock "Msg $_: How are you?\n\n";
@sock=(<$sock>);
close($sock);
print "Here is my response\n\n";
print @sock;
exit;

--------------799DC76A38682EA462677E87
Content-Type: text/x-vcard; charset=us-ascii;
 name="new_conclusions.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Govind Shridhare
Content-Disposition: attachment;
 filename="new_conclusions.vcf"

begin:vcard 
n:Shridhare;Govind
x-mozilla-html:FALSE
org:MediaBreeze 
adr:;;;;;;
version:2.1
email;internet:Govind@MediaBreeze.com
note;quoted-printable:If you are not living on the edge, you are taking up too much space!=0D=0ASri Sri Ravi Shankar
x-mozilla-cpt:;25920
fn:Govind Shridhare
end:vcard

--------------799DC76A38682EA462677E87--



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

Date: Thu, 02 Sep 1999 21:03:38 -1000
From: Govind Shridhare <new_conclusions@bigfoot.com>
Subject: Multithreaded client/server in Perl
Message-Id: <37CF72CA.EBA4994E@bigfoot.com>

This is a multi-part message in MIME format.
--------------3109805AD96CDEA0433B61B8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi there
I am using Linux 2.2 on a Pentium Machine.
Can somebody send me Perl code for Multithreading client/server using
Sockets?
I couldn't find it anywhere in perl.com.
The server they have is multithreaded. All it does is recognize the
client's presence, send something to it but I don't know how to accept
client input, process it and then send a reply back to client...The code
appears below.
Many thanks in advnace.
Govind

##Server code
#!/usr/bin/perl -Tw
use strict;
BEGIN { $ENV{PATH} = '/usr/ucb:/bin' }
use Socket;
use Carp;
my $EOL = "\015\012";

sub spawn;  # forward declaration
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }

my $port = shift || 2345;
my $proto = getprotobyname('tcp');
$port = $1 if $port =~ /(\d+)/; # untaint port number

socket(Server, PF_INET, SOCK_STREAM, $proto)|| die "socket: $!";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR,
pack("l", 1))   || die "setsockopt: $!";
bind(Server, sockaddr_in($port, INADDR_ANY))|| die "bind: $!";
listen(Server,SOMAXCONN)|| die "listen: $!";

logmsg "server started on port $port";

my $waitedpid = 0;
my ($paddr, $line);

sub REAPER {
  $waitedpid = wait;
  $SIG{CHLD} = \&REAPER;  # loathe sysV
  logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
}

$SIG{CHLD} = \&REAPER;

for ( $waitedpid = 0;
      ($paddr = accept(Client,Server)) || $waitedpid;
      $waitedpid = 0, close Client)
  {
    next if $waitedpid and not $paddr;
my($port,$iaddr) = sockaddr_in($paddr);
    my $name = gethostbyaddr($iaddr,AF_INET);
    logmsg "connection from $name [",
    inet_ntoa($iaddr), "]
at port $port";

    spawn sub {
            print "Hello there, $name, it's now ", scalar localtime,
$EOL;
            exec '/usr/games/fortune'           # XXX: `wrong' line
terminators
                or confess "can't exec fortune: $!";
        };;

  }

sub spawn {
   my $coderef = shift;

        unless (@_ == 0 && $coderef && ref($coderef) eq 'CODE') {
            confess "usage: spawn CODEREF";
        }
  my $pid;
  if (!defined($pid = fork)) {
    logmsg "cannot fork: $!";
    return;
  } elsif ($pid) {
    logmsg "begat $pid";
    return; # I'm the parent
  }
  # else I'm the child -- go spawn

open(STDIN,  "<&Client")   || die "can't dup client to stdin";
  open(STDOUT, ">&Client")   || die "can't dup client to stdout";
  ## open(STDERR, ">&STDOUT") || die "can't dup stdout to stderr";
  exit &$coderef();
}
-------------
#Client code
#!/usr/bin/perl -w
use strict;
use Socket;
my ($remote,$port, $iaddr, $paddr, $proto, $line);

$remote  = shift || 'localhost';
$port= shift || 2345;  # random port
if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
die "No port" unless $port;
$iaddr   = inet_aton($remote)   || die "no host: $remote";
$paddr   = sockaddr_in($port, $iaddr);

$proto   = getprotobyname('tcp');
while (1)
{
  socket(SOCK, PF_INET, SOCK_STREAM, $proto)  || die "socket: $!";
  connect(SOCK, $paddr)|| die "connect: $!";
  print SOCK "test";


  while (defined($line = <SOCK>)) {
    print $line;
  }
  close (SOCK)|| die "close: $!";
}

exit;


--------------3109805AD96CDEA0433B61B8
Content-Type: text/x-vcard; charset=us-ascii;
 name="new_conclusions.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Govind Shridhare
Content-Disposition: attachment;
 filename="new_conclusions.vcf"

begin:vcard 
n:Shridhare;Govind
x-mozilla-html:FALSE
org:MediaBreeze 
adr:;;;;;;
version:2.1
email;internet:Govind@MediaBreeze.com
note;quoted-printable:If you are not living on the edge, you are taking up too much space!=0D=0ASri Sri Ravi Shankar
x-mozilla-cpt:;25920
fn:Govind Shridhare
end:vcard

--------------3109805AD96CDEA0433B61B8--



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

Date: Thu, 2 Sep 1999 23:52:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: null character kills CGI script on NT
Message-Id: <MPG.1239101420745786989f14@nntp.hpl.hp.com>

In article <slrn7suiim.k8.efflandt@efflandt.xnet.com> on 3 Sep 1999 
04:06:38 GMT, David Efflandt <efflandt@xnet.com> says...
> On Thu, 02 Sep 1999, Corey Edwards paranoid_of_spam wrote:
> >I have written a CGI script which opens a file, often times an image,
> >and prints that data out to the browser.
 ...
> This could be more simply written
> 
> open (FILE, "sample.gif");
> binmode FILE;	# needed for DOS/Win binary, ignored if not needed
> print <FILE>;

That would better be written as

  print while <FILE>;

to avoid having the file all in memory at once for no reason.  However, 
it makes little sense to read a binary fle by 'lines', when there aren't 
any.

  print while read FILE, $_, 8192; # or whatever size suits you

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


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

Date: Fri, 03 Sep 1999 06:33:52 GMT
From: feral@vaxxine.com (Ron Feral)
Subject: Re: Perl a Black Sheep?
Message-Id: <37cf6b8a.85457371@news.vaxxine.com>


Yes, and to think about Microsoft's own Hotmail.

lynx -dump -head http://www.hotmail.com/
HTTP/1.1 302 Found
Server: Apache/1.3.6 (Unix) mod_ssl/2.2.8 SSLeay/0.9.0b

I wonder if they use Perl. ;-)


On 26 Aug 1999 12:44:52 GMT, revjack <revjack@radix.net> wrote:

>Bart Lateur explains it all:
>
>:For that reason, I'm pretty sure that Hotbot uses Microsoft servers.
>
>~$ lynx -dump -head http://www.hotbot.com/
>HTTP/1.1 200 OK
>Server: Microsoft-IIS/4.0
>[snip]



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

Date: Fri, 03 Sep 1999 09:48:32 GMT
From: feketeroland11@my-deja.com
Subject: problem with Apache::DBI & mod_perl
Message-Id: <7qo5he$3ma$1@nnrp1.deja.com>

Hello !
I have a little problem with the Apache::DBI module.
Maybe I'm stupid...
But it's don't working!!!
I downloaded "official" Perl & mod_perl & Apache::DBI & Apache & DBI  &
DBD::ODBC from CPAN.
My configure:
Perl 5.005_02
Mod_perl 1.16
Apache 1.3.3
Windows NT 4.0 sp 4

My httpd.conf:
 ...
Perlmodule Apache::DBI
 ...

The apache server is start without any errors.
Here is my script, test.cgi.
#!C:\perl\5.00502\bin\MSWin32-x86\perl.exe
use DBI;
$dbh = DBI->connect('dbi:ODBC:bevitel', '', '');
$sth = $dbh->prepare( "SELECT * FROM Kalapács" );
print "Content-type: text/html\n\n";
print "<HTML>";
print "<HEAD><TITLE>ODBC test page</TITLE>";
print '<META NAME="Keywords" CONTENT="Concorde XAL">';
print '<META NAME="Author" CONTENT="No lássuk csak ..."></HEAD>';
print "<BODY bgcolor=\"#12D8BA\">";
while ($i < 20) {
$sth->execute;
while ( @row = $sth->fetchrow) {
print "<p>Name:$row[0]. EMAIL:$row[1].Addressr:$row[2].</p>"; }
$i++;
}
print "</BODY>";
print "</HTML>";
bevitel is an access 97 database.
In the ODBC manager i've checked the option: exclusive for the DSN..
This script is working if it's run once in the same time.
But if it is running twice in the same a time, "older" process is
working, but the "newer"
process is crashed. So, this is not a persistent database connection!
If idon't check the exclusive mode in the DSN,  the several processes
working
correctly in the same time.

I hope somebody can help me,

Roland
rfekete@bocskai.hu


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


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

Date: Fri, 3 Sep 1999 09:29:20 +0200
From: "John Dryselius" <john.dryselius@uab.ericsson.se>
Subject: Server/Client for WinNT
Message-Id: <kNKz3.10$qd1.18133@uab.ericsson.se>

Hi,

I must admit I'm posting this of pure laziness. I need an example code of a
client/server in perl for Win NT, there the client after connecting to the
server can send a request (command) to the server, the server executes the
request and returns the result and then waits for a new request (I don't
have the need for a multi client server). The reason is that the examples
given in books and the perlipc doc seem to be for unix (using fork to spawn
a new process to execute the request). I have tried myself a little outgoing
from the easiest examples given (a client connects and the server sends
something to it) but I haven't accomplished what I need - after the client
has connected it sends something and then waits for the result. My trials
have all ended  in locking up the cleint/server.

                /John




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

Date: Fri, 03 Sep 1999 07:56:50 GMT
From: akluyskens@my-deja.com
Subject: tee cmd in PERL?
Message-Id: <7qnuvs$vfa$1@nnrp1.deja.com>

Hi,

I need the PERL equivalent of the unix "tee" command to redirect the
output of a function to <STDOUT> and a FILE(HANDLE). Can anyone help me
out of this problem.

Regards

Anthony Kluyskens


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


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

Date: Fri, 3 Sep 1999 15:23:16 +1000
From: "C0d3" <c0d3h4ck3r@phreaker.net>
Subject: Topsites CGI
Message-Id: <7qnlvk$ib0$1@toto.tig.com.au>

Any one want a topsites cgi script for free?
(the full pro version)

i have bought it and it is not "warez"
it comes with access to the solutionscripts server  with tech support and
all that stuff..
i will trade for an anaconda open directory pro script

cya
c0d3




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

Date: 03 Sep 1999 02:20:16 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Topsites CGI
Message-Id: <x7906ott27.fsf@home.sysarch.com>

>>>>> "C" == C0d3  <c0d3h4ck3r@phreaker.net> writes:

  C> Any one want a topsites cgi script for free?
  C> (the full pro version)

  C> i have bought it and it is not "warez"
  C> it comes with access to the solutionscripts server  with tech support and
  C> all that stuff..
  C> i will trade for an anaconda open directory pro script

  C> cya
  C> c0d3

wow. a bona fide moronic warez d00d posting here. 

what is your perl question or content? 

do you even know how to program in any language?

do you even know what language those scripts are written in?

go crawl back under your rock.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Fri, 03 Sep 1999 06:15:45 GMT
From: mr_potato_head@my-deja.com
Subject: User Id
Message-Id: <7qnp2c$qnn$1@nnrp1.deja.com>

Hi,
   I wrote a perl script that changes the user id and group id to a
different user to unload, delete, and upload new tables into my informix
database.  I'm not really sure why, but I can use the script with no
issues, but when another user uses it, it fails on the delete table
procedure.  The script is owned by root and the the permissions are set
to "-rwsr-xr-x  root  other".  The permissions on the database are set
to grant connect to public and the user id the script whiches to is set
to grant dba to xxxx.  I don't think the changing of the user id is
really working, but when I unload files from the database, it shows that
its owned by the user id I switched to.  I changed the user id and group
id like:

$< = 190;
$> = 190;
$( = datagroup;
$) = datagroup;

Any help would be appreciated.  Thanks in advance...


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


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

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

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

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


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


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