[11432] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5032 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 2 11:17:31 1999

Date: Tue, 2 Mar 99 08:00:22 -0800
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, 2 Mar 1999     Volume: 8 Number: 5032

Today's topics:
    Re: -w && uninitialised value (Larry Rosler)
    Re: -w && uninitialised value <uri@home.sysarch.com>
    Re: cgi question <baughj@rpi.edu>
    Re: compiling perl progs to be unreadable <uri@home.sysarch.com>
    Re: compiling perl progs to be unreadable <droby@copyright.com>
    Re: Defining perl path (Tad McClellan)
    Re: Finding the word after a word (Tad McClellan)
        Form encoding & TCP/IP connections <andy@ricketts.freeserve.co.uk>
    Re: Form encoding & TCP/IP connections <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Hashes in Files (Greg Bacon)
    Re: Hashes in Files (AKBishop)
        HELP!! How to obtain html info by LWP ??? lufan@hotmail.com
    Re: How does one 'tie' a db file to a hash' <paxtond@ix.netcom.com>
    Re: HTML parse problem <correia@barebones.com>
        Module for configuration files? <Arnold_Mueller@csi.com>
    Re: not an array referecne?? (Randal L. Schwartz)
    Re: Pentium III Chips Released with IDs - Intel won't b <mtiller@ptrs14.srl.ford.com>
    Re: Pentium III Chips Released with IDs - Intel won't b <noway@nospam.com>
        Perl script to emulate communications program mr_potato_head@my-dejanews.com
        Search and Replace in Perl <disco181@my-dejanews.com>
    Re: sending associate array as argument (Greg Bacon)
        Standard for inline Perl in HTML? <chess@watson.ibm.com>
    Re: Standard for inline Perl in HTML? <sb@sdm.de>
    Re: Standard for inline Perl in HTML? <chess@watson.ibm.com>
        switch/case for Perl <occitan@esperanto.org>
    Re: switch/case for Perl (Sam Holden)
    Re: The truth about the Pentium III chip and ID --- **b <garry@sage.att.com>
        Using variables to call $dbh = DBI->connect method <gwolfe@lgc.com>
        Variables in regular expressions <kris.verbeeck@advalvas.be>
        Win32::Registry doesn't work??? <mckang@pacific.net.sg>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 2 Mar 1999 07:01:01 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: -w && uninitialised value
Message-Id: <MPG.11459cfd7d1a26f39896bf@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <pZMC2.5865$8N5.68922@typhoon-sf.pbi.net>, on Mon, 1 Mar 1999 
20:04:34 -0800 ekkis@arix.com says...
> In my code I often have references to environment variables which sometimes
> don't exist.  e.g.
> 
>     print "Debugging: " . $ENV{DEBUG};
> 
> when I run this with -w I get:
> 
> "Use of uninitialized value at XX.pm line XX, <STDIN> chunk 1."
> 
> how can I avoid this? it doesn't make sense to first assign values to all
> possible environment variables and I don't want to have to test for
> existence every time I use something just to avoid this error.

If you don't mind losing the distinction between undef, "", and 0, the 
following is a very simple way of obviating these warnings:

      print "Debugging: " . ($ENV{DEBUG} || "");

-- 
Larry Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 02 Mar 1999 10:17:55 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: -w && uninitialised value
Message-Id: <x7n21vex98.fsf@home.sysarch.com>

>>>>> "E" == Ekkis  <ekkis@arix.com> writes:

  E>     print "Debugging: " . $ENV{DEBUG};

  E> when I run this with -w I get:

  E> "Use of uninitialized value at XX.pm line XX, <STDIN> chunk 1."

  E> how can I avoid this? it doesn't make sense to first assign values to all
  E> possible environment variables and I don't want to have to test for
  E> existence every time I use something just to avoid this error.

there is no quick cure. you have to know that env values can be
undefined. one trick is to assign then to regular perl variables and
make those have defaults and then use them. either do this at one spot
or before the use of the env value.

$Debug = $ENV{DEBUG} ;
$Debug = 0 unless defined $Debug ;

     print "Debugging: $Debug\n";

hth,

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 02 Mar 1999 10:10:52 -0500
From: Justin Baugh <baughj@rpi.edu>
Subject: Re: cgi question
Message-Id: <36DBFF7C.7005060F@rpi.edu>

> Apparently you're trying to invoke a directory as a script.  Check your
> URL and contact your sysadmin.
> 

Actually, the error was a lot stupider than that.  I forgot that I
was having the CGI output stylesheets, and in one version of the
script I changed the global variable $location to $stylesheet, but
forgot to change it in one area.  Strangely enough...even with -w
on, Perl didn't yell about using a undefined.

i.e I had something like this:

<link rel="stylesheet" href="$location" type="text/css">  

which of course was being output as

<link rel="stylesheet" href="" type="text/css">

Netscape, when attempting to load the CGI, freaks out because it can't
find the CSS, tries to access the parent directory, and gets a 403.  
Lynx obviously doesn't care, and IE loads regardless of whether it finds
the style sheet (IIRC, Netscape will not load a page if a link tag is
given specifying an invalid style sheet).

A pretty stupid error, and now I'm embarrased I even wasted the 
group's time with it!


Cheers,

-jdb

-- 
************************************
Justin D. Baugh - CompSci@RPI (2001)
email baughj at rpi dot edu
"Reality is that which, when you stop believing in it,
 is still there." - Philip K. Dick
"I am so hip I can't see over my pelvis." - Zaphod Beeblebrox
PGP Public Key available: http://www.rpi.edu/~baughj/pubkeys.html


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

Date: 02 Mar 1999 10:25:09 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: compiling perl progs to be unreadable
Message-Id: <x7k8wzewx6.fsf@home.sysarch.com>

>>>>> "s" == scamarena  <scamarena@interclan.net> writes:

  s> In article <x7vhgohkx4.fsf@home.sysarch.com>,
  s>   Uri Guttman <uri@home.sysarch.com> wrote:
  >> >>>>> "JS" == Jonathan Stowe <gellyfish@btinternet.com> writes:
  >> 
  >> 
  >> interesting thought. what if you did that on a perl2exe on winblows? it
  >> should also extract out the code. hell, you could just edit the binary
  >> on emacs and do that.

  s> I totally hate stupid comments on what they haven't even tried, nor
  s> have seen nor now absolutely nothing about what they are talking
  s> about.  perl2exe on Windows leaves it totally unreadable to the
  s> common user. You _CANNOT_ extract the code right out of the binary,
  s> not even if you edit it on the most powerfull text editor ever
  s> written.  Post a real solution or shut up.

i wasn't posting a solution dickhead. i was expressing the common
opinion that security thru obsfucation is stupid.

  >> about the only good way to do this is to write such bad code that
  >> no one in their right mind would use it, let alone steal it. if
  >> they do, the maintenance issues will be their punishment!

  s> Talk about stupidities...

well, you are the one who wants to do the stupid thing. i don't. i
tailored my suggestion so as to be right up your skill alley. i am sure
someone who wants to hide their work from prying eyes, write such bad
code they would never want anyone to see it. call it the medusa
effect. look at my code and you turn into a cobol programmer! that is a
very effective method of protecting your source from being seen.

have a very nice day.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 02 Mar 1999 15:29:29 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: compiling perl progs to be unreadable
Message-Id: <7bh04b$tmk$1@nnrp1.dejanews.com>

In article <x7vhgohkx4.fsf@home.sysarch.com>,
  Uri Guttman <uri@home.sysarch.com> wrote:
> >>>>> "JS" == Jonathan Stowe <gellyfish@btinternet.com> writes:
>
>   JS> On Tue, 23 Feb 1999 16:04:32 +0100 Arnold M|ller wrote:
>   >> I once found a tool called 'perl2exe' oder 'perltoexe' or sth.
>   JS> ...
>   >> Perhaps there are some UNIX-clones, too.
>   >> Hope you can find it.
>
>   JS> And if there is what happens when you run the pogram 'strings'
>   JS> against it ?
>
> interesting thought. what if you did that on a perl2exe on winblows? it
> should also extract out the code. hell, you could just edit the binary
> on emacs and do that.
>

Indeed an interesting thought.	Interesting enough that I downloaded the
thing and tried it.  But it looks to me like they must run something like
Greg Bacon's silly encrypting program before inserting it into the .exe.  The
strings command and emacs show plenty of text from the perl binary and from
libraries used, but none from the program I "compiled" with it.  Even
constant strings aren't there.

You can use emacs to change the evaluation copy notice though.  ;-)
(Now that I've been a bad boy and published that they'll probably hide that
string better too.)

I haven't sufficient interest to try further disassembly.

> about the only good way to do this is to write such bad code that no one
> in their right mind would use it, let alone steal it. if they do, the
> maintenance issues will be their punishment!
>

Unfortunately we'll also get some of this punishment.  I mean, really - no one
in their right mind would use scripts from a certain archive, but they keep
popping up here.

BTW, we should stop mentioning the name of that archive here.  That feeds its
popularity.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 2 Mar 1999 03:45:01 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Defining perl path
Message-Id: <de8gb7.l4q.ln@magna.metronet.com>

Paul Shinn (pshinn@mail2.sas.upenn.edu) wrote:
:    I'm trying to port a perl script that calls many modules and other 
: scripts.  When the big script doesn't see the smaller modules, it says it 
: cannot find those smaller scripts in the @INC file and lists 2 or 3 
: different perl paths.  Where is the @INC file (it's probably a symlink) 


   @INC is a strange looking, though legal, filename.

   But there is no file that tells perl where to look for modules.

   There is an *array* named @INC that does that though.


: and how can I modify it to also point to another path?


   use lib 'path/to/modules';


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 2 Mar 1999 03:48:00 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Finding the word after a word
Message-Id: <0k8gb7.l4q.ln@magna.metronet.com>

kalikste@uiuc.edu wrote:

: What is the most elegant way to extract the word after a specific word in a
: string (words seperated by one space)?


----------------------
#!/usr/bin/perl -w
use strict;

my $string = 'The quick brown fox jumps over the lazy dog';

my $word = 'brown';

print "'$1'\n" if $string =~ /$word (\S+)/;
----------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 02 Mar 1999 13:15:32 +0000
From: Andrew Ricketts <andy@ricketts.freeserve.co.uk>
Subject: Form encoding & TCP/IP connections
Message-Id: <36DBE474.A7C4C436@ricketts.freeserve.co.uk>

Hi All,

A couple of questions for you guys. Firstly, what's the regular
expression to convert all non-alphanumeric characters in a string into
there hex values? the same format as forms are sent in? i.e. "(test)" =
"%28test%29".

Secondly, does anyone know why when I run my gethttp program it hangs on
the "while (<S>)" and I have to break out of it, yet when I use my old
provider it works fine? do I have to setup the connection differently or
what? I am using Perl for Win32.

------------
#!/usr/bin/perl

$site = 'www.yahoo.com';
$port = '80';
$AF_INET = 2;
$SOCK_STREAM = 1;
$sockaddr = 'S n a4 x8';
($name, $aliases, $proto) = getprotobyname('tcp');
($name, $aliases, $type, $len, $thataddr) = gethostbyname($site);
$thisport = pack($sockaddr, $AF_INET, 0, $thisaddr);
$thatport = pack($sockaddr, $AF_INET, $port, $thataddr);
socket(S, $AF_INET, $SOCK_STREAM, $proto) || die "cannot create
socket\n";
bind(S, $thisport) || die "cannot bind socket\n";
connect(S, $thatport) || die "cannot connect socket\n";
select(S);
$| = 1;
select(STDOUT);
print(S "GET / HTTP/1.0\n\n");
while (<S>) {
	print;
}
exit;
------------

Any help would be much appreciated.

Andy.




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

Date: 02 Mar 1999 15:04:29 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Form encoding & TCP/IP connections
Message-Id: <83aexw3s42.fsf@vcpc.univie.ac.at>

Re: Form encoding & TCP/IP connections, Andrew
<andy@ricketts.freeserve.co.uk> said:

Andrew> Hi All, A couple of questions for you
Andrew> guys. Firstly, what's the regular expression
Andrew> to convert all non-alphanumeric characters
Andrew> in a string into there hex values? the same
Andrew> format as forms are sent in? i.e. "(test)" =
Andrew> "%28test%29".

Use the LWP module family, it's so much easier.

perldoc LWP
perldoc URI::URL for encoding of URLs.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 2 Mar 1999 14:43:09 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Hashes in Files
Message-Id: <7bgtdt$nt$1@info.uah.edu>

In article <19990302021746.11949.00003552@ng-cg1.aol.com>,
	akbishop@aol.com (AKBishop) writes:
: How would I go about saving a hash to a file and then loading it later.

Have a look at the MLDBM module.  It does this sort of thing for you.
You can find it on the CPAN at

    <URL:http://www.perl.com/CPAN/modules/by-module/MLDBM/>

Greg
-- 
We must believe in free will. We have no choice.


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

Date: 02 Mar 1999 15:16:01 GMT
From: akbishop@aol.com (AKBishop)
Subject: Re: Hashes in Files
Message-Id: <19990302101601.12471.00000949@ngol06.aol.com>

In article <7bgnd4$m6k$3@penthesilea.Materna.DE>, Juergen.Puenter@materna.de
(J|rgen P|nter) writes:

>># %keys is defined earlier
>>open(inv_keys, "> inv_keys.dat") || die "Couldn't open output file!\n";
>>print inv_keys %keys;
>>close (inv_keys);
>>
>>That seems to work, but I can't get them to load back into a hash properly.
>
>What have you tried so far? Have you looked at inv_keys.dat:
>what's in it after you ran your script?

open(inv_open, "inv_keys.dat") || die "Can't find inv_keys.dat\n";
%key = <inv_open>;
close(inv_open);
print STDOUT $key{'test_key'}; #looks for they key 'test_key'
                               #which should be there

Also, inv_keys.dat looks like this:
prnnhp7226prnrqms8604prnnhplj50prnhplj57prnnhp6725test_keyworksprnhpljiii2
prnrij2001prnrl10003

Thanks again,

AKBishop@aol.com
AKBishop@aol.com


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

Date: Tue, 02 Mar 1999 15:43:55 -0800
From: lufan@hotmail.com
Subject: HELP!! How to obtain html info by LWP ???
Message-Id: <36DC77BB.1ED7@hotmail.com>

Hi,

I need some code samples showing how the read the
head info of target html or other files (size, last update date,
etc). I use LWP, but fail to get the returned headers from
response. 

Do I need to perform a request first ?
thanks in advance ;)


lufan


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

Date: Tue, 02 Mar 1999 10:04:55 -0500
From: "J. Daniel Paxton" <paxtond@ix.netcom.com>
To: rjk@linguist.dartmouth.edu
Subject: Re: How does one 'tie' a db file to a hash'
Message-Id: <36DBFE13.86963B5A@ix.netcom.com>



Ronald J Kimball wrote:

> J. Daniel Paxton <paxtond@ix.netcom.com> wrote:
>
> [reordered for ease of response. :-) ]
>
> > But I don't understand the reference.  The error is at the same line where
> > the script will not tie the file to the hash.  Am I missing an argument?
>                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Um...  If you really can't answer that question yourself...  :-(
>
> > > > my $timesleft=tie %timesleft, "SDBM_File", "users.dbmx";
>                                      ^^^^^^^^^^^  ^^^^^^^^^^^^
>                                        dbtype       filename
>
> > Use of uninitialized value at WPS2.cgi line 17.
> > Usage: SDBM_File::TIEHASH(dbtype, filename, flags, mode) at WPS2.cgi line
>                             ^^^^^^  ^^^^^^^^  ^^^^^  ^^^^
> > 30.
> >
>
> You are, in fact, missing *two* arguments.  Refer to the documentation for
> SDBM_File.
>
> --

I have rewritten the line using DB_File:

my $timesleft=tie %timesleft, "DB_File", "users.db", O_RDWR|O_CREAT, 0644,
$DB_HASH or
die "Unable to open or create timesleft: $!" unless defined $timesleft;

and now have acquired a new error message:

Unable to open or create timesleft: Inappropriate file type or format at
WPS2.cgi line 30.

Why ?



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

Date: Tue, 02 Mar 1999 10:07:23 -0500
From: Jim Correia <correia@barebones.com>
Subject: Re: HTML parse problem
Message-Id: <correia-0203991007230001@dialup-209.244.225.37.boston2.level3.net>

In article <uvhgk6oe2.fsf@jimbosntserver.soundimages.co.uk>, Jim Brewer 
<jimbo@soundimages.co.uk> wrote:

> Jim Correia <correia@barebones.com> writes:
> 
> > Yes indeed.  I'd like to see the standards in question that require the 
> > quotes (XML doesn't count, since we aren't talking about XML).
> 
> The ISO SGML Standards, for a start. The quotes may be omitted when
> the attribute value contains only text characters (also as defined by
> ISO SGML) with no intervening white space. Attribute values which
> contain whitespace must be enclosed in quotes. Further, any attribute
> which contains multiple values must also be enclosed in quotes with
> each value seperated by a comma, whether or not whitespace is
> present. If the attribute value needs to contain a comma or a double
> quote, for example, the use of an entity will ensure the attribute
> will parse correctly.
> 
> Thus it is possible to properly parse the HTML (SGML) document. If in
> question, use a decent SGML parser, use the HTML DTD, and parse the
> HTML document in question. Irregularities will be duly noted.
> 
> Just becase Netscape/AOL or IEx render a readable document does not
> that document parsable make.

I agree entirely.  

Perhaps you missed the beginning of the thread.  Greg Ward claimed that the 
following was invalid:

   <a href=element1>element2</a>

It is perfectly valid HTML.

> Further, standards are standards. HTML and XML are both SGML
> applications. It stands to reason that SGML standards apply to both.

XML is a subset of SGML and doesn't support all of its features.  For 
instance, it doesn't support attribute minimization.  It requires all values 
be quoted, and is case sensitive.  That is why I was challenging the poster 
to point me at a standard that requires attributes be quoted (and 
specifically said that XML doesn't count; HTML isn't an application of XML 
(yet)).

-- 
Jim Correia                                Bare Bones Software, Inc.
correia@barebones.com                     <http://www.barebones.com>



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

Date: Tue, 2 Mar 1999 16:02:32 +0100
From: "Arnold M|ller" <Arnold_Mueller@csi.com>
Subject: Module for configuration files?
Message-Id: <On89B1LZ#GA.225@nih2naad.prod2.compuserve.com>

Hello. I just wondered whether there is a module for parsing configuration -
files. I think many programmers use them with their scripts. Mine are
usually like this:

[Project1]
Source=c:\Data\Foo
Dest=c:\Data\Bar
Suffix=.html
Errorcheck=No

[Project2]
Source=e:\Foo
Dest=e:\Bar

[Project3]
Source=c:\Data\ux\Foo
Dest=c:\Data\ux\Bar
Errorcheck=No

and so on. Each independent task to pe processed by the script starts with a
projectname in [].
The tricky part comes, when some of the options must be present in each
block (e.g. Source and Dest) and others are only optional (here: Errorcheck
and Suffix). Also the order of options shouldn't matter. And finally,
options over several lines should be allowed...

I thought there might be a module for this... any idea?

Thank you.

Arnold M|ller






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

Date: 02 Mar 1999 07:11:53 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: not an array referecne??
Message-Id: <m1u2w4ncxy.fsf@halfdome.holdit.com>

>>>>> "Peter" == Peter Bismuti <bismuti@cs.fsu.edu> writes:

Peter> $ip[$i]   = [ split(/\./,$line[2]) ];

Peter> ${$ip[$j+1]}[3]      OK
Peter>  {$ip[$j+1]}->[3]    NOT OK???  Error messate: Not a
Peter>                      reference to an array. 


Peter> I'm confused, I the first expression stores a hard
Peter> reference int the $ith element of the array ip.
Peter> The expression: {$ip[$j+1]} should evaluate to that 
Peter> reference which should in turn be able to be 
Peter> derenced by either expression.  

You want () not {} around that.  If you put {} around that, you are
creating an anonhash, then the ->[] is trying to deref it as a
listref, which is Bad News.

Somewhere in the past (hint: dejanews), I've answered a "randal's
simple guide to dereference syntax", but I'm not fully awake this
morning enough to look for it. :) I suggest you attempt, however, or
stare at "perldoc perlref" a little more.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 02 Mar 1999 08:30:54 -0500
From: Mike Tiller <mtiller@ptrs14.srl.ford.com>
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <2uilnhg3to1.fsf@ptrs14.srl.ford.com>

Christopher Nelson <chris@pinebush.com> writes:

> Kenny Chaffin wrote:
> 
> > Well you may not want to admit it, but it will affect you or your
> > customers/clients/company....
> > And as far as not buying it, that would be great if intel/microsoft
> > didn't have a monopoly on the pc market....
> 
> What monopoly? I've got an AMD chip in my PC.

Exactly.  Anybody who thinks Intel is a monopoly just doesn't know the
facts.

Just yesterday on CNN, they said, excluding business PCs, AMD sold
*more* processors than Intel for use in desktop PCs.  In fact, Intel
was recently downgraded by somebody because of projected lower profits
due to AMD.  The only good thing for Intel is that the FTC won't come
after them with an anti-trust lawsuit so long as this keeps up.

>                                              Chris
> -- 
> Rens-se-LEER is a county.  RENS-se-ler is a city.  R-P-I is a school!

-- 
Michael Tiller
Ford Motor Company


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

Date: Tue, 2 Mar 1999 06:53:01 -0800
From: "Bob Butler" <noway@nospam.com>
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <7bgu0v$91t@wellspring.us.dg.com>

Jon Helms wrote in message <36DB485A.79499011@purdue.edu>...
<cut>
> What are you trying to hide that you don't want people to have your CPU
ID?
<cut>

The argument that "if you have nothing to hide then you should not object to
being searched" has been used many times to take away the basic right to
privacy.  Sometimes the principle is more important than the specific
instance.  I would agree that there are reasons for having this and in the
particular case of CPU IDs I have mixed feelings and no decision yet.  The
above argument, however, is a strong case for fighting it.






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

Date: Tue, 02 Mar 1999 15:15:22 GMT
From: mr_potato_head@my-dejanews.com
Subject: Perl script to emulate communications program
Message-Id: <7bgva0$srl$1@nnrp1.dejanews.com>

hi,  I need to write a perl scripts that will run in a cron or term window,
send commands to the screen, wait for a response, if response is not received
in x seconds timeout, and capture all responses from the screen to a file.  I
need this script to run at night so a cron would be the prefered way to go. 
I'm not really sure how to send output to the screen and wait for a response
like crosstalk or procomm pluse for windows can.  I've tried using the print
command to send out commands but it didn't work.  Any help would be
appreciated. Thanks in advance...

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 02 Mar 1999 13:53:15 GMT
From: Disco <disco181@my-dejanews.com>
Subject: Search and Replace in Perl
Message-Id: <7bgqg7$odv$1@nnrp1.dejanews.com>

Help!

I'm in the middle of a project which requires me to perform a search and
replace on various HTML tags within a HTML document for reformatting purposes.
It seems like quite a simple task which I'm sure someone must have come up
against before. Is there a Perl module which will help me do this? Are there
any examples of code which will do this?

Thanks in advance.

D

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 2 Mar 1999 14:45:21 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: sending associate array as argument
Message-Id: <7bgti1$nt$2@info.uah.edu>

In article <7bg6eh$duk$1@tilde.csc.ti.com>,
	kthl@msg.ti.com (Thana Letchumi) writes:
: May I know how do I call another perl script with passing an argument
: (which is an associate array) from a perl script ?. 

Please read the perlsub manpage, paying careful attention when you
reach the "Pass by Reference" section.

Greg
-- 
Politics: Poli = Many, Tics = Blood-sucking parasites.


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

Date: Tue, 02 Mar 1999 14:09:34 GMT
From: David M. Chess <chess@watson.ibm.com>
Subject: Standard for inline Perl in HTML?
Message-Id: <7bgren$pcp$1@nnrp1.dejanews.com>

Is there any sort of nascent or semi standard (or even just existing
practice) for how you embed Perl within HTML?  I'm thinking of
something like JSP, only for Perl rather than Java.  As in

<p>
The wise words for today are:
<perl>$now = scalar localtime; `wisewords $now`;</perl>
<p>

or whatever.  The embedded Perl code would be executed on the
server, and the result would replace the entire <perl>...</perl>
section in the data sent to the client.  I'm sure you get the
idea!  *8)

Is anyone doing this?

DC

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 2 Mar 1999 14:30:11 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Standard for inline Perl in HTML?
Message-Id: <7bgslj$7rl$1@solti3.sdm.de>

In comp.lang.perl.misc David M. Chess <chess@watson.ibm.com> wrote:

> Is there any sort of nascent or semi standard (or even just existing
> practice) for how you embed Perl within HTML?  I'm thinking of
> something like JSP, only for Perl rather than Java.  As in

> <p>
> The wise words for today are:
> <perl>$now = scalar localtime; `wisewords $now`;</perl>
> <p>

> or whatever.  The embedded Perl code would be executed on the
> server, and the result would replace the entire <perl>...</perl>
> section in the data sent to the client.  I'm sure you get the
> idea!  *8)

> Is anyone doing this?

There are currently several solutions.

The first (and best, IMO) is ePerl from Ralf Engelschall.
See http://www.engelschall.com/sw/eperl/
 or http://www.perl.com/CPAN/authors/id/RSE/
It is written in C (thus it's fast) and you can choose yourself
what delimiters you want for tagging the Perl code.

Another solution is EmbPerl, and there's a third whose name I can't
remember right now.

Hope this helps.

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/download/    (Free Perl and C Software
    http://www.perl.com/CPAN/authors/id/STBEY/         for Download)
    New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
    http://www.oreilly.de/catalog/perlmodger/bnp.html


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

Date: Tue, 02 Mar 1999 15:36:59 GMT
From: David M. Chess <chess@watson.ibm.com>
Subject: Re: Standard for inline Perl in HTML?
Message-Id: <7bh0iq$u00$1@nnrp1.dejanews.com>

In article <7bgren$pcp$1@nnrp1.dejanews.com>,
  David M. Chess <chess@watson.ibm.com> cluelessly wrote:
> Is there any sort of nascent or semi standard (or even just existing
> practice) for how you embed Perl within HTML?

Various kind people have now pointed me at ePerl, embperl,
mod_perl, and "HotPerl".  Apparently I should have
searched on "embedded", not "inline", in my initial Web
research.  *8)

Of course, if anyone knows of any others and feels like adding
to the list...

DC

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 02 Mar 1999 15:07:57 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
To: larry@wall.org
Subject: switch/case for Perl
Message-Id: <7bgus4$sjh$1@nnrp1.dejanews.com>

Saluton retanoj!

I suppose this forum has seen the discussion before, but here goes:  I find
the lack of a switch/case statement rather annoying, and all of the
alternatives shown in the camel book are more than kludgy.  Perl being a
better language than others, it deserves a better switch-statement!

So, assuming C-like syntax, here is my idea of what it should look like.  The
switch part is similar to foreach, where the first variant locally stores the
scalar value in $_:

switch( scalar )
switch $variable ( scalar )

There would be four different ways of handling what comes after case:

- a number
  comparison is done with ==

- a regexp operator /re/, !/re/, s/re/xyz/, tr/chars/chars/
  obvious.

- an empty regexp //
  Match all, which is obviously the same as C's default-keyword.

- any other scalar, especially a string
  comparison is done with eq

To make the whole thing more comfortable, the case argument would be a list,
giving us a convenient member functionality.  Where .. is used, this could be
optimized to >= && <= for numbers or ge && le for other scalars.  Since ..
cannot handle floats, a mathematical [min, max] might be added?

If all case labels are literals, an efficient jump table approach as in other
languages would be used.  Else this would be similar to a cascade of elsif's
without blocks.  That is, order of the case labels should matter, such that if
it comes first, "case 5:" takes precedence over "case 1..9:".  Examples:

switch( $x ) {
  case @x:
    ...
    last;			# Perl's equivalent of break
  case 1:
    ...
    last;
  case 2:
    ...
    last;
  case 3..9:
    ...
    last;
  case s/^-/+/:
    ...				# $_ is changed, $x not
    last;
  case map { $_ * 2 } 5..20:
    ...				# Fall through to default
  case //:
    ...
}

switch $myvar ( myfunc ) {
  case 'a1'..'b9':
    ...
    last;
  case 'no way':		# same as case 'no way', 'maybe':
  case 'maybe':
    ...
    last;
  case /whatever/i:
    ...
    last;
  case tr/0-9//d:
    ...				# translation done on $myvar = myfunc
}

Best regards -- Daniel

http://beam.to/iPerl (new version coming in the next few weeks)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 2 Mar 1999 15:25:16 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: switch/case for Perl
Message-Id: <slrn7do0ms.o5s.sholden@pgrad.cs.usyd.edu.au>

On Tue, 02 Mar 1999 15:07:57 GMT, Daniel Pfeiffer <occitan@esperanto.org> wrote:
>Saluton retanoj!
>
>I suppose this forum has seen the discussion before, but here goes:  I find
>the lack of a switch/case statement rather annoying, and all of the
>alternatives shown in the camel book are more than kludgy.  Perl being a
>better language than others, it deserves a better switch-statement!
>
 ...
>switch( scalar )
>switch $variable ( scalar )
 ...
>- an empty regexp //
>  Match all, which is obviously the same as C's default-keyword.

Except of course this already has a well defined and useful meaning in perl
and overloading it to mean something else in this context is just wrong.

-- 
Sam

PC's are backwards ... throw them out! Linux is ok though.
	--Rob Pike (on the subject of CR/LF etc)


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

Date: Tue, 2 Mar 1999 14:17:09 GMT
From: Garry Hodgson <garry@sage.att.com>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36DBF2E5.E0803944@sage.att.com>

Ian Wild wrote:
> 
> JoHn DoH wrote:
> >
> > I beg to differ but MAC addressess are not made for spying on us they
> > are for network location and such.  No on knows that I own a certain
> > MAC  address (unlike Intel that wants you to register after getting the
> > PIII).  I think it is a bad move on intel's part but those that accept
> > it are doomed to get shafted.  Your ass not mine (I will keep my PI any
> > day running).  Sorry for the crossposting just got a little annoyed and
> > wanted it to be righted in all places of being.
> 
> For all but one of the newgroups listed, the obvious
> answer is to look to the sources.
> 
> If I suspect, say, Netscape of sending information
> I don't want published it's a simple matter to
> check the code and see if it's using some
> mysterious Intel-specific instructions.
> 
> Of course, the fact that I /can/ do this means
> I really don't have to, 'cos I trust a near
> infinite number of better-qualified trainspotters
> to have done it already.
> 
> Ah - the security of open source software.

i'd expect it won't take 5 minutes before some enterprising
person tweaks the code to send bogus ID numbers on demand.
sending them on wild goose chases is even more fun than
being stealthy.

code is power.

-- 
Garry Hodgson			comes a time
garry@sage.att.com		when the blind man
Software Innovation Services	takes your hand, says,
AT&T Labs			"don't you see?"


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

Date: Tue, 02 Mar 1999 08:36:40 -0700
From: Gene Wolfe <gwolfe@lgc.com>
Subject: Using variables to call $dbh = DBI->connect method
Message-Id: <36DC0588.41C6@lgc.com>

Hello World :-)

I'm tring to call the DBI-> connect mentod using text and variables,
rather that text alone, but I cannot seem to connect to the Oracle
server this way. Below are examples of perl that do and do not
work:

Does Work:
----------

$dbh = DBI->connect('dbi:Oracle:', q{dbo/manager@(DESCRIPTION=
	   (ADDRESS=(PROTOCOL=TCP)(HOST=134.132.7.1)(PORT=1521))
           (CONNECT_DATA=(SID=XXX1)))}, "");


Does Not Work:
--------------

# Open a handle to the database

#
# Test building handle to database using variables
#

$dbh = "DBI-\>connect('dbi:Oracle:', q{" . $user . "/" . $passwd .
       "@(DESCRIPTION=
        (ADDRESS=(PROTOCOL=TCP)(HOST=" . $host . ")(PORT=" .
        $port . "))
        (CONNECT_DATA=(SID=" . $sid . ")))}, \"\")";

Although both of the above appear to generate the same output text
string, the second example never connects with Oracle?

Any clues how to make the variable substitution work??

Cheers,

Gene The Machine - gwolfe@lgc.com


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

Date: 02 Mar 1999 16:46:35 +0100
From: Kris Verbeeck <kris.verbeeck@advalvas.be>
Subject: Variables in regular expressions
Message-Id: <m2r9r7hp2c.fsf@kn-10-0-21-140.kotnet.kuleuven.ac.be>


I have a full fledged regular expression in a variable:

	$MULTI_TAG = "\$<MULTIMAX=([0-9]+)>\$";

Now I want to use this regular expression in a matching, like this:

	$text =~ /^$MULTI_TAG/;

That doesn't work.  I tried prefixing the variable with "\Q" and
postfixing it with "\E", but that didn't work either.  I checked the
FAQ, but can't seem to find a good answer for my problem.  Can anyone
help me?

-------------------------------------------------------------
Student Master of Engineering -- Computer Science (last year)
http://www.kuleuven.ac.be        http://www.cs.kuleuven.ac.be
-------------------------------------------------------------
|  |_'    e-mail: airborne@ace.ulyssis.student.kuleuven.ac.be
 \_| |ris http://ace.ulyssis.student.kuleuven.ac.be/~airborne
=============================================================


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

Date: Tue, 02 Mar 1999 21:54:56 +0800
From: Meng-Chow Kang <mckang@pacific.net.sg>
Subject: Win32::Registry doesn't work???
Message-Id: <36DBEDB0.9CDC642F@pacific.net.sg>

I was trying out some of the Win32 Registry calls such as
RegOpenEx(), with the "use Win32::Registry;" statement in
the begining of the script file. But Perl returns with error
stating that the command RegOpenEx, and other Registry calls
are not defined.

What could be the problem? I am using ActivePerl 5.005_02
build for MSWin32-x86-object.

I browsed through the HTML documentation, and managed to
find those registry calls defined in the Win32API::Registry,
and they only (finally) worked when I use the following
statement (defined in the documentation, sypnosis section)
in the begining of the script file:

use Win32API::Registry 0.13 qw(:ALL); 

Why is it so?

Would appreciate any help.

Thanks,
Meng-Chow Kang


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5032
**************************************

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