[8782] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2399 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 23 04:07:33 1998

Date: Thu, 23 Apr 98 01:00:44 -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           Thu, 23 Apr 1998     Volume: 8 Number: 2399

Today's topics:
    Re: Command line instructions don't execute in Win95 <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
    Re: Defending Perl (Marjorie Roswell)
    Re: Defending Perl (brian d foy)
    Re: Defending Perl <jimbo@soundimages.co.uk>
    Re: Defending Perl <msergeant@ndirect.co.uk>
    Re: Example code for a News Reader <dformosa@st.nepean.uws.edu.au>
        File attach <poliak@main.com2com.ru>
    Re: Help: crypt for Win32 ?? (Ethan H. Poole)
    Re: How to save an external program output in a var? <jimbo@soundimages.co.uk>
    Re: Interactive replace on multiple files... (Martien Verbruggen)
        memory efficiency question (David Waring)
        msql <blegge@iafrica.com>
    Re: parsing data <rootbeer@teleport.com>
        Perl for NT <Buzzbane@iname.com>
    Re: Perl for NT <nathan@cyberservices.com>
    Re: Perl for NT <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
    Re: perl library to read excel file (Karel.DeBruyne)
        Perl on NT getting Directory Information <nathan@cyberservices.com>
        PL/SQL and perl <zhlei@beijing.china.com>
    Re: print multiple lines before or after match ? (Xuming Wang)
    Re: Problem with Perl read on NT <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
    Re: Problem with Perl read on NT <igork@pacbell.net>
    Re: regexp to return list of matches from string (brian d foy)
    Re: regexp to return list of matches from string (brian d foy)
    Re: Removing spaces from a variable, how? <ben@wallroyds.demon.co.uk>
    Re: SendMail on NT tonyyeh@earthlink.net
        Setuid tips aren't working! <natedogg@webbnet.com>
    Re: spoiled noobie <rjk@coos.dartmouth.edu>
    Re: Symbolic ref and angle opeator (Abigail)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 22 Apr 1998 22:38:20 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Command line instructions don't execute in Win95
Message-Id: <6hmk3u$6n9@bgtnsc02.worldnet.att.net>


Jonathan Feinberg wrote in message ...
>                   [posted and mailed]
>"Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> writes:
>
>> This might be a FAQ but I'll answer it anyway: WinPerl really wants
>> double quotes when you enclose parameters for the -e command.
>
>Not so; it's the DOS *shell* that doesn't understand single quotes.
>Perl on Win32 has exactly the same syntax as other perls.
>
>--
>Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY

Technically you're right, but I think it's a distinction without a
difference. If it doesn't work at the command line, it isn't going to
work in WinPerl, whether it's implemented or not.






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

Date: Wed, 22 Apr 1998 21:28:50 GMT
From: roswell@umbc.edu (Marjorie Roswell)
Subject: Re: Defending Perl
Message-Id: <353e5db5.28976887@news>

>>since it is interpreted it has some installation problems.
>
>Anyone who sees an implicit connection between `interpreted' and
>`installation problems' must have a real pointy little head.

>>How many people use perl?

>i don't know if this is a good question...<snip stuff about violinists>

Neither of these answers help me to defend Perl in my Map-related
mailing list. Especially that "pointy little head" remark.

C'mon...give me something to go with. Yes, I've been to www.perl.org.

Does anyone else see a need for a "debunking Perl myths" FAQ? So much
of what's written is for folks who are already Perl users. How about
resources for people who aren't....yet.

I know O'Reilly took a stab at that at the Perl Conference last year,
but I don't think it quite gets at the simple myths that abound....

Looking for more help here...

Margie
_________________________________________________________
            Marjorie Roswell, Spatial Analyst
UMBC Center for Health Program Development and Management
1000 Hilltop Circle                     Fx: (410)455-6850
Baltimore, MD 21250                   E: roswell@umbc.edu
Ph: (410)455-6802    http://umbc.edu/~roswell/mipage.html
_________________________________________________________




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

Date: Wed, 22 Apr 1998 18:22:44 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Defending Perl
Message-Id: <comdog-ya02408000R2204981822440001@news.panix.com>
Keywords: from just another new york perl hacker

In article <353e5db5.28976887@news>, roswell@umbc.edu (Marjorie Roswell) posted:

>>>since it is interpreted it has some installation problems.
>>
>>Anyone who sees an implicit connection between `interpreted' and
>>`installation problems' must have a real pointy little head.
>
>>>How many people use perl?
>
>>i don't know if this is a good question...<snip stuff about violinists>
>
>Neither of these answers help me to defend Perl in my Map-related
>mailing list. Especially that "pointy little head" remark.


what are you trying to defend? the merits of Perl?  the usefulness
of Perl in your field or work?  the business viability of Perl? 

you can act like a marketing monkey and throw around all sorts of 
useless numbers, but like i said, they don't mean anything.  all sorts 
of newbies "use" Perl for their 3l33t3 web sites, so are you going to 
include those numbers?  do you want Perl religion or an intelligent
discussion?  even Randal has said that if something better came along
he wouldn't hestitate to use it over Perl [1].

for useless numbers, try:

   * going to your favorite retail bookstore.  look at the computer 
   books.  what do you see?  (your answer will be Java, Perl, and
   Visual Basic books).

   * asking O'Reilly and Associates how many Perl books they have sold.

   * looking at the impressive client list of perltraining.com
      <URL:http://www.perltraining.com/references.html>

for useless anecdotes:
      
   * remark that the Denver Broncos web site uses mod_perl

   * DejaNews, which indexes and archive Usenet, runs on mod_perl

   * and so on

for an intelligent defense:

   * show them how Perl makes their lives easier

   * show them how Perl can solve their problems better than 
   whatever they are doing now.

if you can't do that, then they have no reason to use Perl no matter
what numbers you throw at them.  since you are most likely using Perl
to do whatever you do, tell them about it and how it's better than
the other approaches.  

[1] with the caveat that he doubts something better will come along.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: 23 Apr 1998 08:40:59 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Defending Perl
Message-Id: <upvi9dlys.fsf@soundimages.co.uk>

gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:

> }>Anonymous contributor says:
> }>>since it is interpreted it has some installation problems.
> 
> }Anyone who sees an implicit connection between `interpreted' and
> }`installation problems' must have a real pointy little head.
> 
> Hmm.
> 
> Can I ship a script to you and guarantee it will work?  No.
> You'll only need to change the #!/usr/bin/perl5 line, but to some
> people, this could be a big deal.  (For example, I can't put perl
> scripts on a CD.)
> 
> So his head might not be as pointy as you think.

That may be true, unless you include perl on the cd. In most cases, there is more than enough space on a cd to include it, so why does cd-rom distribution prevent inclusion of perl scripts. Sure, you may have to invoke the script with some sort of shell script, and what I know about *nix fits on the proverbial postage stamp, but there really is no specific reason you cannot do it. I know, I've done it. Caveat: on WinTel.

Further, your example only applies to the *nix world. There are a ton of WinTel boxes out there. For better or for worse.


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

Date: Thu, 23 Apr 1998 08:48:35 +0100
From: Matt Sergeant <msergeant@ndirect.co.uk>
Subject: Re: Defending Perl
Message-Id: <353EF253.286E3DCB@ndirect.co.uk>

Marjorie Roswell wrote:
> 
> I'd like to answer the fellow who wrote this in response to my brief
> perl advocacy on a mailing list.
> 
> "Perl does indeed offer alot of power, especially when working with
> data. (And its being free certainly doesn't hurt!!)  However, it
> offers problems as well.  Very few people use Perl, and since it is
> interpreted it has some performance and installation problems.  It is
> almost easier to work in the power of C or C++.
> 

Q: What's the difference in speed between a C++ application that does X
and a Perl application that does X ?

A: About 2 months!

Seriously though, I think Larry Wall says in one of the FAQ's - use the
right tool for the right job. After all, we wouldn't consider re-writing
perl in Perl would we? (sorry if this is a mis-quote!)

Matt.


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

Date: 23 Apr 1998 00:25:04 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Example code for a News Reader
Message-Id: <893291104.592789@cabal>

In <62iat7$opj@news-central.tiac.net> mike@stok.co.uk (Mike Stok) writes:

>In article <344c4c6a.16019950@news.unicomp.net>,
>Chizl <chizl@SPAMkarland.com> wrote:
>>Anyone have any example code for a news reader?

>No, but the libnet modules for perl 5.xxx avaialble on any comprehensive
>perl archive network (CPAN) site contains Net::NNTP.

You will also need News::Newsrc and some more code to implerment all the
other newsreader funtions.  You may need the mailtools (MIME::*) to handel
attachements in news and the Curses libery (or equiverent) to make a user
interface (or TK if you wish to have a GUI).


--
I'm a perl programer if you need perl programing hire me. Buy easter bilbies.
Please excuse my spelling as I suffer from agraphia see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html  http://www.cm.org/ 
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Thu, 23 Apr 1998 00:14:09 +0400
From: Polyakov Ilya <poliak@main.com2com.ru>
Subject: File attach
Message-Id: <353E4F90.B0C1A4DB@main.com2com.ru>

I need to E-mail a non-text file.
Pls, tell me where I can find a Perl script for it.



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

Date: 23 Apr 1998 06:59:24 GMT
From: ehp@gte.net (Ethan H. Poole)
Subject: Re: Help: crypt for Win32 ??
Message-Id: <6hmosc$fci$1@gte1.gte.net>

In article <353EA6BB.867BA2DC@netscape.com>, vish@netscape.com says...
>
>Where can I find UNIX-like "crypt" function for Win32 Perl ?? Does
>anyone have a crypt lib for NT Perl ??
>thanks

The ActiveState port has builtin support for the crypt function

http://www.activestate.com/


-- 
Ethan H. Poole            | Website Design and Hosting,
                          | CGI Scripting...
========Personal========= | ============================
* ehp @ gte . net *       | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.com/



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

Date: 23 Apr 1998 08:45:02 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: How to save an external program output in a var?
Message-Id: <uogxtdls1.fsf@soundimages.co.uk>

Yong Huang <yong@shell.com> writes:

> Then I can check the file mytmpfile to see if it contains "Invalid
> username". But I want to optimize the code so the string "Invalid
> username" is not saved in an external file (which takes time in I/O) but
> in a Perl variable. How can I do it? Thanks for any advice.
> 
You can also open a filehandle to a process and thereby read the output from the process directly into a variable as you would any file.

Check the various IO and FAQ docs for full details, they are there, I've seen 'um.

HTH
Jim Brewer


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

Date: 23 Apr 1998 04:02:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Interactive replace on multiple files...
Message-Id: <6hmegt$bid$1@comdyn.comdyn.com.au>

In article <6hlijo$jco$1@nntp1.ba.best.com>,
	David Fetter <dfetter@shell4.ba.best.com> writes:
> Kind people,
> 
> Is there some way to do interactive edits in place?
> 
> For a simple bunch of files, things like
> 
> perl -pi -e 's/foo/bar/g' baz* *bat
> 
> are handy.  There's also the interactive, but memory-hogging
> 
> foreach $filename (glob('baz*','*bat')) {
>     $modified = 0;
>     open FILE, "$filename";

You should check for the return value of an open()

>     chomp(@line = <FILE>);

This is where you get to be a memory hog. you read in the whole file
at once. If you're worried about the amount of memory used here, you
could just process the file line by line, and write out every line to
another file, and at the end rename files, as suggested by perlfaq5,
question 'How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the beginning of
a file?'

>     for $i (0..$#line) {
>         next unless $line[$i] =~ /foo/;
>         print "$filename:$line[$i]? (Y/n)";
>         chomp($yes = <STDIN>);
>         next if $yes=~/n/i;
>         ++$modified;
>         $line[$i] =~ s/foo/bar/g;

If I understand correctly, all you want to do is replace all
occurrences of foo with bar, with confirmation? I guess that what you
have here is a method which does that nicely, even though this
replaces all foo's on a line. Maybe you need to look at making it
possible to only replace certain foo's on a line (see later).


>     }
>     print FILE join("\n",@line) if $modified > 0;

You opened the file for reading only. You cannot write to it.

Again: read perlfaq5.

>     close FILE;
> }

Two possibilities:

1)
- open file for reading, read in all the lines, close file
- process all the lines
- open (same) file for writing, truncating it, and write out all the
  lines

2)
- open file for reading
- open temporary file for writing
- process file line by line, write out possibly modified line to
  temporary file
- close both files
- unlink original file
- rename temporary to original

1) is slightly clearer and doesn't use a temporary file. 2) is more
memory friendly.

If you go with 1, you might consider slurping the whole file in a
scalar, and using the m//gs operation with \G on a per match basis.
That way you will process each foo separately, instead of each line
with possibly multiple foo's. Of course, you can also use this on each
separate line.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd.       | am.
NSW, Australia                      | 


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

Date: 23 Apr 1998 07:18:10 GMT
From: dwaring@nwsr.com (David Waring)
Subject: memory efficiency question
Message-Id: <dwaring-2304980020440001@blv-lx103-ip25.nwnexus.net>

When reading from a filehandle, does

while <FILEHANDLE>

 read the whole file into MEMORY at once or one line at a time?  Just
wondering if this is more memory efficient than;

@myarray=<FILEHANDLE>


David


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

Date: Thu, 23 Apr 1998 09:18:56 +0200
From: "Brad Legge" <blegge@iafrica.com>
Subject: msql
Message-Id: <6hmppi$a4$1@news01.iafrica.com>

Help Please.

Is there anyone out there who knows how to use perl to connect to msql
through odbc. I need to be able to access msql from perl. They have got the
Lite engine but I cannot use it. Is there an ODBC component that can be used
to connect through. Or maybe a perl library file written to connect to msql

TIA
Brad Legge




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

Date: Wed, 22 Apr 1998 22:09:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: "John T. Otto" <ottojt@mailhost.netdot.com>
Subject: Re: parsing data
Message-Id: <Pine.GSO.3.96.980422150720.6132v-100000@user2.teleport.com>

On Wed, 22 Apr 1998, John T. Otto wrote:

> The script pulls out data from that position if its there, but
> not the right stuff, resulting in lots of repeats, wrong data, etc.

Without seeing your code (hint! hint!) we can only guess at what's wrong.

Cut down your program to fewer than a dozen lines that are doing something
you wish were different, and we can take a look. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 21 Apr 98 23:02:18 -0800
From: "Eric Finlayson" <Buzzbane@iname.com>
Subject: Perl for NT
Message-Id: <746.415T929T13824593@iname.com>

I have been hired to build a shopping car for a site. But it is on a NT box
and I have only had experience programming CGI on Unix boxes. I was told there
is a major difference.

So what are the differences so I can adjust my scripts to work correctly? I
believe the NT server is using Microsoft's web server that comes with it.

--
Eric Finlayson                          Amiga 3000
--------------                          ----------
mailto:finny@blarg.net                  18Megs - Retina
mailto:bzzbane@iname.com                V-Lab Motion, Toccata
http://www.blarg.net/~finny/            AmigaOS 3.1
Team *AMIGA*                              PGP Public Key Available Upon Request
--
I only have a gun because it's hard to shoot without one.



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

Date: Wed, 22 Apr 1998 23:20:41 -0500
From: "Nathan Stanford" <nathan@cyberservices.com>
Subject: Re: Perl for NT
Message-Id: <DA3543C230294159.49E2F5504DFB666E.55C453FC96322B9B@library-proxy.airnews.net>

Does Tom Phoenix have to put down everyone when they ask a question.  This
is a Perl Misc and Perl is a leading CGI Scripting Lang.  Since the person
is wanting to know about Perl for NT vs Perl for Unix, he seems be in the
right place.   This is Perl (hmmm)  and misc (Misc hmm)

One of the many differences beside the programs that do not work on the NT
like sendmail unless you install a seperate app. is the way Directories are
pointed to the path...



--

Nathan Stanford,  Web Author
The Perl N.uT. and Web Designer
http://www.nettaxi.com/citizens/nathan/

Tom Phoenix wrote in message ...
>On 21 Apr 1998, Eric Finlayson wrote:
>
>> I have been hired to build a shopping car for a site.
>
>Wow, a shopping car. Gas or electric? :-)
>
>> But it is on a NT box and I have only had experience programming CGI on
>> Unix boxes. I was told there is a major difference.
>
>The differences between Unix Perl and NT Perl are merely the differences
>between the underlying systems. For example, if you're working with
>filenames, those are different. (But, of course, if you use
>File::Basename, your programs will be portable.)
>
>There may be differences between Unix CGI scripting and NT CGI scripting,
>but I'm sure that, if you wanted to know about those, you would have asked
>in a newsgroup about CGI scripting. :-)
>
>A detailed look at the differences in Windows Perl is part of the
>Perl-for-Win32 FAQ.
>
>    http://cpan.perl.org/doc/FAQs/win32/Perl_for_Win32_FAQ.html
>
>Hope this helps!
>
>--
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Wed, 22 Apr 1998 22:48:51 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Perl for NT
Message-Id: <6hmknh$9nu@bgtnsc02.worldnet.att.net>


Nathan Stanford wrote in message ...
>Does Tom Phoenix have to put down everyone when they ask a question.

On the contrary. Tom is one of the nicer guys on this newsgroup. He may
poke fun of spelling mistakes or other human foibles, but never
maliciously, and he always points people in the right direction for the
best place to get answers to their questions. If there were more people
like Tom on this newsgroup and fewer like (fill in the name of your
favorite offender), it would be a more polite and useful place.

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl




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

Date: Thu, 23 Apr 1998 06:43:31 GMT
From: dbruyne@uia.ua.ac.be (Karel.DeBruyne)
Subject: Re: perl library to read excel file
Message-Id: <ErutCK.36u@uia.ua.ac.be>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On Wed, 22 Apr 1998, Karel.DeBruyne wrote:
: 
: > I need a tool to fetch me some information out of an excel file.
: 
: If there's a module which does what you want, it should be listed in
: the module list on CPAN. If you don't find one to your liking, you're
: welcome and encouraged to submit one! :-)  Hope this helps!
: 
:     http://www.perl.org/CPAN/
:     http://www.perl.com/CPAN/

This is the kind of answer I was waiting for... 
:-)

Karel
-- 
=======================================================================
Karel De Bruyne
System/Network Manager                      phone      + 32 3 820 22 04
UIA - Computer Centre                       fax        + 32 3 820 22 49


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

Date: Wed, 22 Apr 1998 23:24:36 -0500
From: "Nathan Stanford" <nathan@cyberservices.com>
Subject: Perl on NT getting Directory Information
Message-Id: <C0B850E58BF1F20B.C3D88EF0260D72A5.7E0CD17087B58AD7@library-proxy.airnews.net>

How can I get the dir information in Perl on NT?

I want to search all of the files in the root and sub dirs with out telling
it which ones to search manuelly.

Need to do this in NT

--


Nathan Stanford,  Web Autor
The Perl N.uT. and  Web Desinger
http://www.nettaxi.com/citizens/nathan/






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

Date: Wed, 22 Apr 1998 16:07:35 +0800
From: zhanglei <zhlei@beijing.china.com>
Subject: PL/SQL and perl
Message-Id: <353DA547.E853EA07@beijing.china.com>

How can I make Oracle PL/SQL into perl program?



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

Date: Thu, 23 Apr 1998 04:30:53 GMT
From: xuming@NO__SPAM.email.unc.edu (Xuming Wang)
Subject: Re: print multiple lines before or after match ?
Message-Id: <353fc338.23550130@152.2.25.74>

comdog@computerdog.com (brian d foy) wrote:

<snip>
>         break out of while loop

yeah, I forgot to break out if he only need to match once.  obviously,
shouldn't break out if need to match multiple times.

xuming


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

Date: Wed, 22 Apr 1998 22:56:36 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Problem with Perl read on NT
Message-Id: <6hml62$bqt@bgtnsc02.worldnet.att.net>


Martien Verbruggen wrote in message
<6hmgfn$bo1$1@comdyn.comdyn.com.au>...

>> If not, is it just the first line such as '#!/usr/bin/perl' - what
would you
>> change this to hypothetically if the NT Perl interpreter was in
directory
>> '\bin\test' ?
>
>NT doesn't care about this first line. Unix shells do.

95% true. NT cares about any Perl switches that normally go on the
shebang line (e.g. #!/usr/bin/perl -w) but as for the location of the
Perl executable, yes, it gets that from the PATH environment variable.

Hmm, maybe I'll try

#!/this/is/a/program/written/in/perl -w

sometime (but I hesitate to think what the warning might be :D)






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

Date: 23 Apr 1998 07:21:10 GMT
From: "Igor Krivokon" <igork@pacbell.net>
Subject: Re: Problem with Perl read on NT
Message-Id: <01b41e87$8b0317e0$ced6d6cf@igork>

Creede Lambard <$_=qq!fearless@NOSPAMio.com!;y/A-Z//d;print> wrote in
article <6hml62$bqt@bgtnsc02.worldnet.att.net>...
> 
> Martien Verbruggen wrote in message
> <6hmgfn$bo1$1@comdyn.comdyn.com.au>...
> 
> >NT doesn't care about this first line. Unix shells do.

That's true

> 95% true. NT cares about any Perl switches that normally go on the
> shebang line (e.g. #!/usr/bin/perl -w) but as for the location of the
> Perl executable, yes, it gets that from the PATH environment variable.
> 

Well, this is about 50% true, probably :-)
Yes, those switches do work, but this is perl who cares about, not NT.

Look, if you have #!/blah/blah/perl -w 
statement as the first line of your script.pl, and you run it like 
perl script.pl
 ...and yes, switch -w still does work. 
As far as I understand, in this case it has nothing to do with OS, 
perl itself emulates UNIX shell's behaviour.

Regards,

Igor Krivokon
<igor.k@usa.net>





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

Date: Thu, 23 Apr 1998 01:34:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: regexp to return list of matches from string
Message-Id: <comdog-ya02408000R2304980134280001@news.panix.com>
Keywords: from just another new york perl hacker

In article <Pine.LNX.3.96.980422160208.19911i-100000@york.mathworks.com>, William York <william@mathworks.com> posted:

>I've look at the POD for HTML::Parser, but still don't know how to use
>it.
>
>Could somebody point me to an example?

Subject:      Re: Extract links and text from HTML
From:         Gisle Aas <aas@bergen.sn.no>
Date:         1997/02/07
Message-ID:   <hohdxym0d.fsf@bergen.sn.no>
Newsgroups:   comp.lang.perl.misc

what are you trying to do?  perhaps i can come up with an example 
closer to the problem you are trying to solve.  (gladly! i love playing
with this module)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Wed, 22 Apr 1998 16:13:55 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: regexp to return list of matches from string
Message-Id: <comdog-ya02408000R2204981613550001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6hlgjc$h4f@gecko.mathworks.com>, william@mathworks.com (William York) posted:

>Perhaps I'm dreaming but I'd like to make a piece of regexp do
>something like this:
>
># for this string:
>$line = "<table border><tr><td><table><tr><td>HI</td></tr></table></td></tr>";
>
>@st = $line =~ /(<table[^>]*>?)+/;
>print "There are ", $#st + 1, " table starts here.\n"; # print 2

perhaps you wanted something like

   #!/usr/bin/perl
   
   my $line  = 'cat rat cot dog count';
   
   #use the g modifier, not the + metacharacater
   my @array = ( $line =~ /(c.*?t)/g );
   
   foreach my $thingy ( @array ) { print "$thingy\n" }
   
   __END__

or if you get really fancy, you could use the HTML::Parser module.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
HTML::Parser is my new favorite toy


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

Date: Wed, 22 Apr 1998 10:16:15 +0100
From: "bjf" <ben@wallroyds.demon.co.uk>
Subject: Re: Removing spaces from a variable, how?
Message-Id: <893236602.21675.0.nnrp-03.c2de5b4a@news.demon.co.uk>

Thank you all for the answers. Both of them worked brilliantly ...

Thanks again!

Regards

BJF

Sleep wrote in message <6hkb02$h1n@eng-ser1.erg.cuhk.edu.hk>...
>Craig Berry <cberry@cinenet.net> wrote:
>> bjf (ben@wallroyds.demon.co.uk) wrote:
>> : How do you remove all spaces ... ie ... " " .... from a variable using
>> : pattern-matching?
>
>> This is actually a much better job for tr:
>
>>   $var =~ tr/ //d;
>
>what's the difference if we use :
>
>   $var =~ s/ //g;
>
>?




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

Date: Wed, 22 Apr 1998 21:39:17 GMT
From: tonyyeh@earthlink.net
Subject: Re: SendMail on NT
Message-Id: <354662ac.74427773@melcupa>

Hmm... I can't find module Net::SMTP on ftp.funet.fi
Can you help me?

Thankx
Tony Y.


On Mon, 20 Apr 1998 02:53:16 GMT, ELSS Admin
<elssa09@callisto.si.usherb.ca> wrote:


>No problem:
>
>	But you'll need the libraries installed! Run it first to see if you
>have them. Use the commented line to run the debug first.
>
>	You can play with this script first. Last I checked, it worked. If you
>have a question, drop me a line. I'm new to this, but it works.
>
>Natalie
>______________________________
>#!perl -w
>$email = "you\@your_server.com";
>
>use Net::SMTP;
>
>#$smtp = Net::SMTP->new('mail.your_server.com', Debug => 1);
>$smtp = Net::SMTP->new('mail.your_server.com');
>
>$smtp->mail($ENV{USER});
>
>$smtp->to('$email');
>$smtp->data();
>$smtp->datasend("To: $email\n");
>$smtp->datasend("\n");
>$smtp->datasend("A simple test message\n");
>$smtp->dataend();
>$smtp->quit;
>exit;



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

Date: Wed, 22 Apr 1998 13:20:10 -0700
From: Nate Grover <natedogg@webbnet.com>
Subject: Setuid tips aren't working!
Message-Id: <353E50FA.7193@webbnet.com>

This group has been talking extensively over the last few weeks about
running setuid scripts, but I can't figure out why a simple program like
this won't work:

($<,$>) = ($>,$<);
# thought that might help, but it doesn't seem to do anything

print "Content-type: text/plain\n\n";
$err = open (FN,"${FULL_PATHNAME}/perl_testfile");
if ($err) {print "success\n";} else {print "failure\n";};
$text = <FN>;
print $text;
close (FN);

The above script has permission rwsr-xr-x, and the permissions on
perl_testfile are rw-------. If I am the owner, and I run this, it
works, but calling it over the web fails. The exact same program
translated into C works fine. Is my server handling this correctly?


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

Date: Wed, 22 Apr 1998 23:48:25 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: spoiled noobie
Message-Id: <353EBA09.AA29B534@coos.dartmouth.edu>

Fain wrote:
> 
> $me{intelligence} = Macintosh;
> $me{intelligence} = 0; # this line is not necessary because
>                        # they are one in the same

Oh good, I was wondering when people would take a break from bashing Windows
and start in on Macintosh.

Anyone else have too much time on their hands?

:-)

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


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

Date: 23 Apr 1998 01:37:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Symbolic ref and angle opeator
Message-Id: <6hm61b$9j6$2@client2.news.psi.net>

Mark-Jason Dominus (mjd@op.net) wrote on MDCXCV September MCMXCIII in
<URL: news:6hld7b$aja$1@monet.op.net>:
++ In article <xim90oyez0i.fsf@jihad.amd.com>,
++ Quentin  Fennessy  <quentin@jihad.amd.com> wrote:
++ >Are there other programming constructs that can be described as
++ >circumfix?  
++ 
++ Zillions.
++ 
++ Perl:
++ 	"..."
++ 	'...'
++ 	qw(...)
++ 	[ ... ]        # Array reference
++ 	$...[...]      # Array element---Circuminterfix?
++ 
++ C:
++ 	/* ... */
++ 	... ...[...];     /* declaration */
++ 	... ...[] = { ... };   /* initialization */
++ 	struct ... { ... };  /* type declaration */
++ ML:
++ 	(* ... *)      (* comment *)
++ 	[ ... ]        (* list construction *)
++ 
++ 
++ COBOL:
++ 	DIVIDE ... BY ... GIVING ...        
++ 
++ 
++ Blah blah blah.  The only language I can think of offhand that
++ *doesn't* have a syntax like that is (surprise!) APL.

That makes me wonder what kind of comments APL has.  If /* ... */
counts as a "circumfix" programming construct, then # ...\n
is one as well. I've yet to see a programming language which does
not use comments of the form 
    BEGIN-COMMENT-TOKEN
          COMMENT
      END-COMMENT-TOKEN

++ There is no language that I know that uses |EXPR| for absolute value,
++ which might or might not be a shame, depending on your sympathies.

Not even Mathematica?



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


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

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 2399
**************************************

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