[8345] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1962 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 24 04:08:04 1998

Date: Tue, 24 Feb 98 01:00:41 -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, 24 Feb 1998     Volume: 8 Number: 1962

Today's topics:
    Re: a match problem (bis) (Jonathan Feinberg)
    Re: A Pubilc Apology. (Kai Henningsen)
    Re: ANNOUNCE: Perl site from The Mining Company <rra@stanford.edu>
    Re: Cookies (Jonathan Feinberg)
    Re: Cookies (Abigail)
    Re: DBD/oracle, and LD_LIBRARY_PATH (John D Groenveld)
    Re: Detecting Video Settings (Peter Samuelson)
        glob again <sotireew@REMOVETHISdunx1.ocs.drexel.edu>
    Re: Help: Warning in string to number conversion. <rjk@coos.dartmouth.edu>
    Re: Help: Warning in string to number conversion. <rjk@coos.dartmouth.edu>
    Re: if (-d $filename) in Win32 (Martien Verbruggen)
        Installing Perl (Jeffrey A. Koester)
    Re: Killfile Triage (Iain Chalmers)
        Learnning Perl <MFabrico@ix.netcom.com>
    Re: Need some advice (Jonathan Feinberg)
        Not being able to run perl script on WinNt using Peer W <manohar.uchil@citicorp.com>
    Re: on reading FAQs and gurus answering questions (Kai Henningsen)
    Re: on reading FAQs and gurus answering questions (John Stanley)
    Re: Overwriting a entry in a file. (Michael Martin)
    Re: Perl and SMP... (Peter Samuelson)
        Perl HTML checker <jogoodma@indiana.edu>
        Perl subroutine call error msg... gbrock@email.sjsu.edu
    Re: Q: scalar @{[/$f/g]} (Damian Conway)
    Re: Regexp question... <daftary@cisco.com>
    Re: Runtime building of search expression <rjk@coos.dartmouth.edu>
        Safely running one-liners (Danny Aldham)
    Re: Uninitialized value chunk error <rjk@coos.dartmouth.edu>
    Re: why no Case statment? <merlyn@stonehenge.com>
    Re: Why not RegEx in $/? (Abigail)
    Re: Why PERL? [Re: Beginner in trouble] (Nathan V. Patwardhan)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 23 Feb 1998 20:27:42 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: a match problem (bis)
Message-Id: <MPG.f5bec1ccb27cd4f989740@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

wangli@nortel.ca said...
: #!/usr/bin/perl -w
: use strict;
: $pat = '/Foo$(xyz)';
: $str = '/A /B /Foo$(xyz) /c';
: print "ok\n" if $str =~ /$pat/;
: 
: please point out why the match does not work.  TIA
: background: perl  5.004_02 on NT

The code, as you've entered it here, will not even run.  You "use strict," but 
do not scope '$pat' or '$str'.  Where's the actual code you used?  Anyway, you 
need to say

    print "ok\n" if $str =~ /\Q$pat/;

which quotes the meta-characters in $pat.

Also, this has nothing to do with Tk, so I've removed that group from the 
followups.
-- 
#!/usr/bin/perl -w --                     Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: 24 Feb 1998 00:32:00 +0200
From: kaih=6oVIifHHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: A Pubilc Apology.
Message-Id: <6oVIifHHw-B@khms.westfalen.de>

chip@mail.atlantic.net (Chip Salzenberg)  wrote on 17.02.98 in <6cba09$2pu$1@cyprus.atlantic.net>:

> According to Russ Allbery <rra@stanford.edu>:
> >Chip Salzenberg <chip@mail.atlantic.net> writes:
> >> Any newsreader worth the bits it's recorded on has a search feature.
> >> For example, in trn, I say:
> >
> >>     /salzenberg/a
> >>     /chip@/a
> >
> >$salzenberg = 1;  # this line is here so that Chip will read my question
>
> No problem.  Flattery has its uses.  :-)

I wish I'd do that in Perl instead of Pascal. Then it'd be easy to add \b  
around it and searching for khms wouldn't turn up every tenth or so PGP  
sig or base64 post.

Unfortunately, rewriting this thing in Perl isn't as easy as I'd like it  
to be - handling complex datastructures in Perl is slower than I'd like.  
(And I don't have enough time to optimize it, even though I think I know  
how to do it, with a little .xs for the access to my msgid database.)

Oh well. It's not as if it's killing me.

ObPerlhack: Has anyone written a wildmat-to-Perl-regex-converter, or would  
anybody be interested in my clumsy attempts?

Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/


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

Date: 23 Feb 1998 20:50:03 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: ANNOUNCE: Perl site from The Mining Company
Message-Id: <m3ogzxr4hw.fsf@windlord.Stanford.EDU>

ralanfox <ralanfox@hotmail.com> writes:

> This is to announce the newest addition to the Mining Company web guide
> collection:

> http://perl.miningco.com

> This site features ORIGINAL content, Perl tutorials, and links to
> various Perl resources.

According to recent traffic on list-managers, this site has something of a
reputation for stealing content, taking other people's pages and putting
them up on miningco.com as if they were written locally (and adding ad
banners).

People who have written web pages about Perl may want to look over this
site and make sure that's not what's happening here.

I have no information to indicate that that is the case in this instance.
I am simply passing along complaints I have heard from others.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Mon, 23 Feb 1998 20:48:39 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Cookies
Message-Id: <MPG.f5bf0fd673186e9989742@news.concentric.net>

mjg@merck.com said...
: Careful, your platform is showing....
: 
: CGI.pm only comes with the Win32 port of Perl, and then only Gurusamy
: Sarathy's port.

*blush* 

-- 
Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: 24 Feb 1998 02:49:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Cookies
Message-Id: <6ctcf4$6u4$2@client3.news.psi.net>

Mark J. Gardner (mjg@merck.com) wrote on 1638 September 1993 in
<URL: news:34f21ec0.262987716@merck.com>:
++ On Sun, 22 Feb 1998 11:04:30 -0500, jdf@pobox.com (Jonathan Feinberg)
++ wrote:
++ [question about cookies that doesn't really belong in c.l.p.m deleted]
++ >Dutchie, mon, you need to use CGI.pm, which comes with excellent 
++ >documentation.  It provides the 'cookie' method, which makes trivial the 
++ >leaving and retrieving of cookies.  If you have perl5.004, then you've already 
++ >got CGI.pm.  If not, you should get perl5.004.  Hope this helps.
++ 
++ Careful, your platform is showing....

Oh yeah?

++ CGI.pm only comes with the Win32 port of Perl, and then only Gurusamy
++ Sarathy's port.

Realllllllly?

++ All the rest of us have to get it from CPAN.

Well, that's where we get perl from.

Perhaps you should upgrade to perl5.004:

$ tar tfvz perl5.004_04.tar.gz | grep CGI
-r--r--r-- timbo/staff  153617 1997-05-09 22:26 perl5.004_04/lib/CGI.pm
drwxrwsr-x timbo/staff       0 1997-10-15 09:46 perl5.004_04/lib/CGI/
-r--r--r-- timbo/staff    2396 1997-06-12 12:10 perl5.004_04/lib/CGI/Apache.pm
-r--r--r-- timbo/staff    6537 1997-03-29 18:39 perl5.004_04/lib/CGI/Carp.pm
-r--r--r-- timbo/staff    5408 1997-03-29 18:39 perl5.004_04/lib/CGI/Fast.pm
-r--r--r-- timbo/staff    7277 1997-06-11 19:20 perl5.004_04/lib/CGI/Push.pm
-r--r--r-- timbo/staff    1564 1997-03-29 18:39 perl5.004_04/lib/CGI/Switch.pm
$


HTH. HAND.


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]+Additional/s) [0]'


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

Date: 23 Feb 1998 23:44:01 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: DBD/oracle, and LD_LIBRARY_PATH
Message-Id: <6ctj6h$5qn$1@tholian.cse.psu.edu>

In article <6crcvh$2a3$1@delphi.et.tudelft.nl>,
T.J. Nijweide <tobias@socrates.et.tudelft.nl> wrote:
>DBD::Oracle was installed on a system with oracle in /oracle, and
>most other systems have oracle in /someotherhierarchy/oracle.

Relink DBD::Oracle with -R/someotherhierarchy/oracle/product/7.3.3/lib
John
groenveld@acm.org


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

Date: 23 Feb 1998 21:40:18 -0600
From: psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson)
Subject: Re: Detecting Video Settings
Message-Id: <6ctff2$vfq$1@sampo.creighton.edu>

  ["Jay Phillips" <jphillips1@email.msn.com>]
> > Does anyone know a way to extract the video settings from the
> > internet user so to customize the page format for different types
> > of displays?

If I understand correctly this is not about video settings -- see
below.  It also is most definitely not about Perl.

[Martien Verbruggen <mgjv@comdyn.com.au>]
> Ask them to upload their registry. Read it. Extract the information
> from it. Of course, it won't work if the connecting person doesn't
> have a PoB program loader.

No go.  You're assuming the person at the other end has his/her web
browser (this _is_ about a web browser, right?  Nobody specified)
maximized and that the browser is of a known type that will take up a
known number of pixels on each side.  This is no better than the old
"best viewed at 800x600..." tag lines.  You know, the ones that are
really saying, "My worldview has no room for people not running
Netscape on Windoze".

The real question is: why do you need this info at all?  Good HTML is
readable no matter what the end-user displays it on ... if you want to
make assumptions about screen size, you'll probably be making other
assumptions too -- like, for instance, that I'm using a graphical
browser ... that I auto-load images ... that I have a VESA-standard
resolution....

Sites that force me to load a GUI-based browser, which often forces me
first to load or at least page in a GUI, are annoying.

-- 
Peter Samuelson
<sampo.creighton.edu ! psamuels>


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

Date: Mon, 23 Feb 1998 23:36:20 -0500
From: Eugene Sotirescu <sotireew@REMOVETHISdunx1.ocs.drexel.edu>
Subject: glob again
Message-Id: <34f24c6d.0@news.dca.net>

I have a directory that contains some directories ending in a digit.

@dirs = glob ("$rootdir/*[1-9]");

successfully lists those directories.

However,

@dirs = glob ("$rootdir/*[!1-9]");

and

@dirs = glob ("$rootdir/*[\!1-9]"); (tried this one for csh)

return and empty list instead of the dirs NOT ending in a digit.

( ls $rootdir/*[!1-9] works as expected ).

Can anyone explain this behavior?

Thanks.

Eugene

(due to the erratic nature of my ISP's listserv, I'd appreciate it if
you ALSO replied by email)



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

Date: Mon, 23 Feb 1998 20:40:16 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: dmi@questrel.com
Subject: Re: Help: Warning in string to number conversion.
Message-Id: <34F22501.1A7EC56C@coos.dartmouth.edu>

[Posted and mailed]

Okay, I'm tired of waiting for Dean's post to appear in the newsgroup, so I'm
replying from the message which arrived in my in box.

Dean Inada <dmi@questrel.com> wrote:
> 
> In article <34F0A25E.1A97B5E@coos.dartmouth.edu> you write:
> 
> >On the other hand, I think the only way a string will convert to 1 is if it
> >matches this regex:
> >
> >/^\+?0*1(?:\.0*(?:\D|$)|[^\d.]|$)/
> >
> >(But there are probably cases I've missed in constructing it.  I had to
> >discard away several simpler versions.)
> 
> ' 1' =~ /^\+?0*1(?:\.0*(?:\D|$)|[^\d.]|$)/
> '1e1' =~ /^\+?0*1(?:\.0*(?:\D|$)|[^\d.]|$)/

Yup, there are cases I missed.  No surprises there.  :-)

Handling the whitespace is simple; just add a \s* to the regex.  Allowing
scientific notation was a bit trickier.

(($e = /^\s*\+?0*(.0*)?1e(\d+)/ and length($1) == $2) or
    (not $e and /^\s*\+?0*1(?:\.0*(?:\D|$)|[^\d.]|$)/))

Or, with a single regex:

(/^\s*\+?0*(?:(.0*)?1e(\d+)|1(?:\.0*(?:\D|$)|[^\d.]|$))/
   and ((not defined $2) or (length($1) == $2)))

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: Tue, 24 Feb 1998 00:35:54 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Help: Warning in string to number conversion.
Message-Id: <34F25C3C.ADFE9F71@coos.dartmouth.edu>

Chipmunk wrote:
> 
> Handling the whitespace is simple; just add a \s* to the regex.  Allowing
> scientific notation was a bit trickier.
> 
> (/^\s*\+?0*(?:(.0*)?1e(\d+)|1(?:\.0*(?:\D|$)|[^\d.]|$))/
>    and ((not defined $2) or (length($1) == $2)))

*Negative* exponents!  <bonk>  *Negative* exponents!  <bonk>

(/^\s*\+?0*                     # whitespace, plus, 0s
 (?:(.0*)?1e(\d+)|              # scientific notation, pos exponent
  1(0*)?(?:.0*)?e-(\d+)|        # scientific notation, neg exponent
  (1)(?:\.0*(?:\D|$)|[^\d.]|$)  # standard notation
  )/ix
 and ((defined $2 and length $1 == $2) or
      (defined $4 and length $3 == $4) or
      defined $5));

This is starting to get ugly.  :-)

(BTW, this doesn't address the problem of floating point precision. 
1.0000000000000001, for example, is converted to 1 on the system I'm testing on.)

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: 24 Feb 1998 04:38:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: if (-d $filename) in Win32
Message-Id: <6ctiso$agq$3@comdyn.comdyn.com.au>

In article <34F2204B.33F83013@coos.dartmouth.edu>,
	Chipmunk <rjk@coos.dartmouth.edu> writes:
> Jonathan Feinberg wrote:
>> 
>> webmaster@fccj.cc.fl.us said...
>> : print 'Still there as C:\Temp...' if (-d "c:\Temp");
>> 
>> You really have a folder called "c:Temp" ? (You didn't escape your backslash!)
> 
> Hmm...  That's cause he doesn't need to, in a single quoted string:

The single quotes are just the print statement. He's got double quotes
where it really matters.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 24 Feb 1998 04:45:34 GMT
From: loops@wwa.com (Jeffrey A. Koester)
Subject: Installing Perl
Message-Id: <6ctj9e$n12$1@hirame.wwa.com>

I'm trying to install Perl 5.004_04 on Aix 4.1.5
When I run the make it stops with the following

 
       Making DynaLoader (static)
Writing Makefile for DynaLoader
mkdir ../../lib/auto/DynaLoader
cp DynaLoader.pm ../../lib/DynaLoader.pm
AutoSplitting DynaLoader (../../lib/auto/DynaLoader)
        ../../miniperl "-I../../lib" "-I../../lib" -e 'use ExtUtils::Mksymlists;  Mksymlists("NAME" => "DynaLoader", "DL_FUNCS" => {  }, "DL_VARS" => []);'
        rm -rf ../../lib/auto/DynaLoader/DynaLoader.a
        ar cr ../../lib/auto/DynaLoader/DynaLoader.a DynaLoader.o && : ../../lib/auto/DynaLoader/DynaLoader.a
ar: A file or directory in the path name does not exist.
ar: 0707-117 The fopen system call failed on file DynaLoader.o.
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 2.


I'm not too familar installing with makefiles.  Any ideas what the problem is.


Loops


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

Date: Tue, 24 Feb 1998 13:53:52 +1100
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: Killfile Triage
Message-Id: <bigiain-ya02408000R2402981353520001@news.ozemail.com.au>

Tom Christiansen wrote, using the most wonderous OS on the planet<GRIN>:

<-snip->

> @mailing_lists = qw{
<-snip->
>     win32
<-snip->
> }; 


Am I reading this correctly?
Tom is on a win32 mailing list???

confused, or should that be "amused"? :-)

Iain Chalmers
bigiain@mightymedia.com.au


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

Date: Tue, 24 Feb 1998 00:05:28 -0500
From: Michael Fabrico <MFabrico@ix.netcom.com>
Subject: Learnning Perl
Message-Id: <34F25518.7C59A2EA@ix.netcom.com>

Hello:

  I'm VERY new to perl.  I have little programming skills...  Can anyone
help???

Michael Fabrico
mfabrico@ix.netcom.com




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

Date: Mon, 23 Feb 1998 21:19:59 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Need some advice
Message-Id: <MPG.f5bf85ac30f41ad989744@news.concentric.net>

pyefinch@b130.aone.net.au said...
: I have developed a bulk emailing script which will read our web database and
: email each of our customers in the database. For each record in the
: database, it simply checks for a valid email address etc and passes the data
                      ^^^^^^ ^^^ ^ ^^^^^ ^^^^^ ^^^^^^^
Them's fightin' words 'round these parts.  It can't really be done.

: It seems to work well except it does not send any response back to
: the browser until the script has completed.

You'll have to do a little research, but the idea is to make an nph script.  
Use CGI.pm, thus:

   use CGI qw/ :standard :nph /;

Some servers require you to name the script "nph-whatever.cgi" in order to 
expect the fancy headers...  Anyway, I'm leaving clpm territory, so I'll stick 
with tradition and exhort you to RTFM (CGI.pm, your server, etc.).  Oh yeah, 
remember to

   $|=1;

-- 
#!/usr/bin/perl -w --                     Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: Tue, 24 Feb 1998 10:56:04 +0530
From: Manohar Uchil <manohar.uchil@citicorp.com>
Subject: Not being able to run perl script on WinNt using Peer Web Server
Message-Id: <34F259EC.997ECEC1@citicorp.com>

I have installed Perl5.003 and the corresponding registry entries have
been modified (as a part of the installation process). I have placed a
perl  script(.pl file) at c:\inetpub\wwwroot and I am trying to run this
by calling this script through a post action in another file placed in
the same directory. The error code is 501.
Though this perl script is running fine from command prompt.

Please help.

Thanks.



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

Date: 23 Feb 1998 21:12:00 +0200
From: kaih=6oRIi3XXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6oRIi3XXw-B@khms.westfalen.de>

stanley@skyking.OCE.ORST.EDU (John Stanley)  wrote on 21.02.98 in <6cla3t$p6c$1@news.orst.edu>:

> One problem with that statement: people who mung their address aren't
> necessarily "ne'er-do-wells", they are people trying to deal with spam
> in a way that works. Surely, keep out ne'er-do-wells, but don't toss
> the baby with the bathwater.

People who mung there addresses *such that they no longer work* (very  
important point here) _are_ tossing out the baby with the bathwater.

Kai
--
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/


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

Date: 24 Feb 1998 08:41:22 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6cu13i$m46$1@news.orst.edu>

In article <6oRIi3XXw-B@khms.westfalen.de>,
Kai Henningsen <kaih=6oRIi3XXw-B@khms.westfalen.de> wrote:
>People who mung there addresses *such that they no longer work* (very  
>important point here) _are_ tossing out the baby with the bathwater.

Sorry, no. They are quite ready and willing to receive responses to
their articles, and nobody is prevented from responding. 



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

Date: 24 Feb 1998 01:16:53 GMT
From: dmmartin@home.net (Michael Martin)
Subject: Re: Overwriting a entry in a file.
Message-Id: <6ct725$nld$1@ha2.rdc1.sfba.home.com>

>I have opened a file and I am appending to it.

   For this to work you will need to just write to the file, not append

>My problem is that there is a chance a "similar" line will be ther.
>For example. I might have a line in the file something like this.
>
>10:Hours:23

<snip>

>But I don't want to dystroy any of the data above and below.
>
>can anyone help please?

sure, try:

open(FILE, ">>file.ext");  #open the file with read/write access
while(<FILE>){   #loop thru the file and as long as there is a line left assign 
                 #it to $_
s/$text_to_be_replaced/$replacement_text/i;  #replace $text_to_be_replaced with 
                                             #$replacement_text in $_
}
close(FILE);  #close file

HTH,

Philip Martin



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

Date: 23 Feb 1998 20:57:58 -0600
From: psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson)
Subject: Re: Perl and SMP...
Message-Id: <6ctcvm$vf1$1@sampo.creighton.edu>

[Vito Munoz <munoz@comswsys.tinkernet.af.mil>]
> I heard a rumor that SMP machines actualy run perl and other tasks
> slower under UNIX.

First, this is an operating system question, not a Perl question.

Second, how exactly do you mean that?

Slower under UNIX than under WinNT?
Slower under UNIX than non-SMP machines?
And which version(s) of UNIX?

That last question probably matters a lot.  Some Unices don't even have
SMP support.  On those, you'll find that they'll ignore all but the
first processor, with the expected performance.  Others might have
inefficient SMP support (WinNT comes to mind, not that it's UNIX) so
that your performance gain isn't what you expect.

But Perl is just like any other user app: if the underlying OS supports
multiprocessing, Perl should run faster just like any other app.

> I am wanting to take full potential of a SMP Digital Dual Pent Pro
> 200 that we have but the BOSS "heard" that etc......

Yeah, I understand.  Check the docs and/or web sites for whatever OS(s)
you plan to run.

--
Peter Samuelson
<sampo.creighton.edu ! psamuels>


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

Date: Tue, 24 Feb 1998 00:40:57 -0500
From: Josh Goodman <jogoodma@indiana.edu>
Subject: Perl HTML checker
Message-Id: <34F25D69.6C21D116@indiana.edu>

Does anyone know where I can get a perl script that checks for HTML
code errors in HTML documents?



Thanks,

Josh


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

Date: Mon, 23 Feb 1998 20:40:00 -0600
From: gbrock@email.sjsu.edu
Subject: Perl subroutine call error msg...
Message-Id: <6ctbu1$e9c$1@nnrp2.dejanews.com>

I was just curious if anybody could help me out.
I am writing a subroutine, but keep getting the run-time error:
   Undefined subroutine &main::sub_name called at ..., <STDIN> chunk 3.
What does this chunk mean?  I don't know why this is doing this,
I have made sure to require the function beforehand, and made
sure it returns a "1".  In fact, I checked it out with another program,
and the subroutine that gets called seems to be okay.
Can someone explain what this means?

Thanks for any help...

Gene Brock
gbrock@email.sjsu.edu

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 24 Feb 1998 03:42:45 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Q: scalar @{[/$f/g]}
Message-Id: <6ctfjl$gvs$1@towncrier.cc.monash.edu.au>

bart.mediamind@tornado.be (Bart Lateur) writes:

	>So assignment to () only serves to create a temporary list context.
	>Wouldn't it be time to dump this hack in favour of a "real" solution, a
	>new Perl keyword, the opposite of scalar?
	>ex.
	>	$e = array /$foo/g;

If you want this, why not just define:

	sub array { @_ }

Damian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 name: Damian Conway                         addr: School of Computer Science
email: damian@csse.monash.edu.au                      and Software Engineering
  web: http://www.cs.monash.edu.au/~damian         Monash University
  fax: +61-3-9905-5146                             Clayton 3168, AUSTRALIA


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

Date: Mon, 23 Feb 1998 20:19:25 -0800
From: "Kuntal M. Daftary" <daftary@cisco.com>
To: Spencer Lu <fake.address@no.spam.com>
Subject: Re: Regexp question...
Message-Id: <Pine.GSO.3.96.980223201728.14326I-100000@flipper.cisco.com>

On 22 Feb 1998, Spencer Lu wrote:

> I'm writing a perl script, and one of the things it does is remove
> all trailing spaces from all lines of a text file.  My initial attempt
> at this failed, and I'm not sure why.  Here is the relevant code:
>  
> while ($line = <FILE>) {
>   $line =~ s/^(.*) *\n/$1\n/;
>   $filestring = $filestring . $line;
> }


when simply used, * does greedy match which means that it tries to match as
much as it can.

when u say .*, the * tries to match as much of "anything but newline" and that
includes the trailing spaces. to find out more on greedy match and stingy
match, read up Tom's "what makes perl regexps dynamite" on CPAN archives.

Kuntal Daftary
1.408.527.9789
daftary@cisco.com



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

Date: Mon, 23 Feb 1998 20:48:58 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Timothy Loy <loyt@aals27.alcatel.com.au>
Subject: Re: Runtime building of search expression
Message-Id: <34F2270D.46949159@coos.dartmouth.edu>

[posted and mailed]

Timothy Loy wrote:
> 
> Currently I am using a flat text file and building a regexp
> like '((((Month = 1 ) && (Day <= 9 )) ||
>         ((Month > 1) && (Month < 3)) ||
>         ((Month =3 ) && (Day <=4)))
>         ||
>         ((Month = 5) && (Day = 7)) )'
> 
> and then do a run time //o on the built regexp

That's the funniest looking regex I've ever seen.  ;-P

Perhaps you could use the Date::Manip module to compare the dates easily.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: 24 Feb 1998 05:23:09 GMT
From: danny@lennon.postino.com (Danny Aldham)
Subject: Safely running one-liners
Message-Id: <6ctlft$3st$1@lennon.postino.com>

X-Newsreader: TIN [version 1.2 PL2]

A lot of posters here have .sigs that include perl one liners.
Is there a safe way to run them, and be assured that they wont
damage and/or erase files?  (or e-mail off my shadow file)

--  
Danny Aldham             SCO Ace, MCSE, JAPH, DAD 
Field Service Manager    BCTel Systems Support
7000 Lougheed Hwy, Burnaby BC   (604) 444-8949
batcher hend


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

Date: Mon, 23 Feb 1998 20:55:57 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Uninitialized value chunk error
Message-Id: <34F228B0.21F65860@coos.dartmouth.edu>

[posted but not mailed - munged addresses are annoying -
 and this one was particulary munged]

Eric Hilding wrote:
> 
> Use of unitialized value at mls222.pl.txt line 29, <INFILE> chunk 396
> Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 397

<INFILE> chunk 396 means that this warning was output after your program read
the 396th chunk from INFILE.

> $line =~ m/.*\d\/\d\/(\d).*\d{2}\/\D{2}\/\d{2}\s(.{5,25})/;
>                                          #extract Status Code
>                                          #and Address from this data line
> $stat = $1;                              #assign status code from $1
> $addr = $2;                              #assign address from $2
> $addr =~ s/^\s+|\s+$//g;                 #  [line 26, I presume]
>                                          #whitespace cleanup on address

What happens if that regex doesn't match?  $1 and $2 are undefined, which
means $addr is undefined, which means you're applying a substitution to an
undefined value.

Same thing for line 46.

Apparently some of the input lines aren't in the assumed format.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: 23 Feb 1998 21:59:53 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: why no Case statment?
Message-Id: <8chg5pha2e.fsf@gadget.cscaper.com>

>>>>> "Jarkko" == Jarkko Hietaniemi <jhi@alpha.hut.fi> writes:

Jarkko> If you can answer these questions, well, then you can write the
Jarkko> if-elseif-else.

What's "elseif" ?

:-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 189 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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: 24 Feb 1998 01:28:14 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Why not RegEx in $/?
Message-Id: <6ct7ne$5vk$1@client3.news.psi.net>

uri@sysarch.com (uri@sysarch.com) wrote on 1637 September 1993 in
<URL: news:x7n2fh3no4.fsf@sysarch.com>:
++ ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
++ 
++ > > Why isn't it possible to use a regular expression for
++ > > $/ ($INPUT_RECORD_SEPARATOR)? The perlvar page says:
++ > 
++ > Expect some problem, though, the fact that is not implemented may have
++ > warned you.
++ 
++ > P.S.  I have some ideas how to implement it, but it will require
++ > changes to 3 different parts of Perl engine.
++ 
++ i wonder if it is a speed/memory issue. you may have to read far ahead
++ to make sure a regex will match/fail (read the book mastering
++ regexes). so you might force perl to slurp the entire file to
++ match/fail. whereas a fixed string $/ will match/fail in no more than
++ the length of $/.

Yes, but that's the programmers choice, isn't? Besides, there will
be many cases where perl doesn't need to slurp in files. Setting
$/ = "\n(?![ \t\r\f])" could be useful in many cases, without
perl slurping in the entire file.

++ so if you want it yourself, just set $/ to undef, slurp in the file and
++ do your own split or regex. it would be about the same work as perl
++ would do for you and not much more code on your part.

Not at all true. $/ = "\x0D\x0A?|\x0A" could be a useful regex if you don't
know where the file is coming from, and it isn't going to slurp in your
532 Mb file in its entirely.

You would need to use (sys)read() and implement perls regex machine in
perl if you want to do what would be possible if $/ could be a regex.


There might be a gazillion reasons why $/ can't be a regex, but I
seriously doubt that "it might mean Perl needs to read the entire
file, and then you can use split() anyway" is a valid reason.



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]+Additional/s) [0]'


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

Date: 24 Feb 1998 03:25:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Why PERL? [Re: Beginner in trouble]
Message-Id: <6cteil$egq@fridge.shore.net>

Joseph N. Hall (joseph@5sigma.com) wrote:
: Something I've always wondered is where people get the
: uppercase PERL thing from.  Any ideas?

C:\> DELTREE C:\

Perhaps?

--
Nathan V. Patwardhan
please don't send spam to president@whitehouse.gov


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1962
**************************************

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