[12427] in Perl-Users-Digest
Perl-Users Digest, Issue: 6027 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 17 01:07:18 1999
Date: Wed, 16 Jun 99 22:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 16 Jun 1999 Volume: 8 Number: 6027
Today's topics:
Re: 'and' problem (Larry Rosler)
Re: a thread on threads <uri@sysarch.com>
Re: Afraid to ask about Y2K! (Lee)
Re: connect() and firewall (Abigail)
Re: cookies (Abigail)
Re: creating a chat room (Abigail)
Re: date formats (Abigail)
Re: Does Perl have a future? <watcher_q@my-deja.com>
Re: Fresh Newbie...Question (Abigail)
Help me I'm a dummy <woof@thegrid.net>
Re: how to connect to an Oracle database via a cgi scri (Abigail)
Re: howto delete an array of hash <rick.delaney@home.com>
Re: howto delete an array of hash <walton@frontiernet.net>
Re: Inclusive Split <walton@frontiernet.net>
Re: Inclusive Split (Tad McClellan)
Re: Inclusive Split (Tad McClellan)
Re: Is it better perl than awk ? <uri@sysarch.com>
Re: Is it better perl than awk ? <uri@sysarch.com>
Re: Is it better perl than awk ? (Ilya Zakharevich)
Re: MIcrosofts Attack on Perl <watcher_q@my-deja.com>
Re: MIcrosofts Attack on Perl (No Spam)
Re: newbie learning "my" declarations (Abigail)
Open2 with smbclient (Steven R. Evatt)
Personal Rant (was Re: Does Perl have a future?) <watcher_q@my-deja.com>
Re: Probably simple, but pulling hair out (Abigail)
put "symref is bad" in faq (was Re: my and interpolatio <uri@sysarch.com>
Q. 'Make' ing Modules on NT (Win32) <master@m.com>
Re: s and tr <rick.delaney@home.com>
Re: s and tr (Tad McClellan)
Re: Scripts Needed (Abigail)
Re: sending to html page... (Abigail)
Re: Surprise with .. operator in list context (Charles DeRykus)
Re: Win32::NetAdmin (Larry Rosler)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 16 Jun 1999 20:08:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 'and' problem
Message-Id: <MPG.11d2067b4d5beebd989bf3@nntp.hpl.hp.com>
In article <3767bf15@news.uk.ibm.net> on Wed, 16 Jun 1999 18:16:54
+0200, Vincent Vanbiervliet <vincent_vanbiervliet@be.ibm.com> says...
...
> And the really last remark is this:
> if you have a line saying something like:
> if (<condition>) {<one line of code>}
> you can write it like:
> <one line of code> if <condition>
> This frees you of all {,},( and )'s
> (The same goes for unless).
> So your code could become (if the 'exit' wouldn't have been there, that is,
> but maybe you could write the 'exit' in the function you're calling):
> &error_html_query_form unless (length($form_data{name}) or
> length($form_data{more_info}));
As you've gone to so much trouble to trim the code down, save even more
punctuation:
&error_html_query_form unless
length $form_data{name} || length $form_data{more_info};
> This frees you of all {,},( and )'s
Now your statement is true.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 17 Jun 1999 00:29:07 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: a thread on threads
Message-Id: <x7g13rcuwc.fsf@home.sysarch.com>
>>>>> "GB" == Greg Bartels <gbartels@xli.com> writes:
GB> Uri Guttman wrote:
>> in fact you could do all of this with a single state machine
>> which is easy to implement with refs to subs and hash tables.
GB> state-machines I understand very well, but in verilog or vhdl.
GB> could you point me to an example in perl that uses sub refs and
GB> hash tables?
there was a thread on this back in april. here is a link:
http://x36.deja.com/[ST_rn=ps]/viewthread.xp?AN=465687493&search=thread&svcclass=dnold&ST=PS&CONTEXT=929592672.1547501712&HIT_CONTEXT=929592672.1547501712&HIT_NUM=0&recnum=%3c371232C1.F32055D1@email.mot.com%3e%231/1&group=comp.lang.perl.misc&frpage=getdoc.xp&back=clarinet
(BTW how do some of you get a shorter deja link?)
GB> ok, so when I first tried to think of a solution, I came up with
GB> the idea of using something like goto statements whenever I needed
GB> to do a switch. but that got really messy really fast.
don't use regular goto in perl. a simple state machine is just a hash of
keys and sub refs for values:
%state = ( 'foo' => \&foo_sub, 'bar' => \&bae_sub, ... ) ;
the main loop gets a token (from an outside source or the last sub) and
dispatches to the sub hashed by the token. the sub can take some common
input args and could return the next state token and other state info.
if the states are integers, this could be an array of subs.
GB> I'm trying to imagine breaking it up into subroutines and how that
GB> would work.
whenever you hit a MYsleep, replace it with a return of a state
token. the code after MYsleep gets put into another sub with that toekn
as the key. you could have the sleep time be returned to the main loop
also.
GB> I wont be writing the subs. The idea was to write a simulator
GB> so that it would be easy to prototype some hardware in perl.
GB> that was why I gave up on the goto approach, because people
GB> using the simulator would have to keep track of all
GB> the gotos and whatever.
i don't understand this problem. just define a state as a sub with a
very specified calling setup and return values. you can simulate
anything with a well written state machine. for more on theory read
"computation: finite and infinite state machines" by marvin minsky, a
classic in the field.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Wed, 16 Jun 1999 23:19:37 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <B38DE1899668E9DBB@204.112.166.88>
In article <7k9ecd$sg7$1@shell1.ncal.verio.com>,
gerg@shell.ncal.verio.com (Greg Andrews) wrote:
>tchrist@mox.perl.com (Tom Christiansen) writes:
>> [courtesy cc of this posting mailed to cited author]
>>
>>In comp.lang.perl.misc,
>> "J|rgen Exner" <juex@my-dejanews.com> writes:
>>:Is there anything wrong with 31.Dez, 24:00 being the same as 01.Jan, 00:00 ?
>>
>>You can't have 24:00 -- that's out of the valid range. Hours are
>>guaranteed less than 24. After 11:59:59pm comes 12:00:00midnight.
>>
>
>Except when a leap second creates 23:59:59, followed
>by 23:59:60 and then 00:00:00.
Is the domain of this discussion computational?
POSIX declares that leap seconds shall not be reckoned.
Lee
------------------------------
Date: 16 Jun 1999 18:48:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: connect() and firewall
Message-Id: <slrn7mgef5.ejb.abigail@alexandra.delanet.com>
Marco Lazar (lazar@micro.ti.com) wrote on MMCXV September MCMXCIII in
<URL:news:3767D887.1427175@micro.ti.com>:
``
`` So how do I get through the firewall ?
You bribe your sysadmin.
Abigail
--
perl -we 'print split /(?=(.*))/s => "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: 16 Jun 1999 19:26:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: cookies
Message-Id: <slrn7mgglj.ejb.abigail@alexandra.delanet.com>
Leonid Goltser (leonid76@erols.com) wrote on MMCXV September MCMXCIII in
<URL:news:7k8vk8$co4$1@autumn.news.rcn.net>:
() Where can I find a tutoring about creating cookies with perl?
Here's one, but it beats me what cookies have to do with Perl.
TOASTED-COCONUT COOKIES
1 1/2 cups sweetened flaked coconut
1 1/4 cups all-purpose flour
1 teaspoon baking soda
1/2 teaspoon salt
1 1/4 sticks (1/2 cup plus 2 tablespoons) unsalted butter, softened
1/2 cup packed light brown sugar
1/4 cup granulated sugar
1 large egg
1 teaspoon vanilla
Preheat oven to 3750F.
In a shallow baking pan spread coconut evenly and lightly toast in
middle of oven, stirring once, until pale golden, 4 to 5 minutes. Cool
coconut.
Into a small bowl sift together flour, baking soda, and salt. In a
large bowl with an electric mixer beat together butter and sugars
until light and fluffy. Beat in egg and vanilla and stir in flour
mixture and coconut until combined well.
Arrange teaspoons of dough about 1 inches apart on ungreased baking
sheets and bake in batches in middle of oven until golden, 8 to 10
minutes. Cool cookies on sheets 1 minute and with a metal spatula
transfer to racks to cool. Cookies keep in an airtight container at
room temperature 1 week.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== 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: 16 Jun 1999 18:49:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: creating a chat room
Message-Id: <slrn7mgeh0.ejb.abigail@alexandra.delanet.com>
dhulnick@my-deja.com (dhulnick@my-deja.com) wrote on MMCXV September
MCMXCIII in <URL:news:7k8rrn$sm3$1@nnrp1.deja.com>:
== I would like to create a question and answer forum chatroom, where the
== user sends the question, then a moderator receives it, checks for
== appropriateness and then sends it on the the person who answers it who
== then posts the answers up -- this will be a live sort of conference --
==
== how should i go about doing this?
How about hiring a programmer?
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
-----------== 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: 16 Jun 1999 19:32:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: date formats
Message-Id: <slrn7mgh11.ejb.abigail@alexandra.delanet.com>
Lee (rlb@intrinsix.ca) wrote on MMCXV September MCMXCIII in
<URL:news:B38D50BB9668847178@204.112.166.88>:
"" In article <3767ADCD.A1E1DBF3@ateb.com>,
"" Emily Latham <frog@ateb.com> wrote:
""
"" >Just so all of you know and can stop acting as though I am a complete
"" >moron.
""
"" Nothing personal, Emily.
""
"" They do it to each other, too. :)
No we don't, you moron. ;)
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== 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: Thu, 17 Jun 1999 02:50:26 GMT
From: Watcher <watcher_q@my-deja.com>
Subject: Re: Does Perl have a future?
Message-Id: <7k9npf$724$1@nnrp1.deja.com>
In article <376357a4.30579140@news.earthlink.net>,
tchristian7@yahoo.com (Christian Ahkman) wrote:
<munched>
> Perl obviously "has a future" for many tasks, so let me be more
> specific. Does perl have a future on the web server? I used to write
> perl/CGI stuff but have been out of the perl world for the past year
> or so. Just as scripting languages like VBScript and JavaScript are
> being ursurped by ActiveX COM on IIS, I am wondering if JavaBeans and
> servlets are really going to ursurp Perl/CGI on UNIX??
I'm currently in a project that uses Java servlet extensively. In
fact, from what my colleague who had gone for some Java conference, it
is the most complex project that he had heard, that is written in
Java. This took place waaaay before I came onboard, so I can't take
the blame :)
The problem is that Java on server side is still very immature. Its
JDBC drivers are pathetic to say the least, when compared to C++
database access options. Even when compared to perl, it is still below
par.
The performance of the servlet depends totally on the performance of
Java on the platform. When we tried to move something from Solaris to
FreeBSD (which have the slowest Java performance rated by Volcano), the
performance dropped to 0.1x even after you compensate for the
difference in the memory, processor, etc.
Perl OTOH, is much more mature on many platform. I have yet to see
this amount of performance drop before.
Now, MS heard about our project and wanted to squeeze in. They
championed MS's solution, to use ASP, COM/COM+, MTS, MSMQ, etc to do
the job, even offering to provide large discounts.
But nothing compares to the speed of developement in Perl.
> Of course, Sun claims that Perl/CGI is dead and that JavaBeans is the
> future of server side web development for UNIX. Are people seeing
> this happen? Java's slow death on the client side of the web has
> really forced Sun to try to make Java viable on the server (esp. in
> the face of ActiveX from M$).
People might just try those new-fangled stuff. However, if there is no
advantage, then back to the ole-tried-and-true solutions like perl. As
for the part of the "slow death", I do agree (see my other posting).
<munched>
Watcher
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 16 Jun 1999 19:33:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Fresh Newbie...Question
Message-Id: <slrn7mgh35.ejb.abigail@alexandra.delanet.com>
Franklin Edward Sadler (gte482i@prism.gatech.edu) wrote on MMCXV
September MCMXCIII in <URL:news:7k8ni0$86v@catapult.gatech.edu>:
-- Ok...First off Im a newbie at PERL (started yesterday). My question is how
-- do u access double arrays??? Like $array[a,b]; or $array[a][b]; or
-- neither???
Why don't you check the manual? It's very helpful, and has lots of
answers, including the one about multi-dimensional arrays.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== 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: Wed, 16 Jun 1999 21:34:15 -0700
From: Bill & Carrie <woof@thegrid.net>
Subject: Help me I'm a dummy
Message-Id: <37687AC7.56DEAA19@thegrid.net>
I am using a perl script that "prints" out a html file.
All works fine except I would like to edit out some of the body of the
html file
The script forms the <head></head>
then the <body>
then prints a variable that contains the entire text of the html file
$text
$text is set by the line ($text="finger $info")
I would like to know how to search $text until I match a certain string
then
only print what comes after that string (or line)
Any help will be greatly appreciated
------------------------------
Date: 16 Jun 1999 18:53:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to connect to an Oracle database via a cgi script written in Perl
Message-Id: <slrn7mgeov.ejb.abigail@alexandra.delanet.com>
Todd Moore (todd.s.moore@boeing.com) wrote on MMCXV September MCMXCIII in
<URL:news:376818E2.2E4C2A4A@boeing.com>:
~~ Does anyone know how to connect to an Oracle database via a cgi script
~~ written in Perl without using DBD:Oracle or Oraperl?
~~ Can it be done using SQL*Plus?
~~ I have perl, sql*plus and oracle on a server. I can't install
~~ DBD:Oracle or Oraperl or any module...because I'm not the server
~~ administrator. They're not very cooperative.
What makes you think you need to be an administrator to install a module?
What would you do if you wrote a module + program?
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== 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: Thu, 17 Jun 1999 03:08:36 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: howto delete an array of hash
Message-Id: <37686670.CB60453@home.com>
[posted & mailed]
Jin Lu wrote:
>
> e.g. I have a array of hash, such as $array[$n]{$key}=value.
> Could I delete the whole slice $n, like this $array[$n]=()?
WHWYTI?
(What happened when you tried it?)
That will remove the reference to your hash that was stored in
$array[$n] which is probably what you want.
> or I have to delete each $key inside of $array[$n] so that I could null
> return of %{$array[$n]}?
If you want to erase all elements from the hash referred to by
$array[$n] then you might want to try
undef %{$array[$n]}
but you'd probably be better off just removing the reference to it.
Then just test for it:
if (ref $array[$n] eq 'HASH') {
# do something with %{$array[$n]}
}
else {
# do something with ()
}
The actual hash will be cleared when it goes out of scope which might be
with the deletion of this reference.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 16 Jun 1999 23:29:25 -0400
From: Bob Walton <walton@frontiernet.net>
To: Jin Lu <luj@carbon.dmpc.com>
Subject: Re: howto delete an array of hash
Message-Id: <37686B95.21B2562A@frontiernet.net>
You want splice:
use Data::Dumper;
$array[0]{key}='value';
$array[0]{key1}='value1';
$array[1]{key2}='value2';
$array[1]{key3}='value3';
$array[2]{key4}='value4';
$array[2]{key5}='value5';
$array[3]{key6}='value6';
$array[3]{key7}='value7';
print Dumper(\@array);
splice @array,1,1;
print Dumper(\@array);
generates:
$VAR1 = [
{
'key' => 'value',
'key1' => 'value1'
},
{
'key2' => 'value2',
'key3' => 'value3'
},
{
'key4' => 'value4',
'key5' => 'value5'
},
{
'key7' => 'value7',
'key6' => 'value6'
}
];
$VAR1 = [
{
'key' => 'value',
'key1' => 'value1'
},
{
'key4' => 'value4',
'key5' => 'value5'
},
{
'key7' => 'value7',
'key6' => 'value6'
}
];
Jin Lu wrote:
> HI,
> I really need to delete one slice of an array of hash or hash key words.
> I don't know whether undef works or not.
> e.g. I have a array of hash, such as $array[$n]{$key}=value.
> Could I delete the whole slice $n, like this $array[$n]=()?
> or I have to delete each $key inside of $array[$n] so that I could null
> return of %{$array[$n]}?
> Many thanks if you can shed some lights on how to delete or nullify the
> array of hash data structure.
>
> Sincerely,
>
> Jin
>
> Jin Lu
> Dupont Pharmaceuticals
> Experimental Station E336/259
> Wilmington, DE 19880
> Phone: 302-695-6727
> FAX: 302-695-9420
> email: JIN.LU@dupontpharma.com
------------------------------
Date: Thu, 17 Jun 1999 00:11:08 -0400
From: Bob Walton <walton@frontiernet.net>
To: Ashish Kadakia <anonymous@web.remarq.com>
Subject: Re: Inclusive Split
Message-Id: <3768755B.B2C09206@frontiernet.net>
How about:
use Data::Dumper;
$itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
<Y>itemB2</Y>............";
while($itemstring=~/<X>([^<]*)<\/X>/g){push @item1,$1;}
while($itemstring=~/<([XY])>([^<]*)<\/[XY]>/g){push @item2,$2;}
%item2=@item2;
print Dumper(\@item1);
print Dumper(\%item2);
This generates:
$VAR1 = [
'itemA1',
'itemB1'
];
$VAR1 = {
'itemA1' => 'itemA2',
'itemB1' => 'itemB2'
};
which I think is what you want. The presence of whitespace or of anything other than
an <X> or <Y> tag between tag pairs is irrelevant to this code.
Ashish Kadakia wrote:
> Hi, I have simple split question:
> I have the data in variable in form of
>
> $itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
> <Y>itemB2</Y>............".
>
> I want to put this data in array
> @item1 = (itemA1,itemB1,itemC1,..);
> %item2 = (itemA1,itemA2,itemB1,itemB2...)
>
> In $itemstring there may or many not be "space" between
> </X> and <Y> or between </Y> and <X>
>
> Please help me.
> Thanks
>
> **** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Wed, 16 Jun 1999 19:00:23 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Inclusive Split
Message-Id: <7aa9k7.qih.ln@magna.metronet.com>
Ashish Kadakia (anonymous@web.remarq.com) wrote:
: Hi, I have simple split question:
So what _is_ your question?
I read the below three times, and I can't find a question
in there.
What is the "Inclusive" meant to denote?
Where is the code you have so far?
: I have the data in variable in form of
: $itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
: <Y>itemB2</Y>............".
: I want to put this data in array
: @item1 = (itemA1,itemB1,itemC1,..);
: %item2 = (itemA1,itemA2,itemB1,itemB2...)
: In $itemstring there may or many not be "space" between
: </X> and <Y> or between </Y> and <X>
: Please help me.
I think you don't have a question.
I think you are asking for someone to write the code for you.
while ( $itemstring =~ m#<X>(.*?)</X>\s*<Y>(.*?)</Y>#g ) {
push @item1, $1;
$item2{$1} = $2;
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 16 Jun 1999 19:22:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Inclusive Split
Message-Id: <vjb9k7.elh.ln@magna.metronet.com>
Ashish Kadakia (anonymous@web.remarq.com) wrote:
: some how it deleted angle brackets in original post
No it didn't.
The original post looked fine.
If you are not using a newsreader to read news, then I can
see where you might think the angle brackets went away.
Do you pound nails with a wrench too?
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Jun 1999 23:30:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Is it better perl than awk ?
Message-Id: <x7pv2vcxlc.fsf@home.sysarch.com>
>>>>> "MM" == Michael Mauch <michael.mauch@gmx.de> writes:
MM> Uri Guttman <uri@sysarch.com> wrote:
>> perl can emulate the awk loop
>> (-n option) but it is a true general purpose language. as such
>> perl is much bigger and it has a massive public library of code and goes
>> many places awk never dreams about.
MM> That's surely true, but on the other hand, you have to install/carry
MM> along all those libraries. Awk is just one small binary, whereas Perl has
MM> lots of libraries accompanying it.
not if you don't need them. many of my short perl programs use no
modules. and to use the full power of perl you need the libraries so
that is not an issue. if you want them you have them. awk is bare bones
in that regard.
but as i said this is a silly thread. i know both very well and much
prefer perl. i am a perl hacker by choice and i would love to do most of
my work in perl. i only used awk as one of many unix tools; it is just
one of the more flexible ones as compared to cut, sed, etc.
and you can't get work as an awk hacker. :-)
(say "awk hacker" 3 times fast)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 16 Jun 1999 23:41:06 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Is it better perl than awk ?
Message-Id: <x7n1xzcx4d.fsf@home.sysarch.com>
>>>>> "KM" == Kenny McCormack <gazelle@yin.interaccess.com> writes:
KM> In article <x7emjcdko5.fsf@home.sysarch.com>,
KM> Uri Guttman <uri@sysarch.com> wrote:
KM> ....
>> i don't want this to become a flame war like we have seen with perl
>> vs. (python, lisp, c++, your favorite langauge).
KM> So then, why are we?
i don't know.
>> perl and awk/sed don't
>> even occupy the same problem space so comparing them is moot.
KM> Oh, please, do say more. Actually, I do kinda know what you mean -
KM> which is that perl has evolved, both in terms of its applications and
KM> its image, from its roots as a "bigger, better, AWK" to being a general
KM> purpose programming language (essentially, a "smaller, leaner, [*] C")
i don't get how you call it leaner than c. one good view of perl is what
larry wall says: perl is unix distilled. it has stuff from awk, sed, c,
unix libs, unix kernel calls, etc. yes it is a kitchen sink (or as we
say, a swiss army chainsaw) but that is part of its charm and
purpose. you don't have to leave perl to get most things done. with awk
and unix tools, you have to glue stuff together in shells. in perl, the
language is the work AND glue in one.
KM> But don't forget what PERL, the acronym, stands for.
KM> I'd be just as happy if Perl were never discussed in the AWK newsgroup,
KM> but the fact of the matter is that it is frequently used to solve the
KM> same sorts of problems as is AWK, so the comparisons are inevitable.
not really. try writing in awk a client or server or cgi or direct
database access or you get what i mean. the power of the base language
is great and when you add cpan it becomes a world dominator. it just
does the job.
there are plenty of perl haters and that is fine with me. no language
suits all. but perl's problem space dwarfs awk so comapring them is
really pointless. if you like awk and are fluent, it is a good tool. i
used awk a lot and respect it for when it helped me. i don't need to use
it anymore and i wouldn't choose it either. i don't even do much shell
scripting unless i call other programs. perl can do it all for me just
fine.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 17 Jun 1999 04:50:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Is it better perl than awk ?
Message-Id: <7k9uqg$ih1$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Harlan Grove
<HrlnGrv@aol.com>],
who wrote in article <7k9icu$59t$1@nnrp1.deja.com>:
> Jumping into the language wars, to get absolutely reductive, nothing
> beats assembler for absolute breadth - not even perl or C. Pity it
> isn't portable. Finally, awk does more PER BYTE OF STORAGE TAKEN UP BY
> ITS BINARY EXECUTABLE than perl does.
Do not be ridiculous. Perl's executable is 4 times larger than
awk's. Do you try to imply that awk is only 4 times less powerful
than Perl?
Ilya
------------------------------
Date: Thu, 17 Jun 1999 02:16:57 GMT
From: Watcher <watcher_q@my-deja.com>
Subject: Re: MIcrosofts Attack on Perl
Message-Id: <7k9lqj$6e6$1@nnrp1.deja.com>
In article <37682431.451CB2A8@bridge.bst.bls.com>,
Steve Horne <steve.horne1@bridge.bst.bls.com> wrote:
> "Paul M. Parks" wrote:
> >
> > There are those of us who, when developing an application with
Visual C++,
> > prefer to drop the "Visual" altogether and use the language as it
was
> > intended. Don't count me out.
>
> Oh no, I tried to be careful to say that VC++ experience doesn't count
> against you. Usually, a few technical questions during an interview
> will separate the wheat from the chaff. I mean, as much as I _hate_
> Microsoft, I have used VC++ and it's a neat tool.
>
> I just don't want people to forget their penmanship now that they have
> Word. And that's the difference between C++ and VC++ to me...
Sigh,
This, I guess, occurs when the programmer does not think from the
algorithm side of things first (sorry, I'm a algo kind of guy). Just
treat C++ and VC++ as two languages (in terms of attitude), then it
would be quite easy to look for the appropriate (notice, not "right")
people. No doubt this is a kind of proof that MS had caused a split in
C++. But in practical terms, every different vendor's implementation
(Borlan^H^H^H^H^H^H Imprise, Symantec, etc) IS a split, though by a
varying degree.
Watcher
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 17 Jun 1999 03:28:42 GMT
From: no.ssppaamm@earthlink.net (No Spam)
Subject: Re: MIcrosofts Attack on Perl
Message-Id: <7k9q1a$5hi$1@nntp3.atl.mindspring.net>
In article <3767EB1B.17EDD666@bridge.bst.bls.com>,
steve.horne1@bridge.bst.bls.com says...
>
>Cameron Laird wrote:
>>
>> Exactly! I should have written "... defined by the
>> majority of recruiters ..." Your observations are
>> *precisely* what I intended to describe--the meaning
>> of "C++" has bifurcated in different work environments.
>
>Yes, I agree. It has always been an unfortunate aspect of this (and any
>technical) industry, in that the managers and recruiters and people who
>are ancillary to the technical side of software development simply don't
>understand the nuances of these kinds of issues. It is up to us to
>remind them.
>
I always get a kick when prospective pimps ask me if I have VC++. After I say
yes, they then ask me if I know MFC (??)
------------------------------
Date: 16 Jun 1999 18:47:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: newbie learning "my" declarations
Message-Id: <slrn7mgedj.ejb.abigail@alexandra.delanet.com>
Mark-Jason Dominus (mjd@op.net) wrote on MMCXV September MCMXCIII in
<URL:news:7k9860$bb8$1@monet.op.net>:
?? In article <FDFr7y.3JL@news.boeing.com>,
?? Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
?? >In article <7k8o7n$8sj$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
?? >> my $total = $total + 1;
?? >
?? >or, even: my $total += 1;
??
?? Yeah, but someone should point out that that's not at all the same as
?? what I said.
Let me point out that that's not at all the same as what he said.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== 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: Thu, 17 Jun 1999 04:28:51 GMT
From: steven@madduck.planetfall.com (Steven R. Evatt)
Subject: Open2 with smbclient
Message-Id: <slrn7mguc3.3nq.steven@madduck.planetfall.com>
Keywords: open2, smbclient, perl, pipe
Howdy folks!
I've been attempting to solve this problem for alomst a week by
reading four perl books and scouring the web. Any help would be
appreciated.
problem:
I would like to use a perl script to interface with smbclient.
Todate, when I use smbclient to open a connection, I read the
input waiting for the command prompt so I can send it a command.
However, the command prompt never comes and if I send a command
to early, I get a broken pipe error.
My code:
sub findfiles
{
my $addr = shift; # a number like 128.1.1.1
my $share = shift; # something like \\\\fooo\\bar
open(PS_WRITE, ">&STDOUT"); #dupe a filehandle for writing
open(PS_READ, ">&STDIN"); # dupe a filehandle for reading
open2(PS_READ, PS_WRITE,"smbclient", $share, "-I", $addr, "-N");
my @input = <PS_READ>;
print @input;
print PS_WRITE "ls\n";
my @input2 = <TWREAD>;
print @input2;
die "just checking \n"; #more code follows
}
If I try to but a while statement around my first @input = <PS_READ>
line, my side hangs forever waiting for a prompt.
I am confused.
Thanks in advanced!
Steven
------------------------------
Date: Thu, 17 Jun 1999 02:31:42 GMT
From: Watcher <watcher_q@my-deja.com>
Subject: Personal Rant (was Re: Does Perl have a future?)
Message-Id: <7k9mme$6mf$1@nnrp1.deja.com>
In article <37638c38.0@usenet.fccj.cc.fl.us>,
"Bill Jones" <bill@fccj.org> wrote:
> In article <376357a4.30579140@news.earthlink.net>,
tchristian7@yahoo.com
> (Christian Ahkman) wrote:
<munched>
> > Of course, Sun claims that Perl/CGI is dead and that JavaBeans is
the
> > future of server side web development for UNIX. Are people seeing
> > this happen? Java's slow death on the client side of the web has
> > really forced Sun to try to make Java viable on the server (esp. in
> > the face of ActiveX from M$).
>
> Sun is just worried...
> (Especially since JO (TCL God) left them to form Scriptics.)
Of course, Sun would say that they are the best. Which company won't?
Sun is course worried. If Java slips on the server side, its
importance will greatly diminished in the enterprise space. Then, the
only place that Java would exist would be in the device space (eg Jini,
etc).
> > Where does perl stand in all of this?
>
> Perl has a 'neutral' standing. It will evolve where
> these other operating systems will not...
Perl stands above these commercial posturing. It existed before Java,
and will exist (I hope) after Java becomes relegated.
<munched>
> Perl is slowly replacing the standard WWW functions
> more and more each day...
Precisely. There are already HTTP servers written in Perl...
> I wouldn't worry about Sun, as Linux gets better
> corporate support each week, Sun WILL start
> sounding like M$ more each day.
<rant>
What makes Sun different from MS? I just DON'T get it! Sun is no
savior, they are just another corporation, whose FIRST directive is to
earn money. What is there to stop Sun becoming just like MS? In fact,
I fear Sun more. If you think MS's strangle hold on the PC world is
bad, think about the future where every device in your house has
something that Sun build into it and that MOST embedded devices (not
only PCs) will pay some form of royalty to Sun.
</rant>
> I would say don't worry about M$ either, but
> they've proven to be a pain in the past, and
> will do so again ...
Leopards rarely changes its spots...
Watcher
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 16 Jun 1999 18:59:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Probably simple, but pulling hair out
Message-Id: <slrn7mgf37.ejb.abigail@alexandra.delanet.com>
Michael Hill (l463520@lmtas.lmco.com) wrote on MMCXV September MCMXCIII
in <URL:news:37682736.285DFBC2@lmtas.lmco.com>:
"" In my perl script I am trying to pass the value that is being stored to
"" my variable.
""
"" $myvalue="fresh";
"" print '<input type=hidden name="myfield" value=$myvalue>';
""
"" Of course what I get is $myvalue and not fresh.
Look up what '' do.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== 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: 16 Jun 1999 23:50:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: put "symref is bad" in faq (was Re: my and interpolation?)
Message-Id: <x7k8t3cwoj.fsf_-_@home.sysarch.com>
>>>>> "JS" == Jonathan Stowe <gellyfish@gellyfish.com> writes:
JS> Is it my imagination or has there been a plague of Symbolic References
JS> recently ? If so what has given rise to it just now - perhaps we should
JS> be asking people what made them think they wanted to do that.
read my recent post that it should be in the faq. i couldn't find
anything there about it being proscribed. somehow there either are books
or some source which shows symrefs or the newbies hear about perl being
able to do it, and then they ask how. as tom says, c can't do it so why
do they expect perl to?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 17 Jun 1999 03:44:55 +0100
From: "master" <master@m.com>
Subject: Q. 'Make' ing Modules on NT (Win32)
Message-Id: <7k9ndo$2fi$1@nclient1-gui.server.virgin.net>
Trying to install MSQL on NT.
Downloaded
App :
Msql Win32 server 2.09 (installed ok)
Modules :
Msql-Mysql-module-1.2200.tar.gz
DBI-1.09.tar.gz
Data-ShowTable-3.3.tar.gz
----------------------------------------------------------------------------
making these modules with nmake (ms c++) gives errors.
"perl makefile.pl" is OK
"nmake" looks OK
"nmake test" : Failed 17/17 test scripts, 0.00% okay. 12/12 subtests failed,
0.00% okay.
NMAKE : fatal error U1077: 'D:\Perl\5.00502\bin\MSWin32-x86-object\perl' :
retur
n code '0x2'
Stop.
This is where i get stuck with (ms) nmake.
----------------------------------------------------------------------------
with make (cygwin) i get errors from the first moment
make [ENTER]
Makefile:667: *** missing separator. Stop. "which is a TAB problem in
makefile"
if I place a tab in front of line 667 wih NOTEPAD
Makefile:668: *** missing separator. Stop.
if I place a tab in front of line 668 wih NOTEPAD
The name specified is not recognized as an
internal or external command, operable program or batch file.
make: *** [config] Error 1
This is where i get stuck with (cygwin) make
----------------------------------------------------------------------------
Is there any solution to the above??
Is there a 1off way of "make"ing modules??
Please remember, my platform is Windows NT.
I have easily installed DBI from activestates website, using ppm. That was
painless.
Is there a place where I could find these modules as packages (msql, and
data aren't on activestate's website)?
Is there a way of making modules install like packages?
Any suggestions appreciated. Thank you in advance.
PS. If any of the above questions seem naive please excuse me.
We are all, beginers somewhere at somepoint, however good we are in other
areas!!!!
I know I am a beginer in this area, and I know I am appealing to the more
advanced
users of perl.
------------------------------
Date: Thu, 17 Jun 1999 03:12:35 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: s and tr
Message-Id: <37686760.947F9D80@home.com>
[posted & mailed]
Matt wrote:
>
> I was thinking of doing something like
>
> s/// or tr/// but they can't have variables in them like s/$id//;
True of one but not the other.
perldoc perlop
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 16 Jun 1999 17:42:45 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: s and tr
Message-Id: <lo59k7.qih.ln@magna.metronet.com>
Matt (splinter@monmouth.com) wrote:
: s/// or tr/// but they can't have variables in them like s/$id//;
You certainly *cat* have variables in something like s/$id//
Show us the code where that does not work.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Jun 1999 19:01:04 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Scripts Needed
Message-Id: <slrn7mgf6a.ejb.abigail@alexandra.delanet.com>
Ky Luong (mage@infi.net) wrote on MMCXV September MCMXCIII in
<URL:news:7k8o4a$hap$1@nw003t.infi.net>:
.. http://www.gunowners.org/mailerx.html
..
.. Do anyone know where I can get a script like that from the above link?
Did you ask the people from the website?
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
-----------== 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: 16 Jun 1999 19:03:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: sending to html page...
Message-Id: <slrn7mgfb1.ejb.abigail@alexandra.delanet.com>
Jeff Bowers (jbowers@bsat.com) wrote on MMCXV September MCMXCIII in
<URL:news:3768018C.D1C3E582@bsat.com>:
&& I'm new to this newsgroup, so if this has come up before, forgive.
That's no excuse for not using dejanews.
&& Up to this point, we have been generating our HTML out of Perl for our
&& simple databases. Now we have a dynamic display of network throughput
&& which some don't think should be on the "common" net.
&&
&& I have written the script that requests an ID and a password (simple,
&& not very secure, but just to keep the
&& peasants away). The problem is the syntax to say "Yes your Password is
&& correct, here is your page".
print "Yes your Password is correct, here is your page";
&& We have tried many methods including a system command to cat the html
&& doc, to no avail.
&&
&& What (or where is) the scriptology to send a URL back to the browser?
That's not a Perl question. You would do the same as if your program was
coded in Simula-67. Please ask elsewhere.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== 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: Thu, 17 Jun 1999 02:32:15 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Surprise with .. operator in list context
Message-Id: <FDG9pr.9yM@news.boeing.com>
In article <7k88j4$8sg$1@lublin.zrz.tu-berlin.de>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Why does
>
>( chr( 0) .. chr( 26) )
>
>produce a list of length 1, only containing chr( 0)? Probably the
>++ operator is a work behind the scenes, which doesn't work for
>non-alphanumerics. Would someone know for sure?
>
With an amateur's peek at toke.c, I believe the range
operator's string magic extends only to [a-zA-Z].
hth,
--
Charles DeRykus
------------------------------
Date: Wed, 16 Jun 1999 20:33:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Win32::NetAdmin
Message-Id: <MPG.11d20c4eaa52176d989bf5@nntp.hpl.hp.com>
In article <37681CD4.FAEBCE77@mail.cor.epa.gov> on Wed, 16 Jun 1999
14:53:24 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> Chuck Hirstius wrote:
> >
> > I know WinNT is the lessor OS around here, but maybe someone can offer some
>
> Not *everyone* around here has the flexibility to avoid all OSes
> that offend their sensibilities.
ITYM inflexibility!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
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 6027
**************************************