[21962] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4184 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 26 21:05:44 2002

Date: Tue, 26 Nov 2002 18:05:10 -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           Tue, 26 Nov 2002     Volume: 10 Number: 4184

Today's topics:
        Adding values to a hash? <bob@bobber.com>
    Re: Adding values to a hash? <stuart.flowers@t-online.de>
    Re: Adding values to a hash? <bob@bobber.com>
    Re: Apache/MySQL/DBI problem ctcgag@hotmail.com
    Re: automatic email anniversay script <itshardtogetone@hotmail.com>
    Re: back quotes in NT (Tad McClellan)
    Re: how do I uninstall old version of Perl? <nospam@nospam.com>
        how to test for empty nonexistent array??? (Bruno Boettcher)
    Re: how to test for empty nonexistent array??? <usenet@dwall.fastmail.fm>
    Re: how to test for empty nonexistent array??? (Tad McClellan)
    Re: IP and Host differences (Tad McClellan)
    Re: IP and Host differences <ian@WINDOZEdigiserv.net>
    Re: LWP::UserAgent does not return a Response ?? <spam@thecouch.homeip.net>
    Re: LWP::UserAgent does not return a Response ?? <stuart.flowers@t-online.de>
        More hash questions <bob@bobber.com>
    Re: More hash questions <stuart.flowers@t-online.de>
    Re: More hash questions <bcoon@sequenom.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <ahj6@hotmail.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <jurgenex@hotmail.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <ahj6@hotmail.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <jeff@vpservices.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <jeff@vpservices.com>
    Re: mozilla & netscape.  incapable of CSS word-break ? <ahj6@hotmail.com>
    Re: need help assigning reference numbers <pkent77tea@yahoo.com.tea>
    Re: One more question about sockets... <nospam@nospam.com>
    Re: One more question about sockets... <uri@stemsystems.com>
    Re: Out Of Memory while parsing CVS rlog output <nospam@nospam.com>
    Re: Out Of Memory while parsing CVS rlog output <pkent77tea@yahoo.com.tea>
    Re: Perl Service App? (Alan Barclay)
    Re: Wow! Differences between "unless" and if (!) (Tad McClellan)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 26 Nov 2002 23:32:37 GMT
From: Bob <bob@bobber.com>
Subject: Adding values to a hash?
Message-Id: <3DE40491.6000207@bobber.com>

How do you 'push' name/value pairs to a hash?  I have a loop where I 
have new name/value pairs being generated and would like them to be 
added to an existing hash:

Thanks



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

Date: Wed, 27 Nov 2002 00:40:09 +0100
From: Stuart Flowers <stuart.flowers@t-online.de>
Subject: Re: Adding values to a hash?
Message-Id: <as10ou$1hd$06$1@news.t-online.com>

Hi Bob,
Simple!
$hashname{$name} = $value;

Stuart

Bob wrote:

> How do you 'push' name/value pairs to a hash?  I have a loop where I
> have new name/value pairs being generated and would like them to be
> added to an existing hash:
>
> Thanks
>



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

Date: Tue, 26 Nov 2002 23:49:14 GMT
From: Bob <bob@bobber.com>
Subject: Re: Adding values to a hash?
Message-Id: <3DE4087A.8000208@bobber.com>

Stuart Flowers wrote:
> Hi Bob,
> Simple!
> $hashname{$name} = $value;
> 
> Stuart

Thanks!



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

Date: 27 Nov 2002 02:04:08 GMT
From: ctcgag@hotmail.com
Subject: Re: Apache/MySQL/DBI problem
Message-Id: <20021126210408.405$ES@newsreader.com>

lordvee@tin.it (Lord V) wrote:
> Hi,
> I have a script that connects to MySQL and checks for login and pw.
> the thing is that when i try to log in with a name that's not in the
> database row i get a:
> "Premature end of script headers: /usr/lib/cgi-bin/reg.cgi"
> I read somewhere that the above is a compile time error,

Where?  It means that the web server was expecting a complete header and
didn't get it.  Why it didn't get one is pretty much open.  Maybe it got
something other than a header, or maybe it got nothing at all.

> so i'm trying
> to get the picture clear about what could be wrong. Any quick clue?
> using perl -wT doesn't give out any new info, while using "use
> strict;" makes a infinite serie of warnings...

Using 'use strict' could make a very long list of fatal errors, to
which the solution is to fix them.  It shouldn't make a long list
of warnings.

>
> This is the relevant part of it:

Unfortunately, this is probably not the entire relevant part of it.
Trim the script to a complete, working script which demonstrates the
error and is short enough to post.  9 times out of 10 you will find
the error yourself in the process of doing this.

Are you using fatalsToBrowser?  Are you even using CGI.pm?
Does &print_header print the html header, or something else?
What do you expect to happen if your program dies before it gets to the
place where it would normally print the html headers?

Xho

>
> --
> elsif ($in{'loginscript'} ne "") {
>         my $dbh = DBI->connect("DBI:mysql:utenti_registrati", $user,
> $pwd) or print "Impossibile connettersi al database: " . DBI->errstr;
>         my $verifica_utente = $dbh -> prepare('SELECT * FROM
> dati_personali WHERE login = ?');
>         $verifica_utente -> execute($in{'nomelog'}) or die "Per
> ragioni tecniche il riconoscimento non puo' avvenire. Codice di
> errore: " . $verifica_utente -> errstr;
>         while (@dati_pers = $verifica_utente->fetchrow_array){
>                 if ($dati_pers[5] eq $in{'parola'}) {
>                         &print_header;
>                         &pagesetup("Pagina di Login");
>                         print "<h5>Buongiorno
> ",ucfirst($dati_pers[0]),"</h5>";
>                         &pageclose;
>                 }
>                 else {
>                         &errore("Riconoscimento non avvenuto!
> Controlla che login e password siano immessi correttamente!");
>                         exit;
>                 }
>         }
>         $verifica_utente->finish;
>         $dbh -> disconnect;
>         exit;

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


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

Date: Wed, 27 Nov 2002 08:13:36 +0800
From: "itshardtogetone" <itshardtogetone@hotmail.com>
Subject: Re: automatic email anniversay script
Message-Id: <as12gj$a26$1@mawar.singnet.com.sg>

"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3DE2F236.30800@rochester.rr.com...
> You are correct that a CGI script will only be invoked when someone
> requests it.

Thanks Bob, thats what I want to know.

This automation thing came to my mind because I noted that bigfoot.com have
"reminder services" whereby it automatically sent "reminder" emails to me on
a daily basis.

Thanks







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

Date: Tue, 26 Nov 2002 19:57:12 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: back quotes in NT
Message-Id: <slrnau89jo.6do.tadmc@magna.augustmail.com>

Marc <brownjenkn@aol.com> wrote:

> system "some.exe";
> 
> There's been some problems on our network where processes weren't
> getting properly terminated and it's been suggested, for shell
> execution, to move to back quotes rather than the system() command.


Why was it suggested to move from system() to backquotes?

You use system() when you want to run an external program
and let its output go wherever it normally goes (often STDOUT).

You use backticks when you want to run an external program
and capture that program's output into your Perl program.


> Problem is, `some.exe`, doesn't appear to be recognized in my script. 


Show us your script.

   `some.exe`;

is _supposed_ to make no output.

It runs some.exe and captures its output, but your code does
not do anything with that output.

Try:

   my $some_ext_output = `some.exe`;

and see if $some_ext_output has anything in it.


> However, print `some.exe` seems to work okay.


There you _are_ doing something with the program's output,
you are passing it as an argument to the print function.


> I'm in NT so I'm not certain if the problem is there.  And, is there
> anything wrong with using "print" as a hackey way to fix the problem? 


What is the problem again?

I seriously doubt that switching between system/qx will fix it...


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


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

Date: Tue, 26 Nov 2002 15:07:55 -0800
From: "Tan Nguyen" <nospam@nospam.com>
Subject: Re: how do I uninstall old version of Perl?
Message-Id: <3de3fe2d_1@nopics.sjc>


"Matt Oefinger" <oefinger@mit.edu> wrote in message
news:e9b08c9f.0211261239.63fbef7c@posting.google.com...
> For some reason when I invoked the CPAN module to retrieve and install
> a WWW module the CPAN module decided to install a new version of Perl.
> I now have two versions of Perl on my system (5.6.0 and 5.8.0) and
> there is some serious contamination. I'd like to uninstall one or both
> versions and start over. How do I uninstall?
Go to Control Panel, then click on Add/Remove Softwares :-0.  Just
kidding...though it might work if you're on Windows.
Well, depending on how your Perl versions have been installed on the system.
If your system is Linux and Perl is installed via rpm packages, you can use
rpm to uninstall it. If you manually compile and install Perl, you might
want to go to the build directory and run "make realclean". In case of CPAN,
you might want to go to the .CPAN directory and run "make realclean" in the
build directory. Again. this is just a pure guess...




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

Date: 26 Nov 2002 23:40:22 GMT
From: bboett@bboett.dyndns.org (Bruno Boettcher)
Subject: how to test for empty nonexistent array???
Message-Id: <as10p6$c7v$1@news-reader12.wanadoo.fr>

hello!

i have the problem of the following error message:
Use of uninitialized value in join or string at test.pm line 1969.

now the line there looks like this:
$listOfTriggers = join(' ',@$serv_triggers) if(@$serv_triggers);

now i thought that it would try the join only if there was something to
join, but as it seems i got it wrong... so what would be the right way
to do this??

 
-- 
ciao bboett
==============================================================
bboett@adlp.org
http://inforezo.u-strasbg.fr/~bboett


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

Date: Wed, 27 Nov 2002 00:53:10 GMT
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: how to test for empty nonexistent array???
Message-Id: <Xns92D2CA4B22959dkwwashere@63.240.76.16>

bboett@bboett.dyndns.org (Bruno Boettcher) wrote:

> i have the problem of the following error message:
> Use of uninitialized value in join or string at test.pm line 1969.
> 
> now the line there looks like this:
> $listOfTriggers = join(' ',@$serv_triggers) if(@$serv_triggers);
> 
> now i thought that it would try the join only if there was
> something to join, but as it seems i got it wrong... so what would
> be the right way to do this??

Are you sure the array doesn't contain undef?

This runs with no errors,

  use strict;
  use warnings;
  my @ary;
  my $aref = \@ary;
  my $sc1 = join(' ', @ary  ) if @ary;
  my $sc2 = join(' ', @$aref) if @$aref;

but if I initialize @ary as

  my @ary = (undef);

then it produces the "Use of uninitialized value in join or 
string..." error, because even though the array contains one element 
(scalar(@ary) is 1), that element is undefined.

You DO have warnings and strictures enabled, right?

-- 
David Wall - me@dwall.fastmail.fm
"Oook."


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

Date: Tue, 26 Nov 2002 20:02:22 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: how to test for empty nonexistent array???
Message-Id: <slrnau89te.6do.tadmc@magna.augustmail.com>

Bruno Boettcher <bboett@bboett.dyndns.org> wrote:
> 
> i have the problem of the following error message:
> Use of uninitialized value in join or string at test.pm line 1969.


That is NOT an error message.

That is a warning message.


> now the line there looks like this:
> $listOfTriggers = join(' ',@$serv_triggers) if(@$serv_triggers);


@$serv_triggers contains the undef value.

To find out which one is undef, write code to tell you
which one is undef:

   foreach ( 0 .. $#$serv_triggers ) {
      print "index $_ is uninitialized\n" unless defined $serv_triggers->[$_];
   }


> now i thought that it would try the join only if there was something to
> join, 


There _is_ something to join.

undef is "something".


> so what would be the right way
> to do this??


That depends on what you want to do.

Is there _supposed_ to be undefs in there or not?

If so, do you want to join nothing for the undef elements?
(isn't it already doing that?)


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


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

Date: Tue, 26 Nov 2002 16:57:06 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: IP and Host differences
Message-Id: <slrnau7v22.63l.tadmc@magna.augustmail.com>

Ian.H [dS] <ian@WINDOZEdigiserv.net> wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
> 
> In a fit of excitement on Tue, 26 Nov 2002 15:55:35 -0600,
> tadmc@augustmail.com (Tad McClellan) managed to scribble:
> 
> [snip]
> 
>> Neither the problem nor the solution has any Perl content yet.
>                                                             ^^^
> 
> Tad,
> 
> If I understand you correctly this time round, had the OP asked about
> retrieving the headers via $ENV{} in Perl, this would _then_ have
> become a Perl question? 


Yes.


> If your reply is "yes", then I apologise, and


Thanks. Sorry for the confusion.


> agree with you; the OP should have specified Perl as the solution they
> were after to actually retrieve the headers.. 


The OP was not asking _how_ to something, he was asking what to do.

You need to know what to do before you can write a program
that will do it.  :-)


> and maybe I shouldn't
> have assumed the question was really about Perl retrieving them.


Go have a look at the first post in this thread.

Would it have been out of place, or need any changing, if it
had been posted to the Python or Java newsgroup?  (No)

He asked these questions:

   Would a different Host indicate with the same IP address on the 
   same day indicate a new visitor? 

   Why does the Host change? 

   I thought IP and Host were supposed to be linked together?

There is no Perl there.

He is asking questions about networking or the WWW, not about Perl.


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


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

Date: Tue, 26 Nov 2002 23:32:47 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: IP and Host differences
Message-Id: <9318uukpcma10jlo22o0cg2ocnsgp3aaed@4ax.com>
Keywords: Remove WINDOZE to reply

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

In a fit of excitement on Tue, 26 Nov 2002 16:57:06 -0600,
tadmc@augustmail.com (Tad McClellan) managed to scribble:

[snip]

> Yes.
> 
> 
> > If your reply is "yes", then I apologise, and
> 
> 
> Thanks. Sorry for the confusion.

No problem.. it happens between everyone =)


[snip]

> The OP was not asking _how_ to something, he was asking what to do.
> 
> You need to know what to do before you can write a program
> that will do it.  :-)

heh, indeed =)


> 
> 
> > and maybe I shouldn't
> > have assumed the question was really about Perl retrieving them.
> 
> 
> Go have a look at the first post in this thread.
> 
> Would it have been out of place, or need any changing, if it
> had been posted to the Python or Java newsgroup?  (No)
> 
> He asked these questions:
> 
>    Would a different Host indicate with the same IP address on the 
>    same day indicate a new visitor? 
> 
>    Why does the Host change? 
> 
>    I thought IP and Host were supposed to be linked together?
> 
> There is no Perl there.
> 
> He is asking questions about networking or the WWW, not about Perl.

Agreed.


Regards,

  Ian

-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3

iQA/AwUBPeQE72fqtj251CDhEQI1kQCgqIm/sjv2lzZ3Y0hmEIGSZBgYYCQAoLEn
ZzL6Ruy0zqqhbxbKMfr34VF2
=tham
-----END PGP SIGNATURE-----

-- 
Ian.H  [Design & Development]
digiServ Network - Web solutions
www.digiserv.net  |  irc.digiserv.net  |  forum.digiserv.net
Scripting, Web design, development & hosting.


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

Date: Tue, 26 Nov 2002 18:47:48 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: LWP::UserAgent does not return a Response ??
Message-Id: <3DE40824.8060604@thecouch.homeip.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1



Stuart Flowers wrote:
| Hello All.
| I'm writing a script to check if a URL is available - and using the LWP
| suite of modules. (Perl 5.8.0)
| Problem is that after the:
|
| $reponse = $ua->request($request);

Always check the result of your calls. Dont't assume anything will
always work.

As for debugging:

use Data::Dumper;
print "! is $!\n";
print "\@ is $@\n";
print Dumper($response);

OR

Learn how to use the perl debugger and step to see what is in $response.

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE95AgkeS99pGMif6wRAjiDAJ46GQprFcHTHMygr5UWgl2ouLLdkwCgzIv8
DDFjJJvFfiGta/j6ATNfPPg=
=vLip
-----END PGP SIGNATURE-----



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

Date: Wed, 27 Nov 2002 01:01:55 +0100
From: Stuart Flowers <stuart.flowers@t-online.de>
Subject: Re: LWP::UserAgent does not return a Response ??
Message-Id: <as121p$fbg$04$1@news.t-online.com>

Thanks Mina,

Debugger and Dumper tell me that $response is undefined.
The question remains ...WHY...??

Staurt

Mina Naguib wrote:

>
>
> Stuart Flowers wrote:
> | Hello All.
> | I'm writing a script to check if a URL is available - and using the LWP
> | suite of modules. (Perl 5.8.0)
> | Problem is that after the:
> |
> | $reponse = $ua->request($request);
>
> Always check the result of your calls. Don't assume anything will
> always work.
>
> As for debugging:
>
> use Data::Dumper;
> print "! is $!\n";
> print "\@ is $@\n";
> print Dumper($response);
>
> OR
>
> Learn how to use the perl debugger and step to see what is in $response.
>
>



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

Date: Wed, 27 Nov 2002 00:24:17 GMT
From: Bob <bob@bobber.com>
Subject: More hash questions
Message-Id: <3DE410B0.8060308@bobber.com>

Hi,

I have a hash whose structure ends up being like this (according to 
Data::Dumper):
$VAR1 = {
           '29' => '123',
           '0' => '120',
           '1' => '161',
           '2' => '104',
           '3' => '131',
           '4' => '89',
           '5' => '183',
           '11' => '104',
           '20' => '91',
           '6' => '130',
           '12' => '244',
           '21' => '30',
           '7' => '205',
           '13' => '82',
           '22' => '146',
           '8' => '103',
           '14' => '120',
           '23' => '29',
           '9' => '101',
           '24' => '207',
           '25' => '107',
           '17' => '126',
           '26' => '287',
           '18' => '88',
           '27' => '143',
           '19' => '192',
           '28' => '184'
         };

I need to find the highest value, and then retrieve it's corresponding 
key... as the key tells me which element (an array reference) in a 
different array is associated with this high value.

My first thought was to reverse sort by value and then just take the 
first key in the hash.  Do I need to do this?  What is the most 
efficient method for this?  In cases of duplicate values, taking the 
first is fine.

Thanks,
B



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

Date: Wed, 27 Nov 2002 01:34:33 +0100
From: Stuart Flowers <stuart.flowers@t-online.de>
Subject: Re: More hash questions
Message-Id: <as13uv$kip$07$1@news.t-online.com>

Hi again Bob,
I would suggest something like (untested code follows!!)

my $max = 0;
my $maxkey = undef;
foreach $i (keys $hashname) {
   if ($hashname{$i} > $max) {
       $max    = $hashname{$i};
       $maxkey = $i;
   }
}
 ...

Stuart

Bob wrote:

> Hi,
>
>
> I need to find the highest value, and then retrieve it's corresponding
> key... as the key tells me which element (an array reference) in a
> different array is associated with this high value.
>
> My first thought was to reverse sort by value and then just take the
> first key in the hash.  Do I need to do this?  What is the most
> efficient method for this?  In cases of duplicate values, taking the
> first is fine.
>
> Thanks,
> B
>



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

Date: Wed, 27 Nov 2002 01:13:00 GMT
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: More hash questions
Message-Id: <3DE41C1B.5060804@sequenom.com>

Stuart Flowers wrote:
> Hi again Bob,
> I would suggest something like (untested code follows!!)
> 
> my $max = 0;
> my $maxkey = undef;
> foreach $i (keys $hashname) {
>   if ($hashname{$i} > $max) {
>       $max    = $hashname{$i};
>       $maxkey = $i;
>   }
> }
> ...
> 
> Stuart

Thanks again Stuart!

B



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

Date: Wed, 27 Nov 2002 10:05:12 +0900
From: "Hyungjin Ahn" <ahj6@hotmail.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <as148s$846$1@news1.kornet.net>

"Tad McClellan" <tadmc@augustmail.com> wrote in message
> It was a disparaging reference to the OP's (lack of) quoting style.

Oh, I apologize to you for my lack of quoting style.
But you well realized my lack of quoting style, though only failed to
realize
that I added my effort to solve the word-break problem attached to
the tail of the original post of this threads. Of course, that effort was
coded in Perl.

BTW, for your indication, from now on, I will not fail to go by rule in
newsgroups. But I wonder when I could get the profitable answers for my
question.

> Heavens no!

It's lucky. If you engaged in such bigotry, topic of this thread had gone
away a bit farther and worse.

BTW, the fonts such as Times & Arial are well organized internationaly so
that
we should not fail to pick out these fonts from any browser. And CSS
standard
is also well adapted around the world so that we shoud not fail to fix the
fonts
in an exact pixel size.( yes, CSS-styled fixed font size can not changed by
browser specific settings of font-size.)

In the original post, I added trifle Perl source code to solve word-break
problem.
But now I find out better way which I am still developing. Of course, I'm
still
waiting for any cool script written in Perl or any idea.

Hyungjin Ahn(ahj6@hotmail.com)

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




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

Date: Wed, 27 Nov 2002 01:20:57 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <Z5VE9.39591$mL2.6399@nwrddc01.gnilink.net>

Hyungjin Ahn wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> BTW, the fonts such as Times & Arial are well organized
> internationaly so that
> we should not fail to pick out these fonts from any browser.

Where do you find Arial or Times for Hangul or Hiragana?

> And CSS standard
> is also well adapted around the world so that we shoud not fail to
> fix the fonts
> in an exact pixel size.( yes, CSS-styled fixed font size can not
> changed by browser specific settings of font-size.)

Which first of all is a slap in the face of any user (how dare you
overwriting my personal preferences for viewing web pages? Ever tried to
show a webpage with hardcoded font size in a presentation?).
Second even if CSS overwrites browser specific settings it does not
overwrite system settings like large fonts or high contrast for
accessibility support.
And last but not least: this still has nothing to do with Perl.

*PLONK*

jue




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

Date: Wed, 27 Nov 2002 10:22:48 +0900
From: "Hyungjin Ahn" <ahj6@hotmail.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <as159s$92e$1@news1.kornet.net>

"Andras Malatinszky" <nobody@dev.null> wrote in message
news:3DE391FA.5050001@dev.null...
> Tad McClellan wrote:

> > Hyungjin Ahn <ahj6@hotmail.com> wrote TOFU:

> What does TOFU mean here? I hope it's not a disparaging reference to the
> OP's East Asian sounding name :-)
> Just messing with you, don't take me too seriously.

If you intended to mess this topic, u succeeded.

Hyungjin Ahn(ahj6@hotmail.com)




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

Date: Tue, 26 Nov 2002 17:24:36 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <3DE41ED4.1030409@vpservices.com>

Hyungjin Ahn wrote:


> still
> waiting for any cool script written in Perl or any idea.

Waiting for a perl script to solve a CSS problem?  I hope you brought 
along a lunch.

-- 
Jeff



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

Date: Tue, 26 Nov 2002 17:32:36 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <3DE420B4.7020708@vpservices.com>

Andras Malatinszky wrote:


> Tad McClellan wrote:
> 
>> Hyungjin Ahn <ahj6@hotmail.com> wrote TOFU:
> 
> What does TOFU mean here? I hope it's not a disparaging reference to the 
> OP's East Asian sounding name :-)


IMHO, the smiley is not sufficient to turn that sentence into a joke or 
to make it an appropriate remark for this or any other forum.  Keep this 
  disgusting crap off of clpm.  And, yes, I admit to being humour 
impaired where racism is concerned.

-- 
Jeff



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

Date: Wed, 27 Nov 2002 10:57:51 +0900
From: "Hyungjin Ahn" <ahj6@hotmail.com>
Subject: Re: mozilla & netscape.  incapable of CSS word-break ?
Message-Id: <as17bj$ahf$1@news1.kornet.net>

"J?gen Exner" <jurgenex@hotmail.com> wrote in message
news:Z5VE9.39591$mL2.6399@nwrddc01.gnilink.net...
> Hyungjin Ahn wrote:
> > "Tad McClellan" <tadmc@augustmail.com> wrote in message
> > BTW, the fonts such as Times & Arial are well organized
> > internationaly so that
> > we should not fail to pick out these fonts from any browser.
> Where do you find Arial or Times for Hangul or Hiragana?

I don't think you can read Hangul or Hiragana. If i made false guess, plz
forgive me.

Have your ever tried to view Hangul or Hiragana on your browser?

(1) if you can see the proper Hangul or Hiragana, well, they also have their
standard fonts including non-standard fonts. But if you visited the page I
designed, you should not fail to see Hangul or Hiragana in standard &
well-adapted font.

(2) Although you couldn't see the proper Hangul or Hiragana, you should not
fail to see the western europe characters those which are assumed to be the
places for the unsupporting Hangul or Hiragana characters. Of course, those
western europe characters should be displayed in Time or Arial font style,
because I might have over-setted Arial & Times for the browsers which do not
support Hangul or Hiragana, but contain Times & Arial from the factory.

> > And CSS standard
> > is also well adapted around the world so that we shoud not fail to
> > fix the fonts
> > in an exact pixel size.( yes, CSS-styled fixed font size can not
> > changed by browser specific settings of font-size.)
> Second even if CSS overwrites browser specific settings it does not
> overwrite system settings like large fonts or high contrast for
> accessibility support.
> And last but not least: this still has nothing to do with Perl.
> *PLONK*

Oh, I'm sorry. I was not far-sighted to think of that! If I feel that's
needed, I'll start dealing with that.

But I think people from different settings such as system settings like
large fonts or high contrast for accessibility support well realise this
topic now does not include them yet. Of course, when I am asked by people
that why I do not develop Perl scripts of word-break for PDAs such as iPaq &
Palm, I only could tell them that this time I do not have any plan for PDAs
because PDAs do not support CSS as well as perl interpreter. Even though
people unconvincing my plan bark at me as you have done upto now, I can't
make any plan, discussion or topic for PDAs or system-settings which you
suggested.

If you're very lonely so that you're finding people talking with you, I'd
recommend you visit an asylum for the aged where many people are willing to
talk with you and play with you.

Hyungjin Ahn(ahj6@hotmail.com)

> jue
>
>




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

Date: Tue, 26 Nov 2002 23:09:33 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: need help assigning reference numbers
Message-Id: <pkent77tea-9BA6F8.23093026112002@news-text.blueyonder.co.uk>

In article <9b921b8d.0211261238.2f3bd33c@posting.google.com>,
 alanluc@rogers.com (flinky) wrote:

> currently working on a online form that needs to be tagged with a
> sequential reference number.  For example, if one person filled out
> the form and submit, that form will be 1. Another person filled it
> out, that will be 2, and so on.  Any help is appreciated, and an
> advance thanks for everyone!

Do they absolutely have to be an unbroken sequence of integers starting 
at 1? You could use Time::HiRes to get the current time, multiply by 
10^6 and very unlikely to get 2 people filling out the form at the same 
millisecond. Append a random number to work around this unlikely event.
If inserting the data into a decent database, enforce a uniqueness 
constraint on that column (possibly as the primary key, possibly not, 
depending on what you want) just to be Really Sure.

If you really have to start at 1 and go up by 1, you'll need to store 
the current value in a file which gets flock()ed read, updated, then 
un-flock()ed. This may become a bottleneck as different processes 
contend for the resource. If using a decent database you can just use a 
sequence too. For light usage this file won't be a bottleneck.

See:
   perldoc -q increment
for an example in incrementing a file. Although watch out for what 
happens if any of the steps fail - you don't want that file reverting to 
0!

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: Tue, 26 Nov 2002 15:19:36 -0800
From: "Tan Nguyen" <nospam@nospam.com>
Subject: Re: One more question about sockets...
Message-Id: <3de400ea_5@nopics.sjc>


"Extended Partition" <extendedpartition@NOSPAM.yahoo.com> wrote in message
news:3de3cde9_2@nntp2.nac.net...
[snipped]
A few things regarding Perl style:
- caps are treated as special things ex. constants
- no need of double quotes around a scalar variable
- use strict
- use warnings
- check errors

use strict;
use warnings;

sub doScan
{
     for (my $port = $START_PORT; $port <= $END_PORT; ++$port) {
           my $sock = new IO::Socket::INET(
                                                                  PeerAddr=>
$HST_ADDRESS,

PeerPort=>$THIS_PORT,

Proto=>'tcp'
                                                                ) or die
"cannot connect to $HST_ADDRESS:$port due to $!\n";
           print STDERR "connected\n";
    }
}




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

Date: Tue, 26 Nov 2002 23:53:13 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: One more question about sockets...
Message-Id: <x7el976g7r.fsf@mail.sysarch.com>

>>>>> "TN" == Tan Nguyen <nospam@nospam.com> writes:


  TN> sub doScan
  TN> {
  TN>      for (my $port = $START_PORT; $port <= $END_PORT; ++$port) {
  TN>            my $sock = new IO::Socket::INET(
  TN>                                                                   PeerAddr=>
  TN> $HST_ADDRESS,

  TN> PeerPort=>$THIS_PORT,
                ^^^^^^^^^^

should be $port.

and the : form is much neater for simple connections:

	my $sock = new IO::Socket::INET( "$HST_ADDRESS:$port" ) ;

uri

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


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

Date: Tue, 26 Nov 2002 15:12:53 -0800
From: "Tan Nguyen" <nospam@nospam.com>
Subject: Re: Out Of Memory while parsing CVS rlog output
Message-Id: <3de3ff57$1_1@nopics.sjc>


"Jacob" <Jacob.Schroeder@latitude.com> wrote in message
news:4497f1ad.0211261228.43e4f735@posting.google.com...
>  My CVS root directory is nearly 550 MB
> with thousands of files and folders.  If I run this command:
> cvs -n -d \\server\cvs\srcroot -rlog . > rlog_output.txt
> then rlog_output.txt is about 32.5 MB, which is large, but that may
> provide some information.
How much memory is there on your box? In case, you don't have enough memory
to hold the entire thing, you might want to check out DB_File etc.
Basically, you'll store stuff into the underlined database using tied hashes
with simple API.




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

Date: Tue, 26 Nov 2002 23:23:26 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Out Of Memory while parsing CVS rlog output
Message-Id: <pkent77tea-32063E.23232226112002@news-text.blueyonder.co.uk>

In article <4497f1ad.0211261228.43e4f735@posting.google.com>,
 Jacob.Schroeder@latitude.com (Jacob) wrote:

> I'm new to perl but I've been working on a script that will parse a
> large
> amount of text and while it's going through it, it will store data in
> a few
> different hashes I have (a one dimensional hash, and two-two
> dimensional
> hashes).  Once I read in all the data, I then sort the hashes and
> output all
> of this to a set of log files.
> 
> Here's the main chunk of my code that start the text coming in...
<snip>
>     }

OK, the perl keyword 'my' occurs twice in those n-hundred lines of code. 
Always keep the scope of your variables as tight as possible. 'my' helps 
you do that, and helps perl too.

You should say:

use strict;
use warnings;

too (or use -w on older perls) but maybe you just didn't paste that in 
your message. That'll give you an incredible amount of help.

> What happens is that when this is running, after maybe 30 minutes I
> get an error that just says "Out Of Memory!" and that's it.  It
> probably has something to do with the above loop because it never gets
> out of that loop before it runs out of memory (i know this by watching
> my debug print statements).  My CVS root directory is nearly 550 MB
> with thousands of files and folders.  If I run this command:
> cvs -n -d \\server\cvs\srcroot -rlog . > rlog_output.txt
> then rlog_output.txt is about 32.5 MB, which is large, but that may
> provide some information.

My guess is that your hashes are just growing and growing as you add 
information for each new file, and eventually when you need to add one 
more hash value, perl does a malloc() or equivalent and instead of some 
nice fresh memory it gets NULL (or equivalent).

Perhaps your current algorithm is not suited to such large amounts of 
data - remember that though the log file is 32 megabytes that MIGHT 
translate to a lot more memory used by perl.

If you're happy that you're only keeping stuff in memory that you NEED 
to keep, you could try tying those hashes to disk files. Then they won't 
be in memory. Use MLDBM for multilevel hashes; the other kinds of DBM 
files are I think only good for scalars.

OTOH, you could revise your algorithm to examine, say one CVS 
project/module at a time, and then append the output for that project. 
Keeps less stuff in core. If you want to build overall totals or 
summaries you only need to increment those values as you go along.

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: 26 Nov 2002 22:48:48 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Perl Service App?
Message-Id: <1038350928.628088@elaine.furryape.com>

In article <Xns92D261EE4682Ethisismyidtoken@195.92.193.157>,
Bob  <Bob@holiday.com> wrote:
>The Linux machine in question is my ISP's and so I don't think they'll 
>take too kindly to either:

You should talk to your ISP to find out what they recommend. All
the possible approaches have pro's and con's, and which one your
ISP prefers will vary depending on their restrictions. You really
don't want to choose an approach which will cause the most problems.



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

Date: Tue, 26 Nov 2002 17:04:20 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Wow! Differences between "unless" and if (!)
Message-Id: <slrnau7vfk.63l.tadmc@magna.augustmail.com>

Arvin Portlock <apollock11@hotmail.com> wrote:
> Aha! I have forgotten about the last expression evaluated deal.
> Thanks! Before I could believe you I had to write my own little
> test script to see for myself. Indeed,
> 
> print !"Hello world!\n";
> 
> Doesn't print anything.


That has nothing to do with the "last expression evaluated" deal.

The "last expression evaluated" applies to subroutine
definitions (not subroutine calls).

It doesn't print anything because of evaluating expressions,
whether last or not.

Try these:

   print !"Hello world!\n", "Goodbye!\n"; # no output from first

   print !"Hello world!\n", !"Goodbye!\n"; # no output from first or last



[snip TOFU]

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


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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


------------------------------
End of Perl-Users Digest V10 Issue 4184
***************************************


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