[22621] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4842 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 14 11:05:58 2003

Date: Mon, 14 Apr 2003 08:05:10 -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           Mon, 14 Apr 2003     Volume: 10 Number: 4842

Today's topics:
    Re: Addition in substitution (Philip Lees)
        ANNOUNCE:  Data-Presenter-0.62 <jkeen@concentric.net>
        Client-SSL-Warning: Peer certificate not verified (Chris Ryan)
    Re: Determine type of file ascii or bin <flavell@mail.cern.ch>
    Re: executing perl script (bhat)
    Re: Handling negative exitcodes using system() (Tom Gevaert)
    Re: help, help Regex <as@hotmail.com>
    Re: help, help Regex <as@hotmail.com>
    Re: help, help Regex (Tad McClellan)
    Re: help, help Regex <as@hotmail.com>
    Re: help, help Regex <uri@stemsystems.com>
    Re: LWP Problem with 500 (Internal Server Error) Can't  (Helgi Briem)
    Re: Matching and capturing wide character strings in bi (Lauren Smith)
        Method inheritance? <rm@no-mail.com>
    Re: My 1st japh!! <bik.mido@tiscalinet.it>
    Re: Network socket - binary data. <webmaster@neverseenbefore.com>
    Re: Network socket - binary data. <bart.lateur@pandora.be>
    Re: Network socket - binary data. <uri@stemsystems.com>
    Re: perl compiler for win32 platform? <a@b.c>
    Re: Perl DBD::DB2 and security? (Johann Sander)
    Re: Perl DBD::DB2 and security? <shah@typhoon.xnet.com>
    Re: perlbug and diffs (Anno Siegel)
    Re: PHP Code to PERL conversion... <noreply@gunnar.cc>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        Subroutines:: Return Type Vs Performance <kasp@epatra.com>
    Re: Subroutines:: Return Type Vs Performance (Tad McClellan)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 14 Apr 2003 09:30:06 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Addition in substitution
Message-Id: <3e9a7f21.593450140@news.grnet.gr>

On 7 Apr 2003 10:46:41 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>Philip Lees <pjlees@ics.forthcomingevents.gr> wrote in comp.lang.perl.misc:

>> I was wondering whether Perl could do this automagically, but it seems
>> that while
>> 
>> my $var = 'version104';
>> $var++;
>> print "$var\n";
>> 
>> does what I would expect (i.e. print version105),
>> 
>> my $var = 'version_104';
>> $var++;
>> print "$var\n";
>> 
>> or other more complex variations, do not. Could somebody please
>> explain why?
>
>The perlop document explains this (look for "++").  In short, magic
>string incrementation only happens to strings matching
>/^[a-zA-Z]*[0-9]*\z/.

Ah, thank you. For some reason I thought underscore was included along
with the alphas, no doubt because of \w.

Phil
-- 
Ignore coming events if you wish to send me e-mail


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

Date: Mon, 14 Apr 2003 10:09:43 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: ANNOUNCE:  Data-Presenter-0.62
Message-Id: <298ac28d5bdf6563a50a880fd6a3bdc6@news.teranews.com>

Perl extension Data::Presenter has been uploaded to CPAN, is available at
http://search.cpan.org/author/JKEENAN/Data-Presenter-0.62/ and has begun to
appear on CPAN mirrors.

Data::Presenter is useful for re-formatting database reports and can be used
as a small database in situations where one elects not to use a dedicated
database program.







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

Date: 14 Apr 2003 02:46:09 -0700
From: cryan3@earthlink.net (Chris Ryan)
Subject: Client-SSL-Warning: Peer certificate not verified
Message-Id: <73a63a2f.0304140146.4bfec6f@posting.google.com>

Using Perl with LWP and Crypt::SSLeay to try to send info to a credit
card processing site (authorize.net) and I am getting that error: "
Client-SSL-Warning: Peer certificate not verified" which is what I
believe is causing it to fail. (Authorize.net rejects the
transaction.)My code is below:

#######begin code#######
#!/usr/bin/perl -w

BEGIN {
    unshift(@INC,"/home/vhosting/onthebrightside/cgi-bin/lib/");
}

use strict;
use CGI qw(:all);
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use Crypt::SSLeay;

	my $ccnum = param('ccnum');
	my $ex1 = param('ex1');
	my $ex2 = param('ex2');
	my $total = param('total');
	
	my $expdate = $ex1 . $ex2;
	
	$ENV{'SSL_CIPHER'}="EXP-RC4-MD5";
	
	my $ua = LWP::UserAgent->new;
	
my $req = POST 'https://secure.authorize.net/gateway/transact.dll',
                [ x_Version => '3.1',
				 x_Delim_Data => 'True',
				 x_Login => 'ant481300516',
				 x_Tran_Key => '9x8fGqOfI58UHB4V',
				 x_Amount => $total,
				 x_Card_Num => $ccnum,
				 x_Exp_Date => $expdate,
				 x_Type => 'AUTH_CAPTURE',
				 x_Test_Request => 'TRUE' ];
				
  my $feedback = $ua->request($req)->as_string;  
  
print "Content-type: text/html\n\n";
print "<html><body>\n";
print "<hr>Transaction Results!<br><hr>\n";
print "$feedback";
print "<hr>\n";
print "</body></html>\n";
######end code######

Below is the full output I get:

HTTP/1.1 200 OK Connection: close Date: Mon, 14 Apr 2003 09:38:22 GMT
Server: Microsoft-IIS/5.0 Content-Length: 146 Content-Type: text/html
Client-Date: Mon, 14 Apr 2003 09:29:07 GMT Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=RSA Data Security, Inc./OU=Secure
Server Certification Authority Client-SSL-Cert-Subject:
/C=US/ST=Utah/L=Provo/O=AUTHORIZE.NET
CORPORATION/OU=DEVELOPMENT/OU=Terms of use at www.verisign.com/RPA
(c)01/CN=SECURE.AUTHORIZE.NET Client-SSL-Cipher: RC4-MD5
Client-SSL-Warning: Peer certificate not verified The following errors
have occurred.
(92) The gateway no longer supports the requested method of
integration.

The error(92) is from authorize.net and the only thing I can think
causing this is the SSL error, because everything else is right.


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

Date: Mon, 14 Apr 2003 11:51:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Determine type of file ascii or bin
Message-Id: <Pine.LNX.4.53.0304141148380.16261@lxplus095.cern.ch>

On Mon, Apr 14, Walter Roberson inscribed on the eternal scroll:

> Someone suggested always ftp'ing in binary mode, and other people
> jumped on them, complaining about line termination issues or
> just generally insulting them.

If you're going to accuse any contributors of insulting behaviour,
let's see you do it directly and with a quote of the relevant item.

The only insult that I had seen here was someone who evidently didn't
know what they were talking about, spreading misinformation.

> If you are transfering files between systems that have different
> ideas about line termination and that is causing problems, then
> chances are that you are transfering files between systems with
> different ideas about character set encodings. You thus should
> not be merely testing about whether a file is "ASCII" or not, you
> should also be worrying about the file encoding, file creator's
> intent, and so on.

Indeed; but this isn't specific to Perl.



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

Date: 14 Apr 2003 05:53:25 -0700
From: rnbhat89@yahoo.com (bhat)
Subject: Re: executing perl script
Message-Id: <4f49dc09.0304140453.2d96bf53@posting.google.com>

Hello,
 I tried the script given by Mr. David Efflandt and i was able to run
the script ie i didn't get any errors like "no host" or "nothing read
from...". I am still not able to solve could. Any hints to solve this
would be appreciated.
Thanks and Regards,
Roopa



efflandt@xnet.com (David Efflandt) wrote in message news:<slrnb9jmj1.fjn.efflandt@typhoon.xnet.com>...
> On 12 Apr 2003 02:09:46 -0700, bhat <rnbhat89@yahoo.com> wrote:
> > Hello,
> >  I am able to execute the below script from the command prompt.
> > However when i try to run through internet explorer the script doesn't
> > work as intended. The variable $folder in the script below now has
> > null value. Seems like it doesn't execute any command after the
> > statement my $msg = $folder->message(0);. I don't see any error
> > messages. Any clues to solve this problem would be appriciated.
> > Regards,
> > Roopa
> 
> You did not specify web server and OS, but I assume that you have
> successfully run other CGI on that server (?).
> 
> It could be that the user CGI is running as, does not have permission to
> open sockets.  To test that theory try the following as CGI (lifted and
> modified from 'perldoc perlipc'):
> 
> #!/usr/bin/perl -w
> use strict;
> use Socket;
> use CGI::Carp qw(fatalsToBrowser);
> my ($remote,$port, $iaddr, $paddr, $proto, $line);
> $remote  = 'mail.xxxx.net';	### your pop3 server
> $port    = 'pop3';
> 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');
> socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
> connect(SOCK, $paddr) || die "connect: $!";
> print "Content-type: text/plain\n\n";
> if (defined($line = <SOCK>)) {
>     print $line;
> } else {
>  print "nothing read from $remote socket\n";
> }
> close (SOCK) || die "close: $!";
> exit;
> 
> 
> If that works in the shell and fails as CGI, then any Perl modules that 
> use sockets will likely fail as CGI.


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

Date: 14 Apr 2003 07:05:08 -0700
From: tom.gevaert@aditel.be (Tom Gevaert)
Subject: Re: Handling negative exitcodes using system()
Message-Id: <cc1e4c7e.0304140605.1249aefa@posting.google.com>

"John W. Krahn" <krahnj@acm.org> wrote in message news:<3E949E3A.24B5409D@acm.org>...
> Tom Gevaert wrote:
> > 
> > Can anyone tell me how I can catch a negative exitcode when using the
> > system() function? I use the following commands to execute the
> > "external" command and to retrieve its exitcode:
> > 
> >          system (@args)==0 or $exit_value=$?;
> >          $exit_value = $exit_value >> 8;
> > 
> > If I have a positive exitcode this works OK. My problem now is that
> > the external program only delivers negative exitcodes in case of a
> > problem.
> 
>           $exit_value = unpack 'c', pack 'C', $exit_value >> 8;
> 
Thanks for the help, I have tried to do it like this but I still got a
problem catching the correct exit code. The problem is that I always
get exit code -1 if the program generates a negative code. This means
-6 becomes -1 and of course this means that I don't get the correct
exitcode.
> 
> 
> John


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

Date: Mon, 14 Apr 2003 09:36:53 GMT
From: Devop <as@hotmail.com>
Subject: Re: help, help Regex
Message-Id: <3E9A832A.26DF0769@hotmail.com>


I am just new to perl , that is it.

and i am not student any more :-)

rgds





Optional wrote:

> I've heard a rumor that on Tue, 08 Apr 2003 12:14:38 GMT, Devop
> <as@hotmail.com> wrote the following:
>
> >correction.
> >
> >i mean to print if each of them found or not !!
> >
> >rgds
> >
> >
> >Devop wrote:
> >
> >> Thanks a lot guys.
> >>
> >> But what about  if  i want to search more than one string  from file, and print if i have
> >> found each one of them !!!
> >>
> >> the code was working perfectly ( after ? is added , thanks).
> >>
> >> rgds
> >>
> >> Anno Siegel wrote:
> >>
> >> > Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote in comp.lang.perl.misc:
> >> > > Anno Siegel wrote:
> >> > >
> >> > > > Devop  <as@hotmail.com> wrote in comp.lang.perl.misc:
> >> > > >> Hi.
> >> > > >>
> >> > > >> I have problem here.
> >> > > >>
> >> > > >> I would like to read file , then find some text (string) in that file ,
> >> > > >> if that string is found, then print some thing, if not print some thing
> >> > > >> else !! ( the matched string will not be printed )
> >> > > >
> >> > > >     open my $f, $file or die "Can't read $file: $!";
> >> > > >     my $found;
> >> > > >     while ( <$f> ) {
> >> > > >         last if $found ||= /string/;
> >> > > >     }
> >> > > >     print $found : "something\n" : "something else\n";
> >> > >                    ^
> >> > >
> >> > > That should be '?'.
> >> >
> >> > Oh, right.  I also forgot to mention that it was untested, at least
> >> > that line was.
> >> >
> >> > Thanks for catching that.  It's reassuring to see that code is well
> >> > scrutinized around here.
> >> >
> >> > Anno
>
> Does your Professor know you are getting your programs in a newsgroup
> instead of writing them yourself?



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

Date: Mon, 14 Apr 2003 09:37:46 GMT
From: Devop <as@hotmail.com>
Subject: Re: help, help Regex
Message-Id: <3E9A835E.A433B30D@hotmail.com>

I  read , but i did not understand :-)
rgds

Tad McClellan wrote:

> Devop <as@hotmail.com> wrote:
>
> > Anno thanks to you
>
> > Anno Siegel wrote:
>
> >> Also, don't top-post, please.  See the posting guidelines for this group.
>
> Did you read and understand what Anno said?
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas



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

Date: Mon, 14 Apr 2003 07:58:44 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: help, help Regex
Message-Id: <slrnb9lc44.ian.tadmc@magna.augustmail.com>


[ TOFU repaired one last time ]


Devop <as@hotmail.com> wrote:
> Tad McClellan wrote:
>> Devop <as@hotmail.com> wrote:
>>
>> > Anno thanks to you
>>
>> > Anno Siegel wrote:
>>
>> >> Also, don't top-post, please.  See the posting guidelines for this group.
>>
>> Did you read and understand what Anno said?

> I  read , but i did not understand :-)


Top-posting is when you put your comments at the top, rather than
interleaving your comments following the quoted text that you
are commenting on.

   http://www.catb.org/~esr/jargon/html/entry/top-post.html

   http://www.catb.org/~esr/jargon/html/entry/TOFU.html

Full-quoting is when you quote an entire article instead of
quoting just enough to establish the context for your comments.

Folks here do not like that style of followup, some even killfile
people who insist in posting in that style.

Have you seen the Posting Guidelines that are posted here frequently?

   http://mail.augustmail.com/~tadmc/clpmisc.shtml


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 14 Apr 2003 13:14:51 GMT
From: Devop <as@hotmail.com>
Subject: Re: help, help Regex
Message-Id: <3E9AB305.500613E0@hotmail.com>

Ok. OK.
Thanks a lot.

rgds



Tad McClellan wrote:

> [ TOFU repaired one last time ]
>
> Devop <as@hotmail.com> wrote:
> > Tad McClellan wrote:
> >> Devop <as@hotmail.com> wrote:
> >>
> >> > Anno thanks to you
> >>
> >> > Anno Siegel wrote:
> >>
> >> >> Also, don't top-post, please.  See the posting guidelines for this group.
> >>
> >> Did you read and understand what Anno said?
>
> > I  read , but i did not understand :-)
>
> Top-posting is when you put your comments at the top, rather than
> interleaving your comments following the quoted text that you
> are commenting on.
>
>    http://www.catb.org/~esr/jargon/html/entry/top-post.html
>
>    http://www.catb.org/~esr/jargon/html/entry/TOFU.html
>
> Full-quoting is when you quote an entire article instead of
> quoting just enough to establish the context for your comments.
>
> Folks here do not like that style of followup, some even killfile
> people who insist in posting in that style.
>
> Have you seen the Posting Guidelines that are posted here frequently?
>
>    http://mail.augustmail.com/~tadmc/clpmisc.shtml
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas



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

Date: Mon, 14 Apr 2003 14:08:48 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: help, help Regex
Message-Id: <x7he91b28g.fsf@mail.sysarch.com>

>>>>> "D" == Devop  <as@hotmail.com> writes:

  D> Ok. OK.
  D> Thanks a lot.

  D> Tad McClellan wrote:

  >> [ TOFU repaired one last time ]
  >> >>
  >> >> >> Also, don't top-post, please.  See the posting guidelines for
  >> >> >> this group.
  >> >>
  >> >> Did you read and understand what Anno said?

you didn't understand. you just top posted again to a post about your
top posting. don't say you understand when you don't and then break the
very rule you were told about. 

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 14 Apr 2003 09:28:19 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: LWP Problem with 500 (Internal Server Error) Can't read entity body
Message-Id: <3e9a7e50.325820274@news.cis.dfn.de>

On 12 Apr 2003 06:31:23 -0700, chacrint@hotmail.com
(Chacrint Charinthorn) wrote:

>I tried to post using LWP but I got the following error:
>500 (Internal Server Error) Can't read entity body: Connection
> reset by peer

Perl doesn't have a 500 error.  Web servers do.  
Is this a stealth CGI question?  If so, you would
be well advised to consult the FAQ documents, 
specifically perldoc -q 500, also known as:

  "My CGI script runs from the command line but not the 
   browser.  (500 Server Error)"

Short answers:
1-  Debug your program on the command line first before 
adding the added complexity of the Common Gateway 
Interface.

2- Use the CGI.pm module that comes as standard
with every Perl distribution.
-- 
Regards, Helgi Briem
helgi DOT briem AT decode DOT is


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

Date: 14 Apr 2003 06:18:03 -0700
From: lauren_smith13@hotmail.com (Lauren Smith)
Subject: Re: Matching and capturing wide character strings in binary files
Message-Id: <abee5678.0304140518.198b4ca8@posting.google.com>

lauren_smith13@hotmail.com (Lauren Smith) wrote in message news:<abee5678.0304122328.4b937db0@posting.google.com>...
> I am having trouble matching a multi-byte character string in a binary
> file.
> 
> I have a compiled binary executable that contains zero or more wide
> character strings of a specific format.  I would like to match and
> extract the string.

Time ran out on me, so I ended up performing a terrible hack relying
on external programs to alter the binary file.

What I did (not at all related to Perl) is convert the entire binary
file from Unicode to ASCII using an external tool and redirect the
output to a Perl array.

my @contents = `uni2asc MyBin.Bin`;

Then I simply performed the previously mentioned ASCII string search
on each array entry.  Nothing at all groundbreaking.

It works fine, now.  I'm not too happy with the solution and I'm
worried it's bound to break eventually.  If I get any free cycles, I
will come back and try to figure this out in pure Perl.  I'm sure
there's a solution, I just don't have the time nor the brains to
figure it out yet.

Lauren


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

Date: Tue, 15 Apr 2003 00:00:39 +0900
From: Roy Marteen <rm@no-mail.com>
Subject: Method inheritance?
Message-Id: <20030415000039.7297b652.rm@no-mail.com>

Hi,

I tried to wrap DBI.pm with my own module. This is my script:
---[DB.pm]---
package DB;
use strict;
use DBI;

sub connect {
    my $class = shift();
    my $self = {};
    $self->{dbh} = DBI::->connect("DBI:mysql:dummy", "root", "mysql", {
RaiseError => 1 });
    bless($self, $class);
    return $self;
}

Now I can use it using: 
---[test.pl]---
use DB;
my $db = DB::->connect();
my $dbh = $db->{dbh};

I don't want it this way. I want to wrap it in such a way that I can
access it using:
---[test.pl]---
use DB;
my $dbh = DB::->connect();

How can I do this? 


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

Date: Mon, 14 Apr 2003 09:44:47 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: My 1st japh!!
Message-Id: <cjpk9vcsitpe9qbj1ffe0qhv46fp206ser@4ax.com>

On 13 Apr 2003 17:03:59 GMT, "Tassilo v. Parseval"
<tassilo.parseval@rwth-aachen.de> wrote:

>No, eval is fine. It certainly allows for very contorted and obscure
>control-flow and data-hiding. I think the only thing that should be used
>seldom in JAPHs is chr(). It blurs things only on the very first sight.
                    ^^^^^                              ^^^^^^^^^^^^^^^

Do you think that is the case also with this particular one?


Michele
-- 
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


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

Date: Mon, 14 Apr 2003 10:40:27 +0200
From: "Dieter D'Hoker" <webmaster@neverseenbefore.com>
Subject: Re: Network socket - binary data.
Message-Id: <b7ds5u$di6fn$1@ID-155251.news.dfncis.de>


"Ras" <Ras@majere.demon.co.uk> wrote in message
news:b7cb16$84b$1$8300dec7@news.demon.co.uk...
> I have found lots of examples of how to pass ASCII data via IO sockets,
and
> its essentially the same as a chat server or webserver...
>
> what i am having a hard time finding data on is how to pass binary data
> (many examples state they don't work with binary data, but don't give an
> alternative.)
>
> i am trying to move data from one system to another without using FTP.
>
> thanks for anyhelp (and you should print any help on this, as even
> commercial books lack this basic example)
>
> Ford

something like this :

my $new = $yoursocket->accept();
binmode $new;
syswrite($new, $data, CHUNKSIZE);
sysread($new, $data, CHUNKSIZE);

?

--
Dieter D'Hoker
http://dieter.dhoker.com/
news:free.nl.dieter.dhoker & news:alt.nl.fan.dieter.dhoker
Tetrinet SeRVer : TSRV.COM





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

Date: Mon, 14 Apr 2003 11:21:27 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Network socket - binary data.
Message-Id: <m56l9vg0med2a9s8ct039t1ob9o1b7n5s6@4ax.com>

Ras wrote:

>I have found lots of examples of how to pass ASCII data via IO sockets, and
>its essentially the same as a chat server or webserver...
>
>what i am having a hard time finding data on is how to pass binary data
>(many examples state they don't work with binary data, but don't give an
>alternative.)
>
>i am trying to move data from one system to another without using FTP.

Don't use binmade(). That's basically it. Oh, and don't use the <SOCKET>
syntax to read the data. Binary data doesn't consist of lines. Use
read() or sysread() instead. I never quite understood the difference
between the two, I think that disserence is actually quite
system-dependent anyway. If anybody feels like shedding a light on this,
please feel free to do so.

You can always base64- encode your data, that way you can transmit data
as text and make sure it doesn't get corrupted on the way.

-- 
	Bart.


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

Date: Mon, 14 Apr 2003 14:06:27 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Network socket - binary data.
Message-Id: <x7k7dxb2cc.fsf@mail.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> writes:

  BL> syntax to read the data. Binary data doesn't consist of lines. Use
  BL> read() or sysread() instead. I never quite understood the
  BL> difference between the two, I think that disserence is actually
  BL> quite system-dependent anyway. If anybody feels like shedding a
  BL> light on this, please feel free to do so.

read uses stdio and its buffers. it will restart upon interruption (from
a signal). sysread is a wrapper around c's read (as syswrite is wrapped
around c's write) and doesn't use any stdio buffering. so sysread is
more efficient if yo use it correctly (usually with an event loop of
some sort or carefully written code).

as for binmode and those calls that is another story. i don't know
winblows.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 14 Apr 2003 11:06:44 +0200
From: ZZT <a@b.c>
Subject: Re: perl compiler for win32 platform?
Message-Id: <b7dtn5$a30$1@news1.wdf.sap-ag.de>

Chris Olive wrote:

>> Simon, where can I get the binary parl.exe ?
>> I get an error back from pp:
>> can't find par loader

> Get ActiveState's Perl for Windows: http://www.activestate.com
> It's a free download and it's really killer on a Windoze box.

Chris, I've got and actually using ActivePerl version 5.61 but it in 
conjunction with PAR 0.67 I get the par-loader error. Any hints?
In principle it doesn't matter which way I use, but until now there is 
no option that works :( I also played around with perlcc but I need the 
compiler that was used to compile activeperl which is afaik MS-VCC.

thanks & regard



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

Date: 14 Apr 2003 00:27:51 -0700
From: jsander@puc-online.de (Johann Sander)
Subject: Re: Perl DBD::DB2 and security?
Message-Id: <ff2b8f88.0304132327.50589f38@posting.google.com>

Hi Benjamin,

Benjamin Goldberg <goldbb2@earthlink.net> wrote in message 

> The DBI module doesn't care about the contents of an sql query.  It just
> passes it on to the database driver.
> 
> Not having read the docs, I don't know if DBD::DB2 is able to handle
> packages... if it doesn't, that's it's failing, not DBI's.

Can you tell me how the DBI can possibly utilize packages, i.e. static SQL?

IMHO the DBI is all about dynamic SQL only, which is good enough.

Johann


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

Date: Mon, 14 Apr 2003 14:42:53 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: Perl DBD::DB2 and security?
Message-Id: <b7ehdd$ke4$1@flood.xnet.com>

In comp.databases.ibm-db2 Johann Sander <jsander@puc-online.de> wrote:
:)Hi Benjamin,
:)
:)Benjamin Goldberg <goldbb2@earthlink.net> wrote in message 
:)
:)> The DBI module doesn't care about the contents of an sql query.  It just
:)> passes it on to the database driver.
:)> 
:)> Not having read the docs, I don't know if DBD::DB2 is able to handle
:)> packages... if it doesn't, that's it's failing, not DBI's.
:)
:)Can you tell me how the DBI can possibly utilize packages, i.e. static SQL?
:)
:)IMHO the DBI is all about dynamic SQL only, which is good enough.
:)

 It could use it indirectly, if you write stored procedures with static 
 sql. The remote user does not have any priviledges on the database except
 connect and execute stored procedure(s).


:)Johann

-- 
Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com       \ /  --------------------- 
                                       X     against HTML mail
TO REPLY, REMOVE NoJunkMail           / \      and postings      
FROM MY E-MAIL ADDRESS.           
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind,                Above opinions are mine only.
it's backed up on tape somewhere.      Others can have their own.


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

Date: 14 Apr 2003 10:02:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perlbug and diffs
Message-Id: <b7e0vb$26d$1@mamenchi.zrz.TU-Berlin.DE>

Xavier Noria  <fxn@hashref.com> wrote in comp.lang.perl.misc:
> Is there a way to attach a patch to a bug report generated and sent by
> perlbug?

Don't attach the patch, just append it.  That's usually easier to deal
with for the receiver.

Anno


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

Date: Mon, 14 Apr 2003 11:22:17 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: PHP Code to PERL conversion...
Message-Id: <b7dumt$d218d$1@ID-184292.news.dfncis.de>

Vijoy Varghese wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>> When somebody is struggling with, but fails in solving, some Perl
>> problem, this group is a good place to seek help. But asking for
>> free programming help, when it's obvious that the poster hasn't
>> made any own effort - this poster had apparently not even
>> considered to learn *any* Perl - it's unreasonable. Totally
>> unreasonable.
> 
> Who said i didnt made any try? i was behind this stuff for some 2
> days and i am not that bad at perl.

Thanks for letting us know. You could have fooled me. (You did.)

> The point is that i am not that good with php. So i cant make out
> what that code do.

And you thought that asking in a Perl newsgroup was the way to find
out? ;-)

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 14 Apr 2003 14:06:28 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <v9lg342jv9dlb3@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 07 Apr 2003 14:17:49 GMT and ending at
14 Apr 2003 14:43:46 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2003 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com

Totals
======

Posters:  241
Articles: 705 (278 with cutlined signatures)
Threads:  191
Volume generated: 1333.6 kb
    - headers:    606.5 kb (11,697 lines)
    - bodies:     692.3 kb (23,621 lines)
    - original:   432.6 kb (15,785 lines)
    - signatures: 34.2 kb (832 lines)

Original Content Rating: 0.625

Averages
========

Posts per poster: 2.9
    median: 2 posts
    mode:   1 post - 117 posters
    s:      4.6 posts
Posts per thread: 3.7
    median: 3 posts
    mode:   1 post - 50 threads
    s:      3.6 posts
Message size: 1937.0 bytes
    - header:     880.9 bytes (16.6 lines)
    - body:       1005.5 bytes (33.5 lines)
    - original:   628.4 bytes (22.4 lines)
    - signature:  49.6 bytes (1.2 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   42    89.2 ( 35.0/ 47.0/ 24.3)  Benjamin Goldberg <goldbb2@earthlink.net>
   27    82.6 ( 30.0/ 49.2/ 41.7)  tadmc@augustmail.com
   21    33.9 ( 15.7/ 18.2/  7.5)  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   19    32.9 ( 17.5/ 14.2/  6.9)  Gunnar Hjalmarsson <noreply@gunnar.cc>
   17    22.8 ( 12.2/  9.6/  5.3)  helgi@decode.is
   17    40.3 ( 15.7/ 20.7/  8.5)  tassilo.parseval@post.rwth-aachen.de
   16    22.7 ( 13.8/  8.9/  4.6)  "Jürgen Exner" <jurgenex@hotmail.com>
   13    25.2 ( 10.5/ 14.4/  4.9)  Michael Budash <mbudash@sonic.net>
   10    19.4 ( 10.7/  8.8/  1.8)  Devop <as@hotmail.com>
    9    16.8 (  8.7/  6.0/  2.5)  Uri Guttman <uri@stemsystems.com>

These posters accounted for 27.1% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  89.2 ( 35.0/ 47.0/ 24.3)     42  Benjamin Goldberg <goldbb2@earthlink.net>
  82.6 ( 30.0/ 49.2/ 41.7)     27  tadmc@augustmail.com
  40.3 ( 15.7/ 20.7/  8.5)     17  tassilo.parseval@post.rwth-aachen.de
  33.9 ( 15.7/ 18.2/  7.5)     21  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
  32.9 ( 17.5/ 14.2/  6.9)     19  Gunnar Hjalmarsson <noreply@gunnar.cc>
  25.2 ( 10.5/ 14.4/  4.9)     13  Michael Budash <mbudash@sonic.net>
  22.8 ( 12.2/  9.6/  5.3)     17  helgi@decode.is
  22.7 ( 13.8/  8.9/  4.6)     16  "Jürgen Exner" <jurgenex@hotmail.com>
  21.0 (  5.8/ 14.7/ 13.8)      8  peter pilsl <pilsl_usenet@goldfisch.at>
  19.4 ( 10.7/  8.8/  1.8)     10  Devop <as@hotmail.com>

These posters accounted for 29.3% of the total volume.

Top 10 Posters by Volume of Original Content (min. five posts)
==============================================================

        (kb)
Posts   orig  Address
-----  -----  -------

   27   41.7  tadmc@augustmail.com
   42   24.3  Benjamin Goldberg <goldbb2@earthlink.net>
    8   13.8  peter pilsl <pilsl_usenet@goldfisch.at>
    5   13.5  qanda <fumail@freeuk.com>
   17    8.5  tassilo.parseval@post.rwth-aachen.de
   21    7.5  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
   19    6.9  Gunnar Hjalmarsson <noreply@gunnar.cc>
    7    6.2  "Bigus" <bigusNO@SPAMcreationfactor.net>
   17    5.3  helgi@decode.is
    5    5.1  Sara <genericax@hotmail.com>

These posters accounted for 30.7% of the original volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.945  ( 13.5 / 14.3)      5  qanda <fumail@freeuk.com>
0.939  ( 13.8 / 14.7)      8  peter pilsl <pilsl_usenet@goldfisch.at>
0.883  (  4.0 /  4.6)      9  "Kasp" <kasp@epatra.com>
0.862  (  2.5 /  2.9)      5  supportgeek <molivier@caregroup.harvard.edu>
0.858  (  3.7 /  4.3)      6  Eric Osman <ericosman@rcn.com>
0.849  ( 41.7 / 49.2)     27  tadmc@augustmail.com
0.775  (  3.1 /  4.0)      5  "Richard Gration" <richard@zync.co.uk>
0.755  (  4.7 /  6.2)      7  abigail@abigail.nl
0.708  (  6.2 /  8.8)      7  "Bigus" <bigusNO@SPAMcreationfactor.net>
0.702  (  2.5 /  3.6)      6  newsgroup2.replies.benaltw@xoxy.net

Bottom 10 Posters by OCR (minimum of five posts)
================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.461  (  2.1 /  4.6)      6  ctcgag@hotmail.com
0.437  (  3.4 /  7.9)      6  Chris Olive <nospam@raytheon.com>
0.427  (  2.7 /  6.4)      6  "Bill Smith" <wksmith@optonline.net>
0.410  (  2.5 /  6.0)      9  Uri Guttman <uri@stemsystems.com>
0.410  (  7.5 / 18.2)     21  Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.409  (  8.5 / 20.7)     17  tassilo.parseval@post.rwth-aachen.de
0.341  (  4.9 / 14.4)     13  Michael Budash <mbudash@sonic.net>
0.285  (  1.2 /  4.4)      6  "John W. Krahn" <krahnj@acm.org>
0.255  (  3.1 / 12.1)      7  "Michael P. Broida" <michael.p.broida@boeing.com>
0.207  (  1.8 /  8.8)     10  Devop <as@hotmail.com>

37 posters (15%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   20  help, help Regex
   18  hashes as lists
   17  Ugly code; what does it do?
   14  Shortcut
   13  irregular expression ?
   12  linux
   11  Accessing form data via tied hash
   10  How it wipe out or delete or init an array?
   10  My 1st japh!!
    9  Search for text than search again based on results.

These threads accounted for 19.0% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  38.2 ( 15.1/ 22.2/  7.3)     17  Ugly code; what does it do?
  36.0 ( 19.6/ 16.0/  4.7)     20  help, help Regex
  34.6 ( 17.1/ 16.2/  8.1)     18  hashes as lists
  33.8 (  1.9/ 32.0/ 32.0)      2  Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
  22.0 ( 12.5/  8.7/  4.9)     13  irregular expression ?
  21.4 ( 11.9/  8.8/  4.5)     14  Shortcut
  21.2 ( 10.4/  9.5/  5.4)     11  Accessing form data via tied hash
  18.4 (  6.9/ 11.0/  6.2)      7  pack, unpack and 'w'
  18.4 (  6.4/ 11.3/  4.6)      7  access a struct value
  17.5 (  5.3/ 11.9/  6.7)      6  my $x = 100 for 1..3  why is $x undef

These threads accounted for 19.6% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
=============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.815  (  7.8/   9.5)      7  extract the first word in a string
0.780  (  4.4/   5.7)     12  linux
0.699  (  5.2/   7.5)      6  What Can I DO???  Installation of Tk failed.
0.687  (  3.7/   5.4)      8  Determine type of file ascii or bin
0.667  (  4.7/   7.1)      6  What is wrong?
0.664  (  1.7/   2.5)      5  Network socket - binary data.
0.662  (  4.3/   6.4)      8  avoid using extra variable
0.646  (  4.5/   6.9)      7  Questions about Perl's Unicode Model
0.643  (  1.5/   2.4)      6  Generating a relative path
0.638  (  3.4/   5.4)      8  kill cgi?

Bottom 10 Threads by OCR (minimum of five posts)
================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.458  (  1.2 /  2.7)      5  Handling negative exitcodes using system()
0.453  (  3.0 /  6.7)      6  Piping Perl output through nroff?
0.439  (  1.5 /  3.4)      6  A better way to extract a substring?
0.421  (  3.1 /  7.4)      9  Using Eval Statement To Trap Module Not Present Fatal Error
0.415  (  2.0 /  4.7)      8  Graphics and games
0.404  (  4.6 / 11.3)      7  access a struct value
0.393  (  1.3 /  3.4)      6  How to standardize variable output length
0.331  (  7.3 / 22.2)     17  Ugly code; what does it do?
0.303  (  1.3 /  4.2)      7  Which is better - hashes or subroutines
0.291  (  4.7 / 16.0)     20  help, help Regex

52 threads (27%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      13  comp.lang.perl.modules
       7  alt.perl
       6  comp.unix.shell
       4  comp.os.linux.misc
       4  comp.databases.ibm-db2
       3  comp.lang.perl
       3  netscape.public.mozilla.layout
       2  comp.lang.perl.tk
       2  no.it.programmering.perl
       2  be.comp.programming

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  Benjamin Goldberg <goldbb2@earthlink.net>
       4  "SAQ" <ssawan786@hotmail.com>
       4  timmy@cpan.org
       3  "gbd" <newsgroups@goodboysdo.net>
       2  "Dieter D'Hoker" <webmaster@neverseenbefore.com>
       2  Chris Olive <nospam@raytheon.com>
       2  "David J. Topper" <topper@virginia.edu>
       2  helgi@decode.is
       2  Mark Jason Dominus <mjd@plover.com>
       2  Johann Sander <jsander@puc-online.de>


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

Date: Mon, 14 Apr 2003 18:25:04 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Subroutines:: Return Type Vs Performance
Message-Id: <b7eb3j$791$1@newsreader.mailgate.org>

"Subroutines :: The flexibility of returning multiple values (eg in array
context) imposes a performace penalty." Is this true?

Can someone please explain why the performance is going to be hit if I
return for eg. 10 values instead of 1?

Regards,
Kasp.
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - From
Dilbert.




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

Date: Mon, 14 Apr 2003 09:43:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Subroutines:: Return Type Vs Performance
Message-Id: <slrnb9li92.iha.tadmc@magna.augustmail.com>

Kasp <kasp@epatra.com> wrote:

> "Subroutines :: The flexibility of returning multiple values (eg in array
> context) imposes a performace penalty." 


What is it that you are quoting from?

You should provide an attribution for quotes.

(You must have meant "list context" rather than "array context".)


> Is this true?


Yes.


> Can someone please explain why the performance is going to be hit if I
> return for eg. 10 values instead of 1?


The question (and answer) are basic Computer Science, there is
nothing Perl-specific about the model commonly used for
subroutine calls.

When a subroutine is called, all of its arguments are pushed onto
the stack by the main code, then popped off of the stack in the
subroutine code.

With 1 argument, there is 1 push and 1 pop. With 10 arguments there
are 10 pushes and 10 pops.

If you return a reference to an array instead of a list, then there
is only 1 push/pop regardless of the size of the array.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4842
***************************************


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