[13570] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 980 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 4 06:07:44 1999

Date: Mon, 4 Oct 1999 03: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)
Message-Id: <939031509-v9-i980@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 4 Oct 1999     Volume: 9 Number: 980

Today's topics:
        Bijeenkomst Amsterdam Perl Mongers, 5 Oktober 1999 johnpc@xs4.xs4all.nl
        DBI/CGI Problem (cmd line works, but webserver fails to (David Salgado)
    Re: Error log in Activsate? (Abigail)
        Force Perl to print? <mwatkins@promotion4free.com>
    Re: Force Perl to print? (Abigail)
    Re: Forum <sumengen@hotelspectra.com>
    Re: gcos/gecos (Chris Fedde)
    Re: How do I get this to work? (I.J. Garlick)
        Input/output from programs <paul.walkerNOpaSPAM@st.com.invalid>
    Re: LWP to request HTTP/1.1 <sumengen@hotelspectra.com>
    Re: Need a unique "ID" string (Chris Fedde)
    Re: Perl and Access problem(DBI/DBD) <rhardicr@mail.ford.com>
        perl and zipSlack (Marc)
    Re: perl and zipSlack <ltl@rgsun40.viasystems.com>
    Re: Perl vs. PHP3 <NukeEmUp@ThePentagon.com>
        Perl5.0/Perl4.0 <fyd@u-picardie.fr>
    Re: Regexp question <sumengen@hotelspectra.com>
    Re: Regexp question (Abigail)
        RFC::RFC822::Address. (Abigail)
    Re: Schnelle Bearbeitung von HTML-Seiten <rhomberg@ife.ee.ethz.ch>
        Sending to a port bolleh@my-deja.com
        Simple - yet won't work! <nihad@yahoo.com>
    Re: Simple - yet won't work! (Abigail)
    Re: Simple - yet won't work! (John Callender)
    Re: Simple - yet won't work! <syeates@manuka.cs.waikato.ac.nz>
    Re: Simple - yet won't work! (Abigail)
        Testing a String <marco.cerqui@alcatel.ch>
    Re: What is the best way to design for Client/Server ha <qumsieh@sympatico.ca>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 4 Oct 1999 11:35:52 +0200
From: johnpc@xs4.xs4all.nl
Subject: Bijeenkomst Amsterdam Perl Mongers, 5 Oktober 1999
Message-Id: <7t9sdo$ro1$1@xs4.xs4all.nl>

[English version follows the dutch text]

Amsterdam.pm staat voor de "Amsterdamse Perl Mongers", een groep van
gebruikers van Perl. In tegenstelling tot wat de naam suggereert is
Amsterdam.pm niet beperkt tot alleen Amsterdam, maar functioneert, tot
er meer gebruikersgroepen in Nederland zijn, als Nederlandse
gebruikersgroep.

Amsterdam.pm organiseert informele bijeenkomsten waar Perl gebruikers
kunnen samenkomen en informatie en gebruikservaringen met betrekking
tot Perl kunnen uitwisselen. Deze bijeenkomsten vinden normaliter
plaats op elke eerste dinsdag van de maand. De voertaal binnen
Amsterdam.pm is in pricipe Nederlands, maar indien nodig zal Engels
worden gebruikt, b.v. om te communiceren met niet-Nederlandssprekende
aanwezigen.

De eerstvolgende bijeenkomst vindt plaats op dinsdag 5 oktober 1999 van
20:00 tot 22:00 uur bij "De Digitale Stad", Prins Hendrikkade 192, Amsterdam.

Liefhebbers van een etentje vooraf kunnen tussen 17:45 en 18:15
verzamelen in café "The Zone", gevestigd in hetzelfde pand als "De
Digitale Stad". Om 18:15 (écht om 18:15!) zoeken we een restaurantje
in de buurt om een hapje te eten.

Bezoek onze Web site http://www.Amsterdam.pm.org voor meer details.

[English version]

Amsterdam.pm stands for the Amsterdam Perl Mongers. We're basically a
Perl user group. Despite its name, it is not local to the Amsterdam
environment, but it welcomes Perl mongers from all over the
Netherlands.

Amsterdam.pm organises informal meetings where Perl users can meet,
and exchange information and experiences with regard to using Perl.
The meetings are normally held every first Tuesday of the month.
Although the preferred language for communication is Dutch, English
will be spoken if necessary.

Our next meeting is Tuesday October 5th, 1999, from 20:00 till 22:00 at "De
Digitale Stad", Prins Hendrikkade 192, Amsterdam.

Should you want to join some of us for dinner, please gather between
17:45 and 18:15 in café "The Zone", in the same location as "De
Digitale Stad". At 18:15 sharp we'll leave for a restaurant somewhere
nearby for dinner.

See http://www.Amsterdam.pm.org for more details.

--
#!perl -pl      # This kenny-filter is virus-free as long as you don't copy it
$p=3-2*/[a-eg-lnoq-z]/i;s{([a-z]{$p})}{vec($f=($p-1?chr(sub{$_[0]*9+$_[1]*3+$_
[2]}->(split'',(($m=lc$1)=~tr/mpf/012/,$m))+97):join'',(qw(m p f))[map{((ord$1
)%32-1)/$_%3}(9,3,1)]),5,1)="a"le$1;$f}gie;                # Jan-Pieter Cornet


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

Date: Mon, 04 Oct 1999 09:46:52 GMT
From: david@connmed.co.nospam.uk (David Salgado)
Subject: DBI/CGI Problem (cmd line works, but webserver fails to connect)
Message-Id: <37f8760a.6103606@news.demon.co.uk>

I have written a script that uses DBI and CGI to fetch data from an
Access 97 database.

When run from the command-line (perl myscript.pl), the script outputs
appropriate HTML with the data from the database.

However, when called as a web page, I get;

>CGI Error
>The specified CGI application misbehaved by not returning a 
>complete set of HTTP headers. The headers it did return are:
>
>DBI->connect failed: [Microsoft][ODBC Microsoft Access 97 Driver] 
>The Microsoft Jet database engine cannot open the file '(unknown)'.  
>It is already opened exclusively by another user, or you need permission 
>to view its data. (SQL-S1000)(DBD: db_login/SQLConnect err=-1) at E:\cmopsperl\list_callouts.pl line 13

>Can't call method "prepare" on an undefined value at E:\myscript.pl line 58.

Can anyone enlighten me about what's going on here?

The webserver is PWS (MS Personal web server), running on NT4.0 and
using ActivePerl (build 519).

I have several other scripts talking to another database perfectly
happily (both from the command line and the webserver). myscript.pl is
in the same directory as the other scripts, talking to a target
database which is in the same directory (local to the webserver
machine).

If I create a new, blank Access mdb file, and IMPORT the tables I want
(and reconfigure the SYSTEM DSN to point to that mdb file), everything
is fine. But that won't do, because the webserver is supposed to
provide another pathway into the data of a live system that other
users are manipulating using Access clients. If I try to LINK the
tables into a new mdb file, I get the same problem as before - cmd
line works fine, but webserver gives the same error.

I guess this is some kind of weird permissions thing working
differently from the Perl.exe as opposed to the DLL that the webserver
is using to execute the script. I've tried several combinations of
username/password from the ODBC driver, and using different SYSTEM.MDW
files, but I can't get the thing to work from the webserver if it's
looking at the same live data backend as the Access application.

I'd be grateful for any light anyone can throw on what is going on
here.

TIA

David




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

Date: 3 Oct 1999 23:39:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Error log in Activsate?
Message-Id: <slrn7vgccd.chn.abigail@alexandra.delanet.com>

Burt lewis (burt@ici.net) wrote on MMCCXXIV September MCMXCIII in
<URL:news:hgRJ3.2635$z5.42858@ndnws01.ne.mediaone.net>:
[] 
[] I can't seem to locate an error log. Is there one?


Not build in in Perl, no.

If you mean an error log for your whatever program, ask in a group
which discusses whatevers.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 04 Oct 1999 02:07:00 GMT
From: "Mike Watkins" <mwatkins@promotion4free.com>
Subject: Force Perl to print?
Message-Id: <8ZTJ3.15652$9f.229507@news1.rdc1.ab.home.com>

Hello there,

I was wondering, how do you force Perl to print something to the screen,
while it is completing the rest of it's process?  For example, I have a
script which could take say, 45 mins to complete.

What I'm trying to do is create a Perl script which, when started, will
print a temporary page to the screen saying "Currently processing, please
wait...", and have a meta refresh tag in the page so it refreshes to the
Perl script every 10 seconds.

Then every time the page is refreshed, the Perl script will check to see if
the process is done, if not the Perl script will print the temporary
refreshing page again.

I want to do this so the browser doesn't time out when the script is being
run, but the problem I'm having is that Perl doesn't want to print that
temporary page until it's completed the 45 mins of work it has.

Does anyone know how to force Perl to print that temporary page while the
script is doing the rest of the process?

Thanks,
Mike Watkins





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

Date: 3 Oct 1999 23:43:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Force Perl to print?
Message-Id: <slrn7vgci1.chn.abigail@alexandra.delanet.com>

Mike Watkins (mwatkins@promotion4free.com) wrote on MMCCXXV September
MCMXCIII in <URL:news:8ZTJ3.15652$9f.229507@news1.rdc1.ab.home.com>:
@@ 
@@ I want to do this so the browser doesn't time out when the script is being
@@ run, but the problem I'm having is that Perl doesn't want to print that
@@ temporary page until it's completed the 45 mins of work it has.

That is of course rubbish.

    $| = 1;  # Turn buffering off.
    print "Whatever";


Now, I doubt what you want to do is going to work, but that's a matter
of CGI, HTTP and browser issues, none of which are the topic of this
group. The Perl part has been answered.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 4 Oct 1999 00:08:14 -0700
From: "Baris Sumengen" <sumengen@hotelspectra.com>
Subject: Re: Forum
Message-Id: <7t9jpn$e21$1@bgtnsc02.worldnet.att.net>

www.ultrascripts.com
Baris.
<richard@softhome.net> wrote in message news:37F59F2D.6546@softhome.net...
> Hi Folks,
>
> I'm looking or a Forum script. The Forum must have the features: The
> webmaster/administrator must be in a position to delete unwanted
> postings by monitoring. Subjet, Date and time postings are coming in.
> etc,etc,
>
> Who has such a Forum for me or who knows a place where I can download a
> free one.
>
> Thanks in advance
>
> Richard




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

Date: Mon, 04 Oct 1999 06:04:17 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: gcos/gecos
Message-Id: <BrXJ3.442$ffd.190333440@news.frii.net>

In article <7t2sp9$r91$1@pegasus.csx.cam.ac.uk>,
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>Larry Rosler <lr@hpl.hp.com> wrote:
>>
>>alternative to the pachydermous Multics, on 16-bit DEC PDP-7 computers.  
>                    ^^^^^^^^^^^^
>Well, Multics always had to be pretty thick-skinned to survive all the
>insults thrown at it.
>
>But I don't remember the long grey trunk.
>
>Mike Guy

Way off topic but why should that stop me?

The long grey trunk fanned out under the raised floor in the computer
room and was routed behind the ceiling tiles all over the building.
We worked hard to hide it.  That's why you don't remember them :-)

Who remembers the 14 inch by 1/8th inch flat head screw driver required
to get connectors into the mux pannel on a DPS-6?

chris


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

Date: Mon, 4 Oct 1999 08:47:37 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: How do I get this to work?
Message-Id: <FJ2LrD.1Mn@csc.liv.ac.uk>

> Jordan DeLozier wrote:
>> if ($password =~ "$check") {
>> &dothis;
>> }
>> 
>> if someone has a password of "Login" and they put in "Loginnow" as their
>> password, it still thinks it is right. How can I make this script only 
> take
>> "Login" and not "Loginnow"? Exact Matches, not these type of things.
And in article <rv9s5bfu3i565@corp.supernews.com>,
Danh Dang <ddang@jhancock.com> jeopardis^Hzed:
> if ($password =~ /^$check$/)

Why use a regex?

	if ($password eq $check)

Less typing, and you don't have to remember to anchor the regex. Plus gut
feeling is it will be faster (although we are probably talking nearly
infinitesimal differences in time here).

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

You probably wouldn't worry about what people think of you if you could
know how seldom they do.
                -- Olin Miller.



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

Date: Mon, 04 Oct 1999 02:32:28 -0700
From: Paul Walker <paul.walkerNOpaSPAM@st.com.invalid>
Subject: Input/output from programs
Message-Id: <000b8d9b.40c2c099@usw-ex0101-005.remarq.com>

Hi,

(Hopefully) a nice simple question. :)

I'd like to be able to spawn/system/whatever a program from a perl
script, then both get input from it and write data to it (to control
what it's doing).

I've looked around, and books cover input from and output to, but not
both at the same time. Ideally I'd therefore use |program|, but I doubt
that would work. :)

Does anyone have any ideas, or at least something to point me in the
right direction?

Thanks,

Paul


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Sun, 3 Oct 1999 23:59:19 -0700
From: "Baris Sumengen" <sumengen@hotelspectra.com>
Subject: Re: LWP to request HTTP/1.1
Message-Id: <7t9j90$cfs$1@bgtnsc02.worldnet.att.net>

There is an alpha version to support HTTP/1.1.
Baris.

Ryan Ngi <ryanngi@hotmail.com> wrote in message
news:37f6621c.61321264@202.47.248.32...
> i'm using the latest version of LWP
> when i request HTTP
>
> LWP request only HTTP/1.0
>
> is there any way to force LWP to request HTTP/1.1 ???
>
>




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

Date: Mon, 04 Oct 1999 05:29:26 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Need a unique "ID" string
Message-Id: <WWWJ3.440$ffd.188923392@news.frii.net>

[cc'd original author and posted]

In article <7sik0c$9ou$1@winter.news.rcn.net>,
The Smiths <smiths@erols.com> wrote:
>I need to generate a unique numeric string that gets recorded each time my
>PERL cgi is invoked.
>
>I am currently using time() to do this, but in a high volume situation, I
>could easily wind up with duplicate ID numbers.
>
>Is there a better or even standard way to generate guaranteed unique IDs for
>each invocation of the CGI without using a counter file?
>
>How do "session" oriented web sites generate the session IDs found in
>cookies and query_strings?
>
>Thanks,
>Tim.
>
>

Good database design dictates that computed keys are derived from
a sequence.

Look at File::CounterFile from CPAN.  Then follow Abigail's
recomendation for the multi-host case.

    use Benchmark;
    use File::CounterFile;

    timethis(10000, q{
	my $c = File::CounterFile->new("foo", "0");
	$c->inc;
	}
    );

On my unloaded K6 this results in

    timethis 10000:  9 wallclock secs ( 6.60 usr +  2.89 sys =  9.49 CPU)

Slightly better than 1000/second might be good enough if you are handing
these out as cookies.

chris


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

Date: Mon, 04 Oct 1999 08:44:43 +0100
From: Richard H <rhardicr@mail.ford.com>
Subject: Re: Perl and Access problem(DBI/DBD)
Message-Id: <37F85AEB.399A56B1@mail.ford.com>

Sushant Gargya wrote:
> 
> I'm trying to get perl to talk to the Access database. I've looked at
> the perl resource kit documents, but
> I'm not able to get anything working.
> So, far I have installed DBI and DBD::ODBC modules from activestate
> repository.
> 
> Here's a the barebone script that tries to connect to the access
> database:
> ######### Begin Script ##########
> use DBI;
> $dbFile="Z:\\dbfile.mdb";
> $dsn = "dbi:ODBC:$dbFile";
> $userid="john";
> $passwd = "xyz";
> $dbh = $DBI->connect("$dsn","$userid","$passwd", {RaiseError => 1});
>    die "$DBI connect failed: $DBI::errstr" unless $dbh;
> ########### End Script ##########
> Does anyone see anything wrong with the above snip??

no, have you set up the system DSN? 
What Error message did you get if/when it failed?? What did die throw
out?? difficult to tell until then, the script below gets data out of an
Access DB on my machine

Richard H

=====================================================================
use DBI;
use strict;

my $dbh =  DBI->connect("dbi:ODBC:db1")     || die "cant connect
$DBI::errstr \n";

my $sth = $dbh->prepare("select * from Authors") || die "cant prepare
$DBI::errstr \n";

$sth->execute || die "cant execute $DBI::errstr \n";
my $aref = $sth->fetchall_arrayref;
my @ary1 = @$aref;
for (@ary1) {
	my @ary = @$_;
	print "@ary \n";
}
$sth->finish;
$dbh->disconnect;


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

Date: Mon, 04 Oct 1999 02:37:30 GMT
From: puma@mailandnews.com (Marc)
Subject: perl and zipSlack
Message-Id: <7t8lov.3vs19q1.0@pumamarcmailandnews.h6CF9EA5B.invalid>

Hello,
    	I have the latest version of zipSlack [a UMSDOS Linux] and am having 
some weird problems.  I am trying to run a perl script, but it is not working 
as I thought it should.

the first line of the script is this.
#!/usr/bin/perl

    	This is where Perl is located. yet when I type the name of the file, 
dice.plx I get a message, program not found.

Marc


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

Date: 4 Oct 1999 04:00:49 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: perl and zipSlack
Message-Id: <7t98ph$4cd$1@rguxd.viasystems.com>

Marc <puma@mailandnews.com> wrote:
:>Hello,
:>    	I have the latest version of zipSlack [a UMSDOS Linux] and am having 
:>some weird problems.  I am trying to run a perl script, but it is not working 
:>as I thought it should.

:>the first line of the script is this.
:>#!/usr/bin/perl

:>    	This is where Perl is located. yet when I type the name of the file, 
:>dice.plx I get a message, program not found.

You are half way to understanding how all of this works.  Good
work on making sure that the shebang line points to the correct
location of perl on your system.

Try

 ./dice.plx

Then read the manual page for your shell for a couple of days.
Manual pages are chock full of content.  Every word in every sentence
can be important.  Most of us have to read them more than once.  Pay
particular attention to the section that describes the search path.

BTW, this is not a Perl question, but traffic is light in this
newsgroup on a Sunday night (nobody will come out and play with me),
so you get an answer.  Apparently, most of the posters to this
newsgroup do so during regular business hours instead of during their
own free time.  Imagine that.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Mon, 04 Oct 1999 10:36:41 +0100
From: David Cantrell <NukeEmUp@ThePentagon.com>
Subject: Re: Perl vs. PHP3
Message-Id: <2nT4NzjBeUvLpqfIbw3sUIRycsTJ@4ax.com>

On 3 Oct 1999 06:45:24 -0500, abigail@delanet.com (Abigail) said:

> Moritz Mertinkat wrote:
>
> > I have to write an Advertising Script (Banner rotation),
> > but I still don't know what language I should use.
> > What do you think is the better language (speed!) for
> > this task?
>
> Forth.

Naah, use Postscript, then you can easily generate the images from the
same script.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Mon, 04 Oct 1999 12:04:36 -0700
From: Francois Dupradeau <fyd@u-picardie.fr>
Subject: Perl5.0/Perl4.0
Message-Id: <37F8FA44.41C6@u-picardie.fr>

Dear All,

I am a new perl user.
I did a perl script with perl5 under linux (redhat 5.2)
I would like to use it in same time with perl 4 under Irix 6.3 (SGI).
My script works fine under perl5 but I get a lot of error messages with
perl 4.0.
 
Any idea? Thanks
Francois

Here is a part of my perl 5.0 script:

#! /usr/bin/perl
sub initialise {
	print "Number of Single Points ?   ";
	$sp_nb=<STDIN>;

	print "All the geometry modification values ?\n";
	$All_values=<STDIN>;
	chomp ($All_values); 
	@field=split(/ /,$All_values);
	for ($j=0; $j<$sp_nb; $j++) {
		$tab[1][$j]=$field[$j];   
	}
etc ...

I get the following error messages with perl 4.0:

Syntax error in file all_in_onebis at line 8, next 2 tokens "chomp ("
Syntax error in file all_in_onebis at line 11, next 2 tokens "]["
etc...

-- 
Francois Dupradeau
   ------------ 
Faculte de Pharmacie
1, rue des Louvels
80037 Amiens Cedex
France
   ------------ 
Tel 33 (0)3 22 82 74 94
Fax 33 (0)3 22 82 74 69
Email fyd@u-picardie.fr


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

Date: Mon, 4 Oct 1999 00:30:12 -0700
From: "Baris Sumengen" <sumengen@hotelspectra.com>
Subject: Re: Regexp question
Message-Id: <7t9l2t$mhr$1@bgtnsc02.worldnet.att.net>

> Here's one way:
>
>     s/(")(.*)\1/$2/s;

I am just curious:
would
s/(")(.*)$1/$2/s;
will work the same way?
Baris.




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

Date: 4 Oct 1999 04:26:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regexp question
Message-Id: <slrn7vgt5e.chn.abigail@alexandra.delanet.com>

Baris Sumengen (sumengen@hotelspectra.com) wrote on MMCCXXV September
MCMXCIII in <URL:news:7t9l2t$mhr$1@bgtnsc02.worldnet.att.net>:
\\ > Here's one way:
\\ >
\\ >     s/(")(.*)\1/$2/s;
\\ 
\\ I am just curious:
\\ would
\\ s/(")(.*)$1/$2/s;
\\ will work the same way?


$ perl -wle '$_ = q {"foo"}; /(o)/; s/(")(.*)$1/$2/; print'
fo"
$ perl -wle '$_ = q {"foo"}; /(o)/; s/(")(.*)\1/$2/; print'
foo
$


Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 4 Oct 1999 04:37:15 -0500
From: abigail@delanet.com (Abigail)
Subject: RFC::RFC822::Address.
Message-Id: <slrn7vgtq6.chn.abigail@alexandra.delanet.com>


I've put a module to check the syntax of email addresses on CPAN,
as RFC::RFC822::Address. It should find its way to the various
mirrors today and tomorrow.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 04 Oct 1999 11:21:54 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: chw@firemail.de
Subject: Re: Schnelle Bearbeitung von HTML-Seiten
Message-Id: <37F871B2.8F89F5C7@ife.ee.ethz.ch>

Christian Weerts wrote:
> 
> Hallo
> 
> ich suche nach einer möglichkeit, in mehreren html-seiten gleichzeitig eine(n) bestimmte
> 
> Änderung / Link einzufügen. Gibt es da unter perl eine möglichkeit?

ja

I suggest posting english on an english newsgroup next time
there exists also de.comp.lang.perl.misc

- Alex


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

Date: Mon, 04 Oct 1999 08:01:50 GMT
From: bolleh@my-deja.com
Subject: Sending to a port
Message-Id: <7t9mtc$j65$1@nnrp1.deja.com>

I have a program running on a server that accepts parameters through
port 8008. When sending to this port the program also replies if the
parameters are OK.

Is it possible to make a perl-program that
1) sends 1-100 parameters to a port
2) listens for replies and then stores them in a file ?

-Øyvind Bollingmo


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


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

Date: Mon, 04 Oct 1999 03:00:04 GMT
From: <nihad@yahoo.com>
Subject: Simple - yet won't work!
Message-Id: <rvg61kkcmom24@corp.supernews.com>

Hi,

I have a very simple counter that gets accessed 250,000+ times a day, the
counter is doing all the right things except it keeps resting itself a few
times a day!

here is part of the code:

open (INFI, "$pagepath");
$count = <INFI>;
close INFI;

$count = $count + 1;				
open(INF,">$pagepath");				
flock(INF, 2);
print INF "$count";				
close INF;	

I'm not sure what's wrong with the code since it's a very simple task and 
the file locking should protect the counter log from getting overwritten.

Please help

Thanks in advance...
				

------------------  Posted via CNET Help.com  ------------------
                      http://www.help.com/


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

Date: 3 Oct 1999 23:53:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Simple - yet won't work!
Message-Id: <slrn7vgd6r.chn.abigail@alexandra.delanet.com>

nihad@yahoo.com (nihad@yahoo.com) wrote on MMCCXXV September MCMXCIII in
<URL:news:rvg61kkcmom24@corp.supernews.com>:
~~ 
~~ I have a very simple counter that gets accessed 250,000+ times a day, the
~~ counter is doing all the right things except it keeps resting itself a few
~~ times a day!
~~ 
~~ here is part of the code:
~~ 
~~ open (INFI, "$pagepath");
~~ $count = <INFI>;
~~ close INFI;
~~ 
~~ $count = $count + 1;				
~~ open(INF,">$pagepath");				
~~ flock(INF, 2);
~~ print INF "$count";				
~~ close INF;	
~~ 
~~ I'm not sure what's wrong with the code since it's a very simple task and 
~~ the file locking should protect the counter log from getting overwritten.


Oh, really? Then why do you wipe out the content of the file before 
locking it? Besides, you don't check for a lock before reading its
content. Not to mention that you close and reopen the file.

In fact, there's so much wrong with your script, there's hardly anything right.

Besides... what's the point of a counter anyway?


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 04 Oct 1999 05:12:57 GMT
From: jbc@best.com (John Callender)
Subject: Re: Simple - yet won't work!
Message-Id: <37f83759$0$201@nntp1.ba.best.com>

<nihad@yahoo.com> writes:

>I have a very simple counter that gets accessed 250,000+ times a day, the
>counter is doing all the right things except it keeps resting itself a few
>times a day!

>open(INF,">$pagepath");				
>flock(INF, 2);
>print INF "$count";				
>close INF;	

>I'm not sure what's wrong with the code since it's a very simple task and 
>the file locking should protect the counter log from getting overwritten.

Only for certain very small values of "should"...

You're closing the barn door after the horse is already gone. By the
time you get around to flocking your INF filehandle, you've already
opened the file for writing, clobbering whatever was previously in it.
With the right sequence of not-quite-simultaneous accesses from
seperate Web server processes, you can quite easily end up resetting
your counter file (and so you are).

This question is addressed very specifically (even correctly responding
to your "but it should be so easy" tone) in the FAQ, specifically,
perlfaq5, under the heading "I still don't get locking.  I just want to
increment the number in the file.  How can I do this?".

perldoc -q locking

or 

man perlfaq5

(followed by some paging) should get you there. There's a working
example and everything. Best wishes...
--
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: 4 Oct 1999 06:47:44 GMT
From: Stuart Yeates <syeates@manuka.cs.waikato.ac.nz>
Subject: Re: Simple - yet won't work!
Message-Id: <939019663.206064@clint.waikato.ac.nz>

nihad@yahoo.com wrote:
: Hi,

: I have a very simple counter that gets accessed 250,000+ times a day, the
: counter is doing all the right things except it keeps resting itself a few
: times a day!

: here is part of the code:

: 1  open (INFI, "$pagepath");
: 2  $count = <INFI>;
: 3  close INFI;
: 4 
: 5  $count = $count + 1;				
: 6  open(INF,">$pagepath");				
: 7  flock(INF, 2);
: 8  print INF "$count";				
: 9  close INF;	

: I'm not sure what's wrong with the code since it's a very simple task and 
: the file locking should protect the counter log from getting overwritten.

try switching the open and the flock (lines 6 and 7) around, that way 
you can be sure that you're not reading the file when it's also being 
written.

stuart
--    stuart yeates <s.yeates@cs.waikato.ac.nz> aka `loam'
                       carpe noctem
X-no-archive:yes


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

Date: 4 Oct 1999 04:29:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Simple - yet won't work!
Message-Id: <slrn7vgtbq.chn.abigail@alexandra.delanet.com>

Stuart Yeates (syeates@manuka.cs.waikato.ac.nz) wrote on MMCCXXV
September MCMXCIII in <URL:news:939019663.206064@clint.waikato.ac.nz>:
\\ 
\\ try switching the open and the flock (lines 6 and 7) around, that way 
\\ you can be sure that you're not reading the file when it's also being 
\\ written.

Try? Try? I guess you didn't try yourself, did you? One can't lock a
file unless you have the file opened.

Please refrain from random suggestions.


Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 4 Oct 1999 08:44:00 +0200
From: "Marco Cerqui" <marco.cerqui@alcatel.ch>
Subject: Testing a String
Message-Id: <7t9ibj$aia$1@pollux.ip-plus.net>

Hi

Everybody knows the rules for the passwords -> Minumum 6 Characters, minumum
2 digits and and and....

Is there a posibility ( or a module) to check a string like passwd does ??

Thanks

Marco




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

Date: Mon, 04 Oct 1999 03:44:32 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: What is the best way to design for Client/Server hand  shaking/communication
Message-Id: <37F822EB.667A493D@sympatico.ca>

Otis Nettles wrote:

> I'm using IO::Socket and IO::Select, and nonblocking reads.

This is what I would use too.

> My server works great when I telnet to it and issue the commands, but when I
> try and have the client talk to the server, there seem to be some
> synchronization issues.

Yeah that probably is the problem. Another problem that bit me was the
way 
the messages arrive at the server side. Sometimes there are \r's that
you
need to take care of.

> What is the best way to implement this type of design?

Very general question. What you describe is the way I would go. I am not
the
ultimate reference on those kind of issues, though.

> What seems to be happening is that the client and server don't seem to be
> waiting for each other correctly.

I would include some print() statements here and there just to be sure
where
the program is getting stuck in.

> I've included the initialization and main loops from both the server and the
> client.  Thanks for any help.
> 
> server
> my $sock = IO::Socket::INET->new(LocalAddr => $myhost,
>                                  LocalPort => $port,
>                                  Listen => 5,
>                                  Proto => 'tcp',
>                                  Reuse => 1);
> 
> die "Can't create listen socket: $!" unless $sock;
> print "Listening for connections on port $port\n";
> $sock->autoflush(1);
> 
> my $readable = IO::Select->new;
> my $errors = IO::Select->new;
> $readable->add($sock);
> open(LOG,">server.log") || die "Could not open log: $!\n";
> while (1) {
> print STDERR "";
>     my ($ready) = IO::Select->select($readable, undef, $errors, 1);
>     foreach my $s (@$ready) {
> #print STDERR "inner loop\n";
>         # see if this is a new connection
>         if($s == $sock) {
>             my $new_sock = $sock->accept;
>             # add it to our read set
>             $readable->add($new_sock) if $new_sock;
>             welcome($new_sock);
>         }
>         # nope, it's something that's ready to read
>         else {
> #print STDERR "else\n";
>             # try to read a line
>    print $s "\n";

Why are you printing to $s? You should be reading from it .. no?
Perhaps that could be your source of problems?

[snip rest of code]

Can you reduce your code to a minimal and repost please? I will be able 
to take a closer look if you do.

HTH,
--Ala


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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


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


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