[25615] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7859 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 5 00:05:45 2005

Date: Fri, 4 Mar 2005 21:05:20 -0800 (PST)
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, 4 Mar 2005     Volume: 10 Number: 7859

Today's topics:
    Re: BerkeleyDB oddity? (Anno Siegel)
    Re: bug in perl xhoster@gmail.com
    Re: bug in perl <webmaster @ infusedlight.net>
    Re: cgi question kinda <tadmc@augustmail.com>
    Re: comparing two numbers (Anno Siegel)
    Re: comparing two numbers <postmaster@castleamber.com>
    Re: comparing two numbers (Anno Siegel)
    Re: comparing two numbers <darkon.tda@gmail.com>
    Re: disagree with a few things in perlsec <newspost@kohombanDELETE.net>
        exclude regular expression <nospam@nospam.com>
    Re: exclude regular expression <abigail@abigail.nl>
    Re: exclude regular expression (Anno Siegel)
    Re: how to convert bit vectors to hex <someone@example.com>
        LibXML UTF8 - Input is not proper UTF-8, indicate encod <vava@vkkk.net>
    Re: Looping through a log file <tadmc@augustmail.com>
    Re: Looping through a log file <asolkar@gmail.com>
    Re: negative backreference? (Anno Siegel)
    Re: perl null value ? <jazeker_b_nospamlalala@yahoo.co.uk>
    Re: perl null value ? <tadmc@augustmail.com>
        Problem installing MIME:Tools <joliver@john-oliver.net>
    Re: Problem installing MIME:Tools <pobugfix@peterlink.ru>
    Re: Problem installing MIME:Tools <joliver@john-oliver.net>
    Re: Problem installing MIME:Tools <kalinaubears@iinet.net.au>
        qx, Filter::Simple, and testing <abigail@abigail.nl>
    Re: qx, Filter::Simple, and testing (Anno Siegel)
        SOAP::Lite +wsdl <pobugfix@peterlink.ru>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 4 Mar 2005 23:27:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: BerkeleyDB oddity?
Message-Id: <d0aqtn$a3t$2@mamenchi.zrz.TU-Berlin.DE>

Mark <admin@asarian-host.net> wrote in comp.lang.perl.misc:
> Dear group,
> 
> Using the tied interface of BerkeleyDB 0.26 ("use BerkeleyDB"), I
> encountered an oddity; at least to me. :) Consider this, please:
> 
> if ($badtokens{$key}) {
>     print "PRESENT: $key\n";
>     if ($_ = delete $badtokens{$key}) {
>         print "DELETED: $key\n";
>     }
> }
> 
> Now, 'regularly', in scalar context,the delete() function (Perl 5.8.6)
> will return the value of the last element deleted (or the undefined value
> if that element did not exist). However, even though the item is
> definitely deleted from the database, the return of the delete is always
> an empty string (but not undef!).
>
> Maybe there is something I do not understand about the underlying tie
> structure, in which case I would appreciate if someone enlightened me, or
> else I would probably consider this to be a small bug.

Weirder things than that can happen with tied variables.  The normal
documentation of Perl functions may not be applicable when these are
involved.

Whether it must be considered a bug would depend on the documentation
of the BerkeleyDB tie class.  There may be reasons it is implemented
this way.  If so, it should be documented.

Anno


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

Date: 04 Mar 2005 23:20:11 GMT
From: xhoster@gmail.com
Subject: Re: bug in perl
Message-Id: <20050304182011.371$rV@newsreader.com>

"Robin" <webmaster @ infusedlight.net> wrote:
> why does it not work to say
>     print <<END if defined ($var)
> line
> line
> line
>     or
>     print <<END;
> line
> line
> line
> END

That works just fine.  It does exactly what I expected it too.
But beware of the lack of semicolon at the end of the statement.

> is that code wrong or is a bug in perl?

Neither.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Fri, 4 Mar 2005 18:43:17 -0700
From: "Robin" <webmaster @ infusedlight.net>
Subject: Re: bug in perl
Message-Id: <xt-dne_kzpwykLTfRVn-3Q@comcast.com>


<xhoster@gmail.com> wrote in message 
news:20050304182011.371$rV@newsreader.com...
> "Robin" <webmaster @ infusedlight.net> wrote:
>> why does it not work to say
>>     print <<END if defined ($var)
>> line
>> line
>> line
>>     or
>>     print <<END;
>> line
>> line
>> line
>> END
>
> That works just fine.  It does exactly what I expected it too.
> But beware of the lack of semicolon at the end of the statement.
>
>> is that code wrong or is a bug in perl?
>
> Neither.
>
> Xho
>
> -- 
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service                        $9.95/Month 30GB
I figured it out now, thanks.
-Robin




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

Date: Fri, 4 Mar 2005 17:20:38 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: cgi question kinda
Message-Id: <slrnd2hra6.7j6.tadmc@magna.augustmail.com>

Brian Wakem <no@email.com> wrote:
> Robin wrote:


>> is that what you mean?
> 
> 
> No, and I have no idea what you mean.


That is typical of this OP.


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


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

Date: 4 Mar 2005 23:40:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: comparing two numbers
Message-Id: <d0arle$a3t$3@mamenchi.zrz.TU-Berlin.DE>

David K. Wall <darkon.tdo@gmail.com> wrote in comp.lang.perl.misc:
> John Bokma <postmaster@castleamber.com> wrote:
> 
> > David K. Wall wrote:
> > 
> >> if ( 1 == keys %hash ) {
> >>     print "All the same\n";
> > 
> > Aargh, keys %hash = 1 with warnings on gives:
> > Found = in conditional, should be == at ...
> > 
> > Never understood crippled^H^H^H^H^H^H^H^Hdefensive programming :-(
> 
> It wasn't intended to be defensive.  I typed it that way because I was 
> too lazy to type an extra set of parentheses.  :-)

But you don't have to.  "keys" binds tightly enough for "keys %hash == 1"
to work.  The warning about "=" instead of "==" is unrelated.

Anno


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

Date: 5 Mar 2005 00:07:08 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: comparing two numbers
Message-Id: <Xns960FB850D17F6castleamber@130.133.1.4>

Anno Siegel wrote:

> David K. Wall <darkon.tdo@gmail.com> wrote in comp.lang.perl.misc:
>> John Bokma <postmaster@castleamber.com> wrote:
>> 
>> > David K. Wall wrote:
>> > 
>> >> if ( 1 == keys %hash ) {
>> >>     print "All the same\n";
>> > 
>> > Aargh, keys %hash = 1 with warnings on gives:
>> > Found = in conditional, should be == at ...
>> > 
>> > Never understood crippled^H^H^H^H^H^H^H^Hdefensive programming :-(
>> 
>> It wasn't intended to be defensive.  I typed it that way because I was 
>> too lazy to type an extra set of parentheses.  :-)
> 
> But you don't have to.  "keys" binds tightly enough for "keys %hash == 1"
> to work.  The warning about "=" instead of "==" is unrelated.

Read better next time, all the clues are there.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: 5 Mar 2005 00:42:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: comparing two numbers
Message-Id: <d0avab$dkk$2@mamenchi.zrz.TU-Berlin.DE>

John Bokma  <postmaster@castleamber.com> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> 
> > David K. Wall <darkon.tdo@gmail.com> wrote in comp.lang.perl.misc:
> >> John Bokma <postmaster@castleamber.com> wrote:
> >> 
> >> > David K. Wall wrote:
> >> > 
> >> >> if ( 1 == keys %hash ) {
> >> >>     print "All the same\n";
> >> > 
> >> > Aargh, keys %hash = 1 with warnings on gives:
> >> > Found = in conditional, should be == at ...
> >> > 
> >> > Never understood crippled^H^H^H^H^H^H^H^Hdefensive programming :-(
> >> 
> >> It wasn't intended to be defensive.  I typed it that way because I was 
> >> too lazy to type an extra set of parentheses.  :-)
> > 
> > But you don't have to.  "keys" binds tightly enough for "keys %hash == 1"
> > to work.  The warning about "=" instead of "==" is unrelated.
> 
> Read better next time, all the clues are there.

There is no need to revise my reading.  I am addressing David's actual
intent (avoiding parentheses) in putting "1" first, not the defensive
one (provoking a syntax error in case of "=") you imputed.

Anno


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

Date: Sat, 05 Mar 2005 02:13:03 -0000
From: David Wall <darkon.tda@gmail.com>
Subject: Re: comparing two numbers
Message-Id: <Xns960FD7D655602darkon@216.168.3.30>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:

> David K. Wall <darkon.tdo@gmail.com> wrote in
> comp.lang.perl.misc: 
>> John Bokma <postmaster@castleamber.com> wrote:
>> 
>> > David K. Wall wrote:
>> > 
>> >> if ( 1 == keys %hash ) {
>> >>     print "All the same\n";
>> > 
>> > Aargh, keys %hash = 1 with warnings on gives:
>> > Found = in conditional, should be == at ...
>> > 
>> > Never understood crippled^H^H^H^H^H^H^H^Hdefensive
>> > programming :-( 
>> 
>> It wasn't intended to be defensive.  I typed it that way
>> because I was too lazy to type an extra set of parentheses. 
>> :-) 
> 
> But you don't have to.  "keys" binds tightly enough for "keys
> %hash == 1" to work.  The warning about "=" instead of "==" is
> unrelated. 

I trust you to be correct, but if I'm too lazy to type a set of 
parentheses, what makes you think I remember or will check to see 
how tightly keys() binds?  <smile>


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

Date: Sat, 05 Mar 2005 10:48:46 +0800
From: GreenLeaf <newspost@kohombanDELETE.net>
Subject: Re: disagree with a few things in perlsec
Message-Id: <38sl34F5rgpg3U1@individual.net>

Abigail wrote:

> But the bank analogue is flawed because nowadays, one of the features
> of a bank is that the banks takes the responsibility.

It's not entirely flawed in this view. But it works _against_ what OP 
wanted to show. :o) Old fashioned banks are 'low-security' systems, and 
current banks are 'high security' systems. When you are satisfied about 
the level of security the system provides by itself, then you think of 
having convenience instead of sacrificing it for some additional 
'chance' security.

IMHO, the OP's argument was fundamentally correct - to combat it, you 
need the argument of practical convenience/usability, hence was my 
question. :) Next thing is highly related to the OP's argument:

In _my_ case, I won't only keep my money in bank, but would even make 
some of its properties 'readable' to others. For instance, I give out my 
bank account number to people whom I never trust, so they can transfer 
money online. They don't have to write cheques, I don't have to cash 
them - convenient for everyone. This is possible because I'm happy about 
the security of the bank and don't have to resort to "nobody knows where 
my money is" strategies for a "better" sense of security. And it 
increases the usability of my bank account compared to the "treasure 
island" strategy :o).

This is analogous to some coding/implementation scenarios.



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

Date: Fri, 04 Mar 2005 15:37:11 -0800
From: whph <nospam@nospam.com>
Subject: exclude regular expression
Message-Id: <burh219d2tvk4e4thge1cg3jsvrgbg8b2d@4ax.com>


Hi,

$text=" x7s0d :username1:username3";
$usernames=":username1:username2:username3:username4";
or (username1|username2|username3|username4)

I want  $text=":username1:username3";

How can I do this with regular expression?

Thanks
--wh


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

Date: 04 Mar 2005 23:48:25 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: exclude regular expression
Message-Id: <slrnd2hsu9.v9v.abigail@alexandra.abigail.nl>

whph (nospam@nospam.com) wrote on MMMMCCIII September MCMXCIII in
<URL:news:burh219d2tvk4e4thge1cg3jsvrgbg8b2d@4ax.com>:
^^  
^^  Hi,
^^  
^^  $text=" x7s0d :username1:username3";
^^  $usernames=":username1:username2:username3:username4";
^^  or (username1|username2|username3|username4)
^^  
^^  I want  $text=":username1:username3";
^^  
^^  How can I do this with regular expression?


It's unclear what you want, but here are some examples:

    $text =~ s/ x7s0d //;
    $text =~ s/[^:]+//;
    $text =~ s/.{7}//;
    $text =~ s/\s\w\d\w\d\w\s//;
    $text =~ s/(:username\d+)|(.)/$1 || ""/g;


Abigail
-- 
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];


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

Date: 4 Mar 2005 23:58:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: exclude regular expression
Message-Id: <d0asnn$a3t$4@mamenchi.zrz.TU-Berlin.DE>

whph  <nospam@nospam.com> wrote in comp.lang.perl.misc:
> 
> Hi,
> 
> $text=" x7s0d :username1:username3";
> $usernames=":username1:username2:username3:username4";
> or (username1|username2|username3|username4)
> 
> I want  $text=":username1:username3";
> 
> How can I do this with regular expression?

Maybe you can, but it's not the best way.  For fixed strings like this,
use a hash.  Store the given user names in a lookup hash:

    my %usernames = map { $_ => 1 }
        qw( username1 username2 username3 username4);

You can then extract the valid names from colon-separated string like
this:

    my $text=" x7s0d :username1:username3";
    $text = join ':', grep $usernames{ $_}, split /:/, $text;

If you need the leading colon, prepend it.

Anno


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

Date: Sat, 05 Mar 2005 04:38:19 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: how to convert bit vectors to hex
Message-Id: <%IaWd.2352$KI2.800@clgrps12>

hongyan wrote:
> I have a ascii file has the format: each row has 32 bits.
> 00001001000101000000000000000000
> 00001001000010101000000000100000
> 10100001000011000000001000000000
> 10100010000011000000010000000000
> .............
> I want to change that to hex numbers and write it to another file as:
> 09140000
> 090a8020
> a10c0200
> a20c0400
> .............
> I tried pack and unpack but I can't get it.
> Can you tell me a way to do it without installing the bit::vector
> package? I am a novice to perl, thank you very much for your help,

You can do it without pack() and unpack()


perl -lpe'$_ = sprintf "%08x", oct "0b$_"'




John
-- 
use Perl;
program
fulfillment


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

Date: Fri, 4 Mar 2005 23:37:14 -0500
From: "Vlajko Knezic" <vava@vkkk.net>
Subject: LibXML UTF8 - Input is not proper UTF-8, indicate encoding !
Message-Id: <7eydnaFVZ571qrTfRVn-hw@rogers.com>

Not so sure what is going on here but is something to do with the way UTF8 
is handled in Perl and/or LibXML



The sctript below:

-          accepts a value from a form text field;

-          builds XML document around it,

-          deparses the document to the string using toString(),

-          parses the string into the XML document using parse_string()

-          transforms XML document into HTML document using XSL 
transformation



Everything works well until UTF8 character is entered in the text field (for 
example é) . In that case when trying to run parse_string() code crashes 
with the message:

=====================================================================

:2: parser error : Input is not proper UTF-8, indicate encoding 
!<test><test_text>abcé</test_text></test>                    ^:2: error: 
Bytes: 0xE9 0x3C 0x2F 0x74<test><test_text>abcé</test_text></test> 
^ at C:/_work/vsurvey/site/test1.cgi line 
24=====================================================================



I know that the code below does not make much sense but this is an 
abstraction of the much more complex code. Environment is Perl 5.8; Apache; 
Windows XP.



Hints and/or explanation what was coded wrong and how should it be fixed are 
very much appreciated.



Vlajko Knezic,

Toronto, Ontario



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

test.cgi



#! c:/Perl/bin/Perl.exe



use CGI;

use XML::LibXML;

use XML::LibXSLT;

use CGI::Carp qw( fatalsToBrowser );

use Encode;



my $mDocument = XML::LibXML::Document-> new();

my $parser = XML::LibXML->new();



$mDocument->setEncoding("UTF8");

my $mCGI = new CGI;

print $mCGI->header;

my $mTest_text = $mCGI->param('test');;



my $mTest = $mDocument-> createElement("test");

my $mTestText = $mDocument-> createElement("test_text");

$mTestText->appendTextNode($mTest_text);

$mTest->appendChild($mTestText);

$mDocument->setDocumentElement( $mTest );

$mDocument->setEncoding("UTF8");

my $mTestXML = $mDocument->toString();

my $mParsedTestXML = $parser->parse_string($mTestXML);



my $mParsedXMLXSL = $parser->parse_file('test.xsl');

my $mParserXSL = XML::LibXSLT->new();

my $mParsedXSL = $mParserXSL->parse_stylesheet($mParsedXMLXSL);

my $mPageHTML = $mParsedXSL->transform($mParsedTestXML);

my $mPrintPageHTML = $mParsedXSL->output_string($mPageHTML);

print $mPrintPageHTML;



test.xsl



<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

<xsl:output method="html" encoding="UTF-8" indent="yes" 
omit-xml-declaration="yes"/>

<xsl:template match="//test">

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  </head>

  <html>

    <body>

    <xsl:value-of select="test_text"/>

    <form name="test" type="post" target="_self">

      <input type="text" name="test" /><input type="submit" name="button"/>

    </form>

    </body>

  </html>

</xsl:template>

</xsl:stylesheet>








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

Date: Fri, 4 Mar 2005 17:26:08 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Looping through a log file
Message-Id: <slrnd2hrkg.7j6.tadmc@magna.augustmail.com>

AJ Hartley <ajperl@mac.com> wrote:

> Each event is
> concluded with a dashed line.


> Event 1 title
> Event 1 user info
> Event 1 time stamp info
> Event 1 status info
> Event 1 file path info
> ----------------------------------------
> Event 2 title
> Event 2 user info
> Event 2 time stamp info
> Event 2 status info
> ----------------------------------------
> and so on...
> 
> My challenge is to figure out how run the parsing on each chunk and
> then continue on to the next or exit as necessary based on the dashed
> line.


   local $/ = "----------------------------------------\n";
   while ( my $record = <FILE> ) {
      # "parse" the record
   }


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


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

Date: Fri, 04 Mar 2005 15:33:14 -0800
From: Mahesh M <asolkar@gmail.com>
Subject: Re: Looping through a log file
Message-Id: <112hs1qbk38p7a1@corp.supernews.com>

AJ Hartley wrote:
> My project is to parse a text log file created by a propietary
> publishing application and stuff the important information into a
> database. The actual parsing of the information for a single event
> using regular expressions was a slam dunk, though each line requires
> it's own expression. But I'm needing some advice with a strategy for
> looping through the file.
> 
> I'm running this process every mintute or so, no more than 10 events
> can stack up in the file during that period.
> 
> Each "event" in the log file may contain four or five lines of
> information. That's the parsing process mentioned above. Each event is
> concluded with a dashed line. If the next line contains nothing, we can
> exit. Otherwise the loop continues. Example:

<...>

> 
> My challenge is to figure out how run the parsing on each chunk and
> then continue on to the next or exit as necessary based on the dashed
> line.
> 

I have dealt with similar cases by splitting the file into an array of 
chunks and then dealing with each chunk individually.

Considering the fact that the log file is almost always pretty short, 
the following should suit. It usually works for me.

#!/usr/bin/perl

use strict;
use warnings;

undef $/;

my @chunks = split (/--+/, <DATA>);

pop @chunks;

print "There are " . @chunks . " chunks\n\n";

foreach my $chunk (@chunks) {
   # do something with the chunk
   foreach my $entry (split ("\n", $chunk)) {
     # Parse the entry and act on it?
     print $entry . "\n";
   }
}

__END__
Event 1 title
Event 1 user info
Event 1 time stamp info
Event 1 status info
Event 1 file path info
----------------------------------------
Event 2 title
Event 2 user info
Event 2 time stamp info
Event 2 status info
----------------------------------------


Hope this helps.
--
Mahesh Asolkar
asolkar-at-gmail-dot-com


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

Date: 4 Mar 2005 23:12:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: negative backreference?
Message-Id: <d0aq0m$a3t$1@mamenchi.zrz.TU-Berlin.DE>

 <eric.hall@gmail.com> wrote in comp.lang.perl.misc:

Please give an attribution and some context in your reply.
 
> I've tried wrapping just the "rdns" part in a negative look-ahead, and
> I've tried wrapping the whole thing, and neither produces a match when
> the values are different.
> 
> Here's the first test, using non-matching names:
> 
> #!/usr/bin/perl
> 
> $_ = "[ rdns=hostname1 helo=hostname2 ]";
> 
> if ( /^[^\]]+ (?!rdns=(.*) helo=\1)/ ) {
>         print "got <$1>\n";
> }
> 
> $ test.pl
> got <>
> 
> That looks like it works, but it produces the same results ("got <>")
> even when rdns and helo are the same, meaning that the test seems to
> err out in all cases.

To me it doesn't look at all like it works, given that it failed to
capture anything in $1.

It's really rather simple.  The test for equality can be done with just a
backreference, without lookahead:

    for ( ( 'rdns=AAA helo=AAA', 'rdns=BBB helo=AAA') ) {
        print "got <$1>\n" if /rdns=(.*) helo=\1/;
    }   

That reports "AAA", the case where both are equal.  Now turn the sense
of the test around, wrapping the backreference in a negative lookahead:

    for ( ( 'rdns=AAA helo=AAA', 'rdns=BBB helo=AAA') ) {
        print "got <$1>\n" if /rdns=(.*) helo=(?!\1)/;
    }   

Now it reports "BBB".  That's it.

Anno


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

Date: Fri, 04 Mar 2005 23:28:48 GMT
From: Jazeker <jazeker_b_nospamlalala@yahoo.co.uk>
Subject: Re: perl null value ?
Message-Id: <Qa6Wd.29250$rb5.3016794@phobos.telenet-ops.be>

Alexandre Jaquet wrote:
> Hi how can make a test if ($var ne null) { print "not null"; } when I'm 
> doing that I got the following error msg :
> 
> bareword "NULL" not allowed while "strict subs" in use at
> 
> thx in advance

in Perl, the undefined value 'undef' approaches the classical null the 
best.  So check with if (defined($something))

-- 
print <<EOF;
   Just a noobish Perl hacker
EOF


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

Date: Fri, 4 Mar 2005 20:06:35 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl null value ?
Message-Id: <slrnd2i51b.8ne.tadmc@magna.augustmail.com>

Alexandre Jaquet <alexj@floor.ch> wrote:

> Subject: Re: perl null value ?


Perl does not have a null value, so you will need to tell us
what you mean when you say null value...


> Hi how can make a test if ($var ne null) { print "not null"; } when I'm 
> doing that I got the following error msg :
> 
> bareword "NULL" not allowed while "strict subs" in use at


"bareword" means unquoted.

You should put quotes around your strings:

   if ($var ne 'null') { print "not null"; }


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


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

Date: 05 Mar 2005 00:11:47 GMT
From: John Oliver <joliver@john-oliver.net>
Subject: Problem installing MIME:Tools
Message-Id: <slrnd2hu9s.eaq.joliver@ns.sdsitehosting.net>

I want to install MIMEDefang, which requires MIME::Tools.  I used CPAN
to add MIME::Tools.  There were some other dependencies which it chased
down, and after a whole bunch of stuff scrolled past, I wound up with:

Running make for D/DS/DSKOLL/MIME-tools-5.417.tar.gz
  Is already unwrapped into directory /root/.cpan/build/MIME-tools-5.417

  CPAN.pm: Going to build D/DS/DSKOLL/MIME-tools-5.417.tar.gz

cp lib/MIME/Body.pm blib/lib/MIME/Body.pm
cp lib/MIME/Decoder/Gzip64.pm blib/lib/MIME/Decoder/Gzip64.pm
cp lib/MIME/Field/ContDisp.pm blib/lib/MIME/Field/ContDisp.pm
cp set-version.pl blib/lib/set-version.pl
cp lib/MIME/Parser/Results.pm blib/lib/MIME/Parser/Results.pm
cp lib/MIME/Field/ContType.pm blib/lib/MIME/Field/ContType.pm
cp lib/MIME/Decoder/NBit.pm blib/lib/MIME/Decoder/NBit.pm
cp lib/MIME/Entity.pm blib/lib/MIME/Entity.pm
cp lib/MIME/Head.pm blib/lib/MIME/Head.pm
cp lib/MIME/Parser/Filer.pm blib/lib/MIME/Parser/Filer.pm
cp lib/MIME/Words.pm blib/lib/MIME/Words.pm
cp lib/MIME/Field/ParamVal.pm blib/lib/MIME/Field/ParamVal.pm
cp lib/MIME/Decoder/BinHex.pm blib/lib/MIME/Decoder/BinHex.pm
cp lib/MIME/Tools.pm blib/lib/MIME/Tools.pm
cp lib/MIME/Field/ConTraEnc.pm blib/lib/MIME/Field/ConTraEnc.pm
cp lib/MIME/Decoder/Binary.pm blib/lib/MIME/Decoder/Binary.pm
cp lib/MIME/Decoder.pm blib/lib/MIME/Decoder.pm
cp lib/MIME/Decoder/UU.pm blib/lib/MIME/Decoder/UU.pm
cp lib/MIME/Decoder/QuotedPrint.pm blib/lib/MIME/Decoder/QuotedPrint.pm
cp lib/MIME/Decoder/Base64.pm blib/lib/MIME/Decoder/Base64.pm
cp lib/MIME/WordDecoder.pm blib/lib/MIME/WordDecoder.pm
cp lib/MIME/Parser.pm blib/lib/MIME/Parser.pm
cp lib/MIME/Parser/Reader.pm blib/lib/MIME/Parser/Reader.pm
Manifying blib/man3/MIME::Decoder::Gzip64.3pm
Manifying blib/man3/MIME::Body.3pm
Manifying blib/man3/MIME::Field::ContDisp.3pm
Manifying blib/man3/MIME::Parser::Results.3pm
Manifying blib/man3/MIME::Field::ContType.3pm
Manifying blib/man3/MIME::Decoder::NBit.3pm
Manifying blib/man3/MIME::Entity.3pm
Manifying blib/man3/MIME::Parser::Filer.3pm
Manifying blib/man3/MIME::Head.3pm
Manifying blib/man3/MIME::Words.3pm
Manifying blib/man3/MIME::Field::ParamVal.3pm
Manifying blib/man3/MIME::Decoder::BinHex.3pm
Manifying blib/man3/MIME::Tools.3pm
Manifying blib/man3/MIME::Field::ConTraEnc.3pm
Manifying blib/man3/MIME::Decoder::Binary.3pm
Manifying blib/man3/MIME::Decoder.3pm
Manifying blib/man3/MIME::Decoder::UU.3pm
Manifying blib/man3/MIME::Decoder::Base64.3pm
Manifying blib/man3/MIME::Decoder::QuotedPrint.3pm
Manifying blib/man3/MIME::WordDecoder.3pm
Manifying blib/man3/MIME::Parser::Reader.3pm
Manifying blib/man3/MIME::Parser.3pm
  /usr/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Body...........ok
t/Decoder........ok
t/Entity.........ok
t/Gauntlet.......ok
t/Head...........ok
t/Misc...........FAILED tests 4-5, 7-11
        Failed 7/14 tests, 50.00% okay
t/Parser.........ok
t/Ref............ok
t/WordDecoder....ok
t/Words..........ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/Misc.t                  14    7  50.00%  4-5 7-11
Failed 1/10 test scripts, 90.00% okay. 7/231 subtests failed, 96.97%
okay.
make: *** [test_dynamic] Error 255
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force


How can I make it pass this test?

-- 
* John Oliver                              http://www.john-oliver.net/ *
* California gun owners - protect your rights and join the CRPA today! *
* http://www.crpa.org/         Free 3 month trial membership available *
* San Diego shooters come to http://groups.yahoo.com/group/sdshooting/ *


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

Date: Sat, 05 Mar 2005 04:20:11 +0000
From: Andrew Tkachenko <pobugfix@peterlink.ru>
Subject: Re: Problem installing MIME:Tools
Message-Id: <d0b1k4$2iv$2@news.rol.ru>

John Oliver wrote on 5 Март 2005 00:11:

> I want to install MIMEDefang, which requires MIME::Tools.  I used CPAN
> to add MIME::Tools.  There were some other dependencies which it chased
> down, and after a whole bunch of stuff scrolled past, I wound up with:
> 
> Running make for D/DS/DSKOLL/MIME-tools-5.417.tar.gz
>   Is already unwrapped into directory /root/.cpan/build/MIME-tools-5.417
> 
>   CPAN.pm: Going to build D/DS/DSKOLL/MIME-tools-5.417.tar.gz
> 
> cp lib/MIME/Body.pm blib/lib/MIME/Body.pm
> cp lib/MIME/Decoder/Gzip64.pm blib/lib/MIME/Decoder/Gzip64.pm
> cp lib/MIME/Field/ContDisp.pm blib/lib/MIME/Field/ContDisp.pm
> cp set-version.pl blib/lib/set-version.pl
> cp lib/MIME/Parser/Results.pm blib/lib/MIME/Parser/Results.pm
> cp lib/MIME/Field/ContType.pm blib/lib/MIME/Field/ContType.pm
> cp lib/MIME/Decoder/NBit.pm blib/lib/MIME/Decoder/NBit.pm
> cp lib/MIME/Entity.pm blib/lib/MIME/Entity.pm
> cp lib/MIME/Head.pm blib/lib/MIME/Head.pm
> cp lib/MIME/Parser/Filer.pm blib/lib/MIME/Parser/Filer.pm
> cp lib/MIME/Words.pm blib/lib/MIME/Words.pm
> cp lib/MIME/Field/ParamVal.pm blib/lib/MIME/Field/ParamVal.pm
> cp lib/MIME/Decoder/BinHex.pm blib/lib/MIME/Decoder/BinHex.pm
> cp lib/MIME/Tools.pm blib/lib/MIME/Tools.pm
> cp lib/MIME/Field/ConTraEnc.pm blib/lib/MIME/Field/ConTraEnc.pm
> cp lib/MIME/Decoder/Binary.pm blib/lib/MIME/Decoder/Binary.pm
> cp lib/MIME/Decoder.pm blib/lib/MIME/Decoder.pm
> cp lib/MIME/Decoder/UU.pm blib/lib/MIME/Decoder/UU.pm
> cp lib/MIME/Decoder/QuotedPrint.pm blib/lib/MIME/Decoder/QuotedPrint.pm
> cp lib/MIME/Decoder/Base64.pm blib/lib/MIME/Decoder/Base64.pm
> cp lib/MIME/WordDecoder.pm blib/lib/MIME/WordDecoder.pm
> cp lib/MIME/Parser.pm blib/lib/MIME/Parser.pm
> cp lib/MIME/Parser/Reader.pm blib/lib/MIME/Parser/Reader.pm
> Manifying blib/man3/MIME::Decoder::Gzip64.3pm
> Manifying blib/man3/MIME::Body.3pm
> Manifying blib/man3/MIME::Field::ContDisp.3pm
> Manifying blib/man3/MIME::Parser::Results.3pm
> Manifying blib/man3/MIME::Field::ContType.3pm
> Manifying blib/man3/MIME::Decoder::NBit.3pm
> Manifying blib/man3/MIME::Entity.3pm
> Manifying blib/man3/MIME::Parser::Filer.3pm
> Manifying blib/man3/MIME::Head.3pm
> Manifying blib/man3/MIME::Words.3pm
> Manifying blib/man3/MIME::Field::ParamVal.3pm
> Manifying blib/man3/MIME::Decoder::BinHex.3pm
> Manifying blib/man3/MIME::Tools.3pm
> Manifying blib/man3/MIME::Field::ConTraEnc.3pm
> Manifying blib/man3/MIME::Decoder::Binary.3pm
> Manifying blib/man3/MIME::Decoder.3pm
> Manifying blib/man3/MIME::Decoder::UU.3pm
> Manifying blib/man3/MIME::Decoder::Base64.3pm
> Manifying blib/man3/MIME::Decoder::QuotedPrint.3pm
> Manifying blib/man3/MIME::WordDecoder.3pm
> Manifying blib/man3/MIME::Parser::Reader.3pm
> Manifying blib/man3/MIME::Parser.3pm
>   /usr/bin/make  -- OK
> Running make test
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/Body...........ok
> t/Decoder........ok
> t/Entity.........ok
> t/Gauntlet.......ok
> t/Head...........ok
> t/Misc...........FAILED tests 4-5, 7-11
>         Failed 7/14 tests, 50.00% okay
> t/Parser.........ok
> t/Ref............ok
> t/WordDecoder....ok
> t/Words..........ok
> Failed Test Stat Wstat Total Fail  Failed  List of Failed
>
-------------------------------------------------------------------------------
> t/Misc.t                  14    7  50.00%  4-5 7-11
> Failed 1/10 test scripts, 90.00% okay. 7/231 subtests failed, 96.97%
> okay.
> make: *** [test_dynamic] Error 255
>   /usr/bin/make test -- NOT OK
> Running make install
>   make test had returned bad status, won't install without force
> 
> 
> How can I make it pass this test?
> 

try to 'force' it if you are sure that the reason of test failure does not
matter.

force install MIME::Tools

-- 
Andrew


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

Date: 05 Mar 2005 02:20:09 GMT
From: John Oliver <joliver@john-oliver.net>
Subject: Re: Problem installing MIME:Tools
Message-Id: <slrnd2i5qi.pkq.joliver@ns.sdsitehosting.net>

On Sat, 05 Mar 2005 04:20:11 +0000, Andrew Tkachenko wrote:
> try to 'force' it if you are sure that the reason of test failure does not
> matter.
> 
> force install MIME::Tools

I *don't* know that the test failure "doesn't matter".  Maybe it's
something serious.  Who knows?  That's what I'm trying to find out...
what is it unhappy about?

-- 
* John Oliver                              http://www.john-oliver.net/ *
* California gun owners - protect your rights and join the CRPA today! *
* http://www.crpa.org/         Free 3 month trial membership available *
* San Diego shooters come to http://groups.yahoo.com/group/sdshooting/ *


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

Date: Sat, 05 Mar 2005 01:57:58 +0000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Problem installing MIME:Tools
Message-Id: <422921be$0$30494$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

John Oliver wrote:
> On Sat, 05 Mar 2005 04:20:11 +0000, Andrew Tkachenko wrote:
> 
>>try to 'force' it if you are sure that the reason of test failure does not
>>matter.
>>
>>force install MIME::Tools
> 
> 
> I *don't* know that the test failure "doesn't matter".  Maybe it's
> something serious.  Who knows?  That's what I'm trying to find out...
> what is it unhappy about?
> 

You'll have to take a look at t/Misc.t and try to work out what's 
happening from that. Also try running:

perl -Mblib t/Misc.t

That might produce more helpful output.

Most test scripts these days are written with the objective of making it 
easier for the author to write the script, rather than making it easier 
for the user to diagnose causes of failures .... so good luck :-)

Cheers,
Rob


-- 
To reply by email u have to take out the u in kalinaubears.



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

Date: 04 Mar 2005 23:38:23 GMT
From: Abigail <abigail@abigail.nl>
Subject: qx, Filter::Simple, and testing
Message-Id: <slrnd2hsbf.v9v.abigail@alexandra.abigail.nl>


I'm working on a module that uses source filtering, using Filter::Simple.
One of the things it does is replacing certain constructs inside double
quoted environments, like "", qq {}, etc. Testing "", s///, m//, qq{}
is fairly straightforward. 

I'm looking for ideas on how to test qx{} (and ``). It should work on
any platform Perl works on, and it should be safe.

I looked into the t/ directory, but didn't see a place where qx gets
tested.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: 5 Mar 2005 00:20:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: qx, Filter::Simple, and testing
Message-Id: <d0au0t$dkk$1@mamenchi.zrz.TU-Berlin.DE>

Abigail  <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> 
> I'm working on a module that uses source filtering, using Filter::Simple.
> One of the things it does is replacing certain constructs inside double
> quoted environments, like "", qq {}, etc. Testing "", s///, m//, qq{}
> is fairly straightforward. 
> 
> I'm looking for ideas on how to test qx{} (and ``). It should work on
> any platform Perl works on, and it should be safe.

So you want something that can be safely executed on every system that
runs Perl (whatever "execute" means on that system).  Is that what you're
getting at?  If not, apologies.

Could the filter action be tested without actually executing the result?
Otherwise, I only see the straight-and-narrow way:  Build a hash of
command strings keyed by $^O.

Anno


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

Date: Sat, 05 Mar 2005 04:15:23 +0000
From: Andrew Tkachenko <pobugfix@peterlink.ru>
Subject: SOAP::Lite +wsdl
Message-Id: <d0b1b4$2iv$1@news.rol.ru>

Hello.

I'm using combination of Apache + mod_perl + Apache::SOAP from SOAP::Lite
distribution.

I'm trying to understand process of object creation on server side while
using WSDL.

For example, I have service 'Hello', represented by module Hello.pm on
server side. I want to call Hello's constructor, passing some data as its
arguments and use it in subsequent calls. But after reading SOAP::Lite pod
doc., I still can't find the way of creating Hello object. All the samples
I've found demonstrate how to make service calls described by WSDL in
non-OO way, i.e.

 use SOAP::Lite;
         print SOAP::Lite
           -> service(’http://www.xmethods.net/sd/StockQuoteService.wsdl’)
           -> getQuote(’MSFT’);

But how can I call getQuote as object method rather than class one ?
Any help would be greatly appreciated.



-- 
Andrew


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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