[23103] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5324 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 6 18:05:53 2003

Date: Wed, 6 Aug 2003 15: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           Wed, 6 Aug 2003     Volume: 10 Number: 5324

Today's topics:
    Re: $name getting changed to $_ (Brian)
    Re: [regex] Can't get it to be ungreedy <jane.doe@acme.com>
    Re: Brand New to Perl <syscjm@gwu.edu>
    Re: ccperl Mailing (Bob)
    Re: CGI and browser cahce <asu1@c-o-r-n-e-l-l.edu>
    Re: Convert UFT-8 to unicode? <tzz@lifelogs.com>
    Re: Cplex hangs in Perl system command (Wei)
    Re: DBD::ODBC with UnixODBC error... <mgarrish@rogers.com>
    Re: Final "Flocking" Script <mpapec@yahoo.com>
    Re: Final "Flocking" Script <grazz@pobox.com>
    Re: Final "Flocking" Script <nobull@mail.com>
    Re: Final "Flocking" Script ctcgag@hotmail.com
    Re: Final "Flocking" Script ctcgag@hotmail.com
    Re: Final "Flocking" Script <grazz@pobox.com>
        How do I modify version number in XML doc - path to pas (Sherman Willden)
        Net-Whois-IP-0.35 returning incorrect responses? <syl@alcor.concordia.ca>
        Newbie Question re: windmail & subscribe lite somewherefarfaraway@someday.com
    Re: perl  DBI <mgarrish@rogers.com>
    Re: Perl Math Syntax (remove the obvious)
    Re: Problems with flock() ctcgag@hotmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 6 Aug 2003 13:16:02 -0700
From: die2self@yahoo.com (Brian)
Subject: Re: $name getting changed to $_
Message-Id: <509f2711.0308061216.7cf01b60@posting.google.com>

Thanks Japhy - you fixed my problems yet again - and thanks for the
great explaination.
Thanks Tina for simplifying my code.


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

Date: Wed, 06 Aug 2003 23:49:22 +0200
From: Jane Doe <jane.doe@acme.com>
Subject: Re: [regex] Can't get it to be ungreedy
Message-Id: <cst2jv84d5m92paikh5oaeikssils8n2kq@4ax.com>

On Tue, 5 Aug 2003 20:44:16 -0400, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
>Are you trying to rewrite the code for filtering, or are you just trying to
>add a regex to a filter file?

Adding an entry in the filter file :-)

>
>Also, if you are just trying to write a line for your filter file, is there
>any reason you need to remove the full <tr>...</tr> section?

Yes, I want to remove a line from a table. Hence the need to locate a
whole <tr><td></td></tr> with a specific pattern somewhere inside a
line.

Thx :-)
JD.


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

Date: Wed, 06 Aug 2003 12:07:55 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: Brand New to Perl
Message-Id: <3F3127DB.4010605@gwu.edu>

Tassilo v. Parseval wrote:
> Also sprach Uri Guttman:
> 
> 
>>>>>>>"n" == noone  <local@localhost.localdomain> writes:
>>>>>>
>> >> Please avoid Matt Wright's free programs.  For more information,
>> >> see http://nms-cgi.sourceforge.net/
>>
>> n> Forgive my ignorance, but why not?  Is he just a moron or what?
>>
>>yes. and yes. and yes again.
> 
> 
> Please, Uri, think before you write (usually you do but you missed it
> here:-). I'd like to point out that just releasing some questionable
> code wont automatically make someone a moron. Matt's code just happens
> to be very old code from Perl4 days with some serious holes in it. He'd
> be a moron if he nowadays still promoted using his code. But he doesn't.

But he does.  It continues to be available for download from his website.

> Instead he even directs people to the nms-project.
> 

No, he doesn't.  He provides a link to nms.  At the bottom of his page,
where it's sure to be easy to miss.  He makes no recommendation that
their scripts are better to use than all those scripts more noticeably
listed above that link.

Any engineer knows you don't just tell people to do the right thing,
you make it difficult (or impossible, if you really mean it) to do
the wrong thing.  Why, then, is Matt continuing to make it easy for
people to get what he *knows* are bad scripts?

                  Chris Mattern



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

Date: 6 Aug 2003 11:38:29 -0700
From: galena1@verizon.net (Bob)
Subject: Re: ccperl Mailing
Message-Id: <a358898d.0308061038.6cfcca0e@posting.google.com>

galena1@verizon.net (Bob) wrote in message  
> I would not pass quite so harsh a judgment on ccperl, it is adequate
> for most jobs, and some govt. shops prohibit any opensource or
> freeware addons.

clarification: those "opensource or freeware addons" *not* shipping
with the OEM product are sometimes prohibited.

~Bob


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

Date: 6 Aug 2003 15:29:05 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: CGI and browser cahce
Message-Id: <Xns93CF74D515ABCasu1cornelledu@132.236.56.8>

Sascha Möllering <SaschaMoe@web.de> wrote in news:bgqpkv$mkv$04$1@news.t-
online.com:

> Hi,
> 
> I've a problem: 

Your main problem is asking a question that has nothing to do with Perl. You 
should try comp.infosystems.www.authoring.cgi.

By the way, there is also something called google, in case you have never 
heard of it. http://www.mnot.net/cache_docs/#CONTROL might be helpful.

-- 
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov


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

Date: Wed, 06 Aug 2003 12:06:29 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Convert UFT-8 to unicode?
Message-Id: <4nvftaixdm.fsf@lockgroove.bwh.harvard.edu>

On Wed, 06 Aug 2003, schmidt.2002@gmx.de wrote:
> my CGI script receives UTF-8 strings, like "0xE2 0x82 0xAC" for the
> Euro symbol.
> 
> However, the unicode for this symbol is 0x20AC.
> 
> How can I convert from UTF-8 to Unicode?
> 
> I'd like to do sth like:
> 
> if( $str =~ m/\x{20AC}/ ){
> 	print "used euro";
>}
> 
> but first, I have to convert "0xE2 0x82 0xAC" to Unicode, of
> course...

Start with "perldoc utf8" and "perldoc perlunicode."  That will
probably do a large chunk of what you need.

The detailed answer depends a *lot* on your Perl version, your goals,
and your Unicode programming experience.  You can also check CPAN for
UTF-8 modules that may be helpful:

http://search.cpan.org/search?query=UTF-8&mode=all

Ted


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

Date: 6 Aug 2003 12:21:41 -0700
From: wei_zhao2000@hotmail.com (Wei)
Subject: Re: Cplex hangs in Perl system command
Message-Id: <2673a9d5.0308061121.60cd01a4@posting.google.com>

Yeah, I checked all the return status value after each cplex call 
(since I used their sample as a start point of my code), and I didn't 
see any error message. 

But I didn't use try-catch block as it's not supported in C. And I 
didn't see any exception is thrown from my C program, it just hungs. 

Maybe it's a bug in cplex. 
Anyway, I got my program working now.  

Thanks a lot for your advice and have a good day,

Wei

"Paul A. Rubin" <rubin@msu.edu> wrote in message news:<Xns93CEB96406E0Dquantoid@35.8.2.20>...
> wei_zhao2000@hotmail.com (Wei) wrote in
> news:2673a9d5.0308051402.18ff70b@posting.google.com: 
> 
> > Although I fixed the problem, I think it's also an issue in cplex 
> > itself, because it didn't show any error message for the missing 
> > input file.
> > 
> 
> CPLEX callable library routines (and Concert technology) will *never* 
> display an error message, as far as I know.  If they encounter a problem 
> they are programmed to recognize, they will usually let you now by 
> returning a nonzero status value.  So you need to be fairly diligent about 
> capturing the integer return code from a library routine (or calling the 
> getStatus() or getCplexStatus() member function using Concert) and making 
> sure it's not telling you something's wrong.
> 
> When CPLEX hits a problem it's not programmed to handle through a return 
> value, it will typically throw an exception.  So you can surround the calls 
> by try{} blocks, catch(...){} the results and look for exceptions (if you 
> have reason to fear any).
> 
> Or are you saying that a CPLEX routine hung without returning a status 
> value and without throwing an exception?  *That* would be a CPLEX bug.
> 
> -- Paul


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

Date: Tue, 5 Aug 2003 16:31:23 -0400
From: "Matt Garrish" <mgarrish@rogers.com>
Subject: Re: DBD::ODBC with UnixODBC error...
Message-Id: <3f30147d.0@proxy.dvgd.mps>


"Andrew Burton" <tuglyraisin@aol.commcast> wrote in message
news:20030805121841.14640.00001627@mb-m02.aol.com...
> Writing Makefile for DBD::ODBC
>
> The DBD::ODBC tests will use these values for the database connection:
>     DBI_DSN=    e.g. dbi:ODBC:demo
>     DBI_USER=
>     DBI_PASS=
> Warning: not all required environment variables are set.
>

Did you read the readme before compiling?
(http://search.cpan.org/src/JURL/DBD-ODBC-1.06/README)

Matt




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

Date: Wed, 06 Aug 2003 18:51:24 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: Final "Flocking" Script
Message-Id: <efc2jv8mheq0iod951gikj2af81riuvhqa@4ax.com>

X-Ftn-To: Steve Grazzini 

Steve Grazzini <grazz@pobox.com> wrote:
>The problem would occur when another process writes to the 
>file between the append-open() and the flock().  This could 
>invalidate your seek pointer -- i.e.  you're prepared to write
>at the end of the file, and the end of the file *moves* so 
>you end up writing in the wrong place.
>
>This only applies to appending, though, and the FAQ suggests
>that it only applies to Windows.  Maybe somebody can list some

You mean faq from perldoc or some other faq?
It seems that under Linux you can freely change $file while script sleeps,


  open FH, "+>>$file" or die $!;
sleep 20;
  flock(FH, 2); #exclusive_lock
  print FH "writing to EOF\n";


-- 
Matija


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

Date: Wed, 06 Aug 2003 17:19:57 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Final "Flocking" Script
Message-Id: <1NaYa.15072$mZ6.4443@nwrdny02.gnilink.net>

Matija Papec <mpapec@yahoo.com> wrote:
> Steve Grazzini <grazz@pobox.com> wrote:
> >The problem would occur when another process writes to the 
> >file between the append-open() and the flock().
> >
> >This only applies to appending, though, and the FAQ suggests
> >that it only applies to Windows.
> 
> You mean faq from perldoc or some other faq?

The Perl FAQ.

    % perldoc -q "do i still have to use locking"

I was referring to this:

    If you know you are only going to use a system that does
    correctly implement appending (i.e. not Win32) then you 
    can omit the seek() from the above code.

-- 
Steve


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

Date: 06 Aug 2003 18:16:38 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Final "Flocking" Script
Message-Id: <u9ekzy4sg9.fsf@wcl-l.bham.ac.uk>

Matija Papec <mpapec@yahoo.com> writes:

> X-Ftn-To: Steve Grazzini 
> 
> Steve Grazzini <grazz@pobox.com> wrote:
> >The problem would occur when another process writes to the 
> >file between the append-open() and the flock().  This could 
> >invalidate your seek pointer -- i.e.  you're prepared to write
> >at the end of the file, and the end of the file *moves* so 
> >you end up writing in the wrong place.

Unless, of course, you are not using an OS that doesn't correctly
implement append-open().

Or, to put it another way (wihtout the tripple negative)...

Only if your OS has broken append-open.

> >
> >This only applies to appending, though, and the FAQ suggests
> >that it only applies to Windows. 

I don't know if it _only_ applies to Windows but it doesn't apply on
OSs with working append-open.

I must admit I'd thought 5.8 was going to have a work-round for this bug
by putting an a seek-to-end before each write to a filehandle opened
for append on Windows.  Guess it never made it.

> It seems that under Linux you can freely change $file while script sleeps,

You can but it doesn't matter, because append-open isn't broken on Linux.

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


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

Date: 06 Aug 2003 20:06:20 GMT
From: ctcgag@hotmail.com
Subject: Re: Final "Flocking" Script
Message-Id: <20030806160620.383$kr@newsreader.com>

Steve Grazzini <grazz@pobox.com> wrote:
>
> Either Way: it doesn't affect our OP.  His race condition is
> even simpler.
>
> Here's some code to spawn a number of processes, each of which
> will increment a "counter" in a text file.  The parent process
> waits for the kids to finish and compares the number in the
> file with the expected (if we didn't know better) result.
>
>     [ error-checking omitted ]

Which kind of screwed my up, because you don't
use Fcntl ':flock';
so the flock was silently failing.  Even after I "fixed" the
race, it was still given bad results.  Teach me not to add the -w
for these quick and dirty scripts.


>
>     % cat -n race.pl
>      1  my ($procs, $loops) = @ARGV;
>      2  my $file = 'counter.race';
>      3
>      4  system qq{ echo 0 > $file };
>      5
>      6  for (1..$procs) {
>      7      next if fork;
>      8      for (1..$loops) {
>      9          open FH, '<', $file;
>     10          flock(FH, LOCK_EX);
>     11          my $count = <FH>;
>     12          close FH;
>     13
>     14          open FH, '>', $file;
>     15          flock(FH, LOCK_EX);
>     16          print FH $count+1, "\n";
>     17          close FH;
>     18      }
>     19      exit;
>     20  }
>     21
>     22  1 until wait == -1;
>     23  printf "%d/%s", $procs * $loops, qx{ cat $file };
>
>     % race.pl 2 10
>     20/20
>     % race.pl 5 100
>     500/332
>     % race.pl 10 1000
>     10000/1384
>
> The most obvious problem occurs when another process comes
> along while we're between lines 15 and 16.  Since we've truncated
> the file but not yet locked it, the other process will see the
> empty file.  This has the effect of resetting the counter...
>
> So the entire read-calculate-write sequence must be protected
> by flock().  There's an example in the FAQ
>
>     % perldoc -q "I still don't get locking"
>
> That shows you how to do that with a read/write open().  You
> could also lock a second file (a "semaphore" file) instead of
> locking the data file itself.  The nice thing about that
> approach is that you don't have to do the awkward seek() and
> truncate() on the data file.

You can use the file as it's own semaphore, by changing the file
handle name in the second open, and keeping the file handle from
the first open around:

use Fcntl ':flock';
my ($procs, $loops) = @ARGV;
my $file = 'counter.race';


system qq{ echo 0 > $file };

for (1..$procs) {
    next if fork;
    for (1..$loops) {
        open FH, '<', $file or die $!;
        flock(FH, LOCK_EX) or die $!;
        my $count = <FH>;

        open FH2, '>', $file or die $!;
        # No need to lock here, FH is still holding the lock
        # in this process
        print FH2 $count+1, "\n";
        close FH2 or die $!;
        close FH or die $!;
    }
    exit;
}

1 until wait == -1;
printf "%d/%s", $procs * $loops, qx{ cat $file };

__END__
$: perl -w usenet2.pl 20 1000
20000/20000


The only difficulty here (that I know of) is that if someone unlinks
the file between opens, then the second open will either create or open
a new file which isn't protected by FH's lock.  Of course, unlinking files
is going to hose you no matter what.


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: 06 Aug 2003 20:24:43 GMT
From: ctcgag@hotmail.com
Subject: Re: Final "Flocking" Script
Message-Id: <20030806162442.796$kG@newsreader.com>

"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> On Tue, Aug 5, Gunnar Hjalmarsson inscribed on the eternal scroll:
>
> > Tad McClellan wrote:
>
> > > And be sure to *remove it* for production!
> >
> > What makes you say that, Tad? The CGI::Carp docs suggests that the
> > carpout() routine shouldn't be used for production for *performance*
> > reasons, but I don't think there is such a comment as regards
> > fatalsToBrowser(). Or is there any other reason for your advise?
>
> I don't know Tad's motivation, but: it can expose details of the
> internals of your scripts to an intruder.  The same goes for exposing
> warnings within the browser window.

In my particular case, all the users of the scripts are inside our
firewall.  Any of those users could just walk into my office and shove
an icepick in my ear.  So if they've gone bad and are on the attack, CGI
scripts are the least of my worries. :)

Of course, I'm usually one of the major users of my own scripts, so
at least part of the time that the user gets a ugly error message, the
user is someone in a position to do something about it.


> Of course, it also gives an unprofessional impression if it happens to
> a bona fide user. Ideally you should cover all known failure modes at
> development time, and supply user-friendly responses for them, rather
> than exposing the end-users to what are _supposed_ to be your internal
> diagnostics.

I've had a group decide that the error messages looked unprofessional.
But they weren't willing to spend the time making user-friendly responses,
so instead they just yanked the fatalsToBrowser, and let the scripts
die silently.  No ugly error messages anymore, just pretty half-rendered
web pages with no clue as to what is wrong.  The veneer of professionalism,
without the substance.  It just boggled my mind.

>
> But indeed, during development these features can be _very_ useful.

Yes, and everything I do is always in development. :)

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: Wed, 06 Aug 2003 20:47:00 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Final "Flocking" Script
Message-Id: <8PdYa.15954$mZ6.4142@nwrdny02.gnilink.net>

ctcgag@hotmail.com wrote:
> Steve Grazzini <grazz@pobox.com> wrote:
>>
>>     [ error-checking omitted ]
> 
> Which kind of screwed my up, because you don't
> use Fcntl ':flock';

Sigh.

I actually ran it that way and didn't notice -- demonstrating
either that the OP's flock() didn't do anything useful, or that
I'm a careless fool, or very possibly: both.

-- 
Steve



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

Date: 6 Aug 2003 12:23:16 -0700
From: sherman.willden@hp.com (Sherman Willden)
Subject: How do I modify version number in XML doc - path to pass to Twig?
Message-Id: <3a80d8d6.0308061123.5bff30a4@posting.google.com>

I am trying to use Perl's XML::Twig to modify a version number in an
XML document. At the very end of this posting is an excerpt from the
xml document. Just before the xml excerpt is the Perl code I am trying
to use. The Xpath part of the script functions well.

I think I need help determining the @field entry. I have tried
//property[\@name='version']/string, version/string, and string. I get
a "Can't modify non-lvalue subroutine call at C:\business
copy\xml_try_scripts\try_xpath.pl line 26." Error which I think is
caused by $field[] being null.

Any ideas about what the @field value should be?

Thanks;

Sherman

#!/usr/bin/perl -w

use strict;
use XML::XPath;
use XML::XPath::XMLParser;
use XML::Twig;

# create an object to parse the file and field XPath queries
# my $xpath = XML::XPath->new( filename => shift @ARGV );
my $xpath = XML::XPath->new( filename => "Product.iap_xml" );

# apply the path from the command line and get back a list matches
my $field;
my @field = "string";

my $old_value = $xpath->find(
"//property[\@name='version']/string/text()" );
## $old_value returns 2.20.0.0
# print each node in the list
# foreach my $node ( $old_value->get_nodelist ) {
#  print XML::XPath::XMLParser::as_string( $node ) . "\n";
#}

my $new_value = 2.20.0.12;
my $t = new XML::Twig( TwigRoots =>
                      { $field[string() = $old_value] => \&update },
                      TwigPrintOutsideRoots => 1,);
$t->parsefile( 'BC_HA.iap_xml' );
$t->flush;

sub update
{
    my( $t, $field_elt)= @_;
    $field_elt->set_text( $new_value);
    $field_elt->print;
} 
## End of perl script and start of XML document

<?xml version="1.0" encoding="UTF-8"?>
Some comment stuff removed
<InstallAnywhere_Deployment_Project increments="nnnn">
	<essentialScriptInfo>
		<versionID major="n" minor="n" revision="-1"/>
		<editionID> lots of numbers removed </editionID>
		<scriptID> lots of numbers removed </scriptID>
		<buildID> lots of numbers removed </buildID>
		<authorizationID>lots of numbers removed</authorizationID>
	</essentialScriptInfo>
	<installationObjects uniqueObjects="307">
		<object class="com.zerog.ia.installer.Installer" objectID="some
numbers removed">
			<property name="classpath">
				<object class="java.util.Vector"/>
			</property>
lots of stuff removed
                        <property name="RPMSpec">
				<object class="com.zerog.ia.installer.RPMSpec" objectID="some
numbers removed">
					<property name="enabled">
						<boolean>true</boolean>
					</property>
					<property name="name">
						<string><![CDATA[Our Product 2.2 Product Sub Name]]></string>
					</property>
					<property name="version">
						<string><![CDATA[2.20.0.0]]></string>
					</property>
					<property name="release">
						<string><![CDATA[2.20.0.0]]></string>
					</property>
					<property name="description">
						<string><![CDATA[]]></string>
					</property>
					<property name="summary">
						<string><![CDATA[<none>]]></string>
					</property>
					<property name="copyright">
						<string><![CDATA[2003]]></string>
					</property>
					<property name="url">
						<string><![CDATA[http://www.this.com]]></string>
					</property>
					<property name="distribution">
						<string><![CDATA[<none>]]></string>
					</property>
					<property name="vendor">
						<string><![CDATA[HP]]></string>
					</property>
					<property name="group">
						<string><![CDATA[Applications/System]]></string>
					</property>
					<property name="packager">
						<string><![CDATA[]]></string>
					</property>
				</object>
			</property>
			<property name="buildSettings">
				<object class="java.util.Properties">

Lots of stuff to end of doucument removed


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

Date: 6 Aug 2003 21:21:25 GMT
From: Sylvain Robitaille <syl@alcor.concordia.ca>
Subject: Net-Whois-IP-0.35 returning incorrect responses?
Message-Id: <slrnbj2sal.4o7v.syl@alcor.concordia.ca>

I'm trying to write a Perl script which will (among other things) look
up the Whois information, based on an IP address it encounters, but the
responses I'm getting from Net-Whois-IP-0.35 are not what I'm expecting,
(though I suppose they're technically correct).

Please consider the following test case:

cat -n src/whois_test.pl
     1	#!/local/pkg/perl/root-perl-5.8.0/bin/perl -wT
     2	#
     3	# For looking up Whois info:
     4	use Net::Whois::IP qw(whoisip_query);
     5	
     6	my $whois_response = whoisip_query("132.205.7.51", "true");
     7	foreach (keys(%{$whois_response}) ) {
     8	   print "$_:";
     9	   foreach ( @{$whois_response->{$_}} ) {
    10	      print "  $_\n";
    11	   }
    12	}
    13	

Now I run the test program:
src/whois_test.pl
   OrgID:  VR-ARIN
   NetName:  NET132
   PostalCode:  20151
   NetType:  Early Registrations, Maintained by ARIN
   NetHandle:  NET-132-0-0-0-0
   Address:  3635 Concord Parkway, Suite 200
   RegDate:  1993-05-01
   Comment:   
   City:  Chantilly
   CIDR:  132.0.0.0/8 
   StateProv:  VA
   Updated:  2002-08-23
   Parent:   
   OrgName:  Various Registries (Maintained by ARIN) 
   Country:  US
   NameServer:  ARROWROOT.ARIN.NET
     BUCHU.ARIN.NET
     CHIA.ARIN.NET
     DILL.ARIN.NET
     EPAZOTE.ARIN.NET
     FIGWORT.ARIN.NET
     GINSENG.ARIN.NET
     HENNA.ARIN.NET
     INDIGO.ARIN.NET
   NetRange:  132.0.0.0 - 132.255.255.255 

However, if I run whois (whois-4.5.29) at the command line, to look up
the same IP address, I get the following response (which is what I
expect to see):

whois 132.205.7.51
    
    OrgName:    Concordia University 
    OrgID:      CONCOR-15
    Address:    1455 de Maisonneuve ouest
    City:       Montreal
    StateProv:  QC
    PostalCode: H3G 1M8
    Country:    CA
    
    NetRange:   132.205.0.0 - 132.205.255.255 
    CIDR:       132.205.0.0/16 
    NetName:    CONCORDIA
    NetHandle:  NET-132-205-0-0-1
    Parent:     NET-132-0-0-0-0
    NetType:    Direct Assignment
    NameServer: CLYDE.CONCORDIA.CA
    NameServer: ALCOR.CONCORDIA.CA
    NameServer: ZAURAK.CC.UMANITOBA.CA
    NameServer: NS4.SRV.CIS.PITT.EDU
    Comment:    
    RegDate:    1989-06-14
    Updated:    2003-03-04
    
    AbuseHandle: ABUSE217-ARIN
    AbuseName:   Abuse 
    AbusePhone:  +1-514-848-7600
    AbuseEmail:  abuse@concordia.ca 
    
    # ARIN WHOIS database, last updated 2003-08-05 19:15
    # Enter ? for additional hints on searching ARIN's WHOIS database.

Does anyone know how to get Net::Whois::IP to send back the response I'm
expecting, or should I simply call my command-line whois from the script
I'm writing?  (it would of course be much cleaner to use a Perl module
for this ...)

-- 
----------------------------------------------------------------------
Sylvain Robitaille                              syl@alcor.concordia.ca
 
Systems analyst                                   Concordia University
Instructional & Information Technology        Montreal, Quebec, Canada
----------------------------------------------------------------------


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

Date: Wed, 06 Aug 2003 21:24:00 GMT
From: somewherefarfaraway@someday.com
Subject: Newbie Question re: windmail & subscribe lite
Message-Id: <ffs2jv09cn2nhrib5bj2s60t0fr1om0m3m@4ax.com>

Does anyone know how to configure Sub lite to work with windmail.
I either get a no output screen or it hangs up. 
TIA for any help you can give
TBeagle


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

Date: Tue, 5 Aug 2003 17:52:45 -0400
From: "Matt Garrish" <mgarrish@rogers.com>
Subject: Re: perl  DBI
Message-Id: <3f30276e.0@proxy.dvgd.mps>


"sangeetha" <sangeetha_b@india.com> wrote in message
news:4fde56d3.0308050243.72336b6c@posting.google.com...
>
> Output Error message:
>
> DBI connect('test','root',...) failed: Can't connect to local MySQL
> server through socket '/tmp/mysql.sock' (2) at db.pl line 10
> Error opening database: Can't connect to local MySQL server through
> socket '/tmp/mysql.sock' (2)
>

Have you tried everything in the manual?
(http://www.mysql.com/doc/en/Can_not_connect_to_server.html)

Matt




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

Date: Wed, 06 Aug 2003 19:52:09 GMT
From: "--Rick" <no_trick@my-de(remove the obvious)ja.com>
Subject: Re: Perl Math Syntax
Message-Id: <J%cYa.90250$0v4.6109295@bgtnsc04-news.ops.worldnet.att.net>


"John W. Krahn" <krahnj@acm.org> wrote in message
news:3F2F59BD.A1D21C05@acm.org...
| \"Dandy\" Randy wrote:
| >
| > Needs some help getting a ... well ... pretty basic math script
working but
| > the solution eludes me .... I have a text file called opened.txt
 ... it
| > contains the following single line data:
| >
| > 2000|0|0
| >
| > What I am looking to do is when the script is run, I would like
the second
| > value to increase by 1 .... kind of like this:
|
| #!/usr/bin/perl -p
|
| BEGIN { ( $^I, @ARGV ) = ( '', 'opened.txt' ) }
| s/|(\d+)|/|@{[$1+1]}|/
|
| __END__
|

I couldn't figure out how this one was supposed to work, so I tried it
and couldn't really fix it.

This works though...

#!/usr/bin/perl -p

BEGIN { ( $^I, @ARGV ) = ( '.bak', 'opened.txt' ) }
s/\|(\d+)\|/"|" . ($1+1) . "|"/e;

__END__

Can you explain your version to me?  It looks like there is a lot
there I could learn.

--Rick





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

Date: 06 Aug 2003 21:22:19 GMT
From: ctcgag@hotmail.com
Subject: Re: Problems with flock()
Message-Id: <20030806172219.211$qO@newsreader.com>

"Rene Scheibe" <Rene.Scheibe@Stud.TU-Ilmenau.de> wrote:
> Hi,
>
> i have a problem with perls flock() or maybe
> it's another thing - i'll explane.
>
> i have a website with a form.
> the perl-cgi-script which is executed on send
> button increases a counter on the server at
> startup and decreases it at exit. (so i can
> setup max number of running instances.)
>
> if a user waits till results of script are
> displayed and makes its new requests always
> after this everything is fine.
> but if he makes many requests before the script
> is finished the counter isnt correctly decreased.
>
> i have no idea why this is like this.
> maybe you can tell me or make another suggestion
> for better instance counter implementation.


My guess is that Apache notices that the browser has stopped
listening, and it then clubs your cgi to death.  So your
script dies sometime after it increments the count but before
it decrements it.

I've heard rumors that Apache sends a SIGTERM, waits 3 seconds,
and then sends an (untrappable) SIGKILL.  So one approach would be to trap
SIGTERM and have it call (or cause to be called) the decrement command, and
hope it finishes in 3 seconds.

I think a better approach would be to use self-policing locks that
release automatically when the process holding them dies.  Something
like:

warn "Untested Code";
Lock: {
  foreach ('00'..'09') {
     open LOCK, ">/tmp/mylocks.$_" or die $!
     flock LOCK, LOCK_EX | LOCK_NB and last Lock;
  };
  die "Resource limit exceeded";
};
# Go on your merry way



Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

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


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