[6526] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 151 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 21 00:07:24 1997

Date: Thu, 20 Mar 97 21:00:26 -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           Thu, 20 Mar 1997     Volume: 8 Number: 151

Today's topics:
     Re: [Q] Finding the contents of a directory? (Tad McClellan)
     Re: [Q] HTTP client in perl? (dan ritter)
     Re: any non-forking server template code? <tchrist@mox.perl.com>
     Re: Can a Perl script interact with Java applet? <vpham@trumpet.calpoly.edu>
     Re: Checking a '/' chr. is not present (Eric Bohlman)
     Re: Core Dump!?!? (Ilya Zakharevich)
     diff. between 0 and "" (Susan Starr)
     Re: download search engine for web site ? <wade@demographics.com>
     Help Wanted! <eati@renoir.csc.vill.edu>
     http://www.perl.com/perl/info/software.html (Ilya Zakharevich)
     Re: join <--> split with delimiter in variable <dbenhur@egames.com>
     Re: Lost backslash <buehner@pfaffenhofen.netsurf.de>
     Re: Opening files in subdirectories <merlyn@stonehenge.com>
     Re: overloading operators? (Ilya Zakharevich)
     Perl Data Structures Cookbook.  Wher did it go? <joneil@is.ssd.k12.wa.us>
     Perl for Davis WeatherStation <multitek@teleport.com>
     Re: Perl for NT list? <wade@demographics.com>
     Re: Perl on Windows 95 <davinci@videotron.ca>
     Re: Recognizing spaces (Tad McClellan)
     Redirestion of STDOUT under NT: assoc, ftype problems. <zach@aristotech.com>
     regex in perl4 <pagib@aur.alcatel.com>
     Seeking security applets <goncalves@process.com>
     Sort question (Milan Saini)
     Re: Split really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email
     Re: stat file $mode anomaly? <fawcett@nynexst.com>
     Substitution question <wholething@bc.sympatico.ca>
     SybPerl Newbie Questions <74602.3516@CompuServe.COM>
     Re: Win32: How to use a MessageBox or Dialog (Eric Bohlman)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 20 Mar 1997 08:00:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [Q] Finding the contents of a directory?
Message-Id: <4ufrg5.251.ln@localhost>

amas@lhr-sys.dhl.com wrote:
: I am writing a program and part of what it has to do is find the
: contents of the directory.  What I would be looking for is something
: like:

:        GetDirContents($contents,$type,$regexp)

: $contents would be an array listing the contents of the directory,
                  ^^^^^^^^^^^

Then you mean @contents.
              ^

Or, were you meaning it would be a _reference_ to an array?


: $type would be a set of Folder,File,Symbolic Link

What's a Folder? Sounds like a graphical metaphor for a directory...


: $regexp would be a regular expression used as a filter, so for example
: if I wanted to find file names that started with 5 alphnumeric characters
: followed by a full-stop, followed by an unknown number of alphanumeric
: characters, I would have something like "?????.*"
                                           ^^^^^^^

That looks like a 'filename glob' rather than a real regex. A real
regex for what you've described would be:

/.....\..*/
 ^^^^^       five of any char (except newline)

/.....\..*/
      ^^     need to escape the full stop

/.....\..*/
        ^^   zero or more of any char (except newline)

Those will match the pattern _anywhere_ (even in the middle) in
the string being searched. To make it match only if the entire
string matches, you would anchor the regex:

/^.....\..*$/
 ^         ^


: I am in the process of moving from awk, partly becuase of the greater
: functionality of Perl and partly because Perl is available on many more
: platforms.

: If anyone can help me I would appreciat this very much.  If it makes any


see the fine perl man pages (.pod filename extensions) for:

opendir(), readdir(), closedir()

grep()

file tests (search for '-X')


: difference my target platform is primarily Unix, though it could be
: anything.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 20 Mar 1997 11:34:41 -0500
From: dsr@cyber3.servtech.com (dan ritter)
Subject: Re: [Q] HTTP client in perl?
Message-Id: <5grov1$896@cyber3.servtech.com>

In article <858865829.6248@dejanews.com>,  <amas@lhr-sys.dhl.com> wrote:
>I would like to have a robot that would go through my site and index
>all the links it comes across. Has anybody done this and would it
>work independently of platform?

Sure, people have done this. Sure, people have done it platform-
independently. People have done it in Perl, the greatest of all
modern languages.

>If you have or know where I can get examples, explanataions I would
>appreciate this very much.
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet

Have you tried DejaNews? Or Altavista? Look for "web robot", "spider",
and, of course, "Perl".

HTH. HAND. UTS,L.

-dsr-


-- 
--
dsr@servtech.com                     Flash:  Systems/network admin seeks new job
Dan S. Ritter                                on the East Coast. Resume at 11!
                                             (Resume available on request.)


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

Date: 21 Mar 1997 02:18:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: any non-forking server template code?
Message-Id: <5gsr58$hgm$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    c.c.eiftj@42.usenet.us.com (Rahul Dhesi) writes:
:The perl online manual has an example of forking server, but not for a
:non-forking server.  

:Are there any available templates for a non-forking
:server on which one could build a customized one?

You just have an older manual.  There's a newer one with 
the non-forking example here:

    http://www.perl.com/CPAN/doc/manual/html/pod/perlipc.html

(If that doesn't pull anything, just keep clicking on it
 until it does.  Some of the mirror sites are behind.)

:Ideally such a server would create n processes all at once, and then
:each process would continue to cycle through incoming connections.

Hm... that sounds like what you want is a pre-forked server, which is
a different beast entirely.   I don't know an example of that in Perl.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
If you want to see useful Perl examples, we can certainly arrange to have
comp.lang.misc flooded with them, but I don't think that would help the
advance of civilization.  :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>


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

Date: Thu, 20 Mar 1997 10:59:32 -0800
From: Vinh Pham <vpham@trumpet.calpoly.edu>
To: alan@n-ary.com
Subject: Re: Can a Perl script interact with Java applet?
Message-Id: <33318914.5D96@trumpet.calpoly.edu>

   Mr. Williamson, thank you for your response.
     Many books and programmers suggest using Perl to do pattern
matching, an operation that I will need in the search capability of my
online Classified Ads system. Although Perl is an interpreter and will
take up more resources to run, it has a text string manipulation
capability that is unmatched by compiled programming languages like C++.
While Java's portability and compactness are indisputable, can you give
me your opinion on its string manipulation features compared to Perl?
                                                                Thanks ,

                                                            Vinh Pham.



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

Date: Fri, 21 Mar 1997 00:17:32 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Checking a '/' chr. is not present
Message-Id: <ebohlmanE7DA58.ExC@netcom.com>

Paul Denman (pdenman@ims.ltd.uk) wrote:
: I have written a username/password script, and need to check that
: the following characters are not in either;   ":", "/" and " " (space).

: I am using the syntax:

: if (($FORM{username} !~ /:/) && ($FORM{username} !~ / /)) {
: 	...
: }

Character classes are your friend.  Instead of three separate tests, just do:

if ($FORM{username} !~ /[:/ ]/) ...

Sometimes you need to match a literal "/" in a pattern but outside a 
character class, in which case you have two choices:

1) Escape it with a backslash.  If you have to do this more than once in 
a pattern, this becomes very hard to read, so in that case...

2) Write m<delim>...<delim>, where <delim> is any single character other 
than (, [ or {.  If you use one of those three, then you need to use its 
correponding "closer" at the end of the pattern instead of the opening 
character.

Examples:

if ($stuff=~m!and/or!)...

if ($stuff=~m(and/or))...



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

Date: 20 Mar 1997 19:41:41 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Core Dump!?!?
Message-Id: <5gs3tl$8nb$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dominic Dunlop
<domo@tcp.ip.lu>],
who wrote in article <19970320114410589047@dialup16.ip.lu>:
> If you don't like the thought of beta software (and who could blame
> you), simply try the current released version of perl, 5.003.  You can
> get it via <http://www.perl.com/perl/info/software.html>.  There's a
> good chance that it too will fix the problem.  (If it doesn't, please
> submit a bug report using the perlbug program that is part of the perl
> distribution.)

I just do not understand you folks :-(. All the releases of Perl
(except - possibly - 4.036) are alphas if you consider 5.003_93 as
beta... 

Ilya


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

Date: 20 Mar 1997 19:38:05 GMT
From: sstarr@skypoint.com (Susan Starr)
Subject: diff. between 0 and ""
Message-Id: <5gs3mt$t30$1@shadow.skypoint.net>

I'm running perl 5.003 and I'm having some trouble telling if a value is 
0 or blank.  The program I'm writing has the user enter some data and 
then tests the data to make sure it is valid.

Here is some code:

if (&isbetween(0,13)) { print "true\n"; }
if (&isbetween(0,13,"")) { print "true\n"; }

sub isbetween {
  my ($low,$high,$val) = @_;
  return ($val >= $low && $val <= $high);
}

I would like both of the above cases to be false but they aren't.  
If I add the line:
   if ($val == "") { return 0; }
to the function isbetween, then, when $val is equal to 0, the function 
returns 0;  How can I fix this?

Thanks,

Sue

--
Intelligence has nothing to do with politics.
                        Londo Molari



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

Date: Thu, 20 Mar 1997 12:35:38 -0500
From: Wade Leftwich <wade@demographics.com>
To: Nicola Gordon <nicola@uoguelph.ca>
Subject: Re: download search engine for web site ?
Message-Id: <3331756A.4A6C@demographics.com>

Nicola Gordon wrote:
> 
> Hi, can anyone advise me on this subject...
> I would like to download a search engine to allow users to search my web
> site.

We have been very happy with Excite for Web Servers, which is available
for FREE from www.excite.com/navigate/ 
It has a customizable Perl wrapper around a compiled executable, and is
available for several Unices and NT.
-------------
Wade Leftwich <wade@demographics.com>
American Demographics / Ithaca NY / http://www.demographics.com/


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

Date: Thu, 20 Mar 1997 16:22:40 -0500 (EST)
From: chandu eati <eati@renoir.csc.vill.edu>
Subject: Help Wanted!
Message-Id: <Pine.SUN.3.90.970320161825.23606A-100000@renoir.csc.vill.edu>

Hi,

	Is there a utility (Perl or CGI script) with which we
	can generate US state and county names when a user 
	submits only a zip code.

Please send me your answers to:

eati@monet.vill.edu


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

Date: 20 Mar 1997 20:38:28 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: http://www.perl.com/perl/info/software.html
Message-Id: <5gs784$bkt$1@mathserv.mps.ohio-state.edu>

I found a small bug in the above document: it states:

   Alien Ports
   If you are looking to run Perl on a non-native system, then have a look at
   the /CPAN/ports/ directory. WinDOS users will want to download the new
   5.003 beta. or the old 5.001m release (Yes, the main release is at
   5.004beta, but WinDOS as always lags behind.) 

Current version of EMX port (which runs on OS/2, DOS and Win*) is
5.004beta1. It was released one day after 5.004beta1 was announced,
and I would not call it "lag behind". (Though on M$ platforms it may
be feature-deficient, I do not _think_ sockets work outside WinNT, and
do not _know_ whether they work under WinNT.)

Ilya


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

Date: Wed, 19 Mar 1997 22:08:46 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Bruce Mohler <bwmohler@hctg.saic.com>
Subject: Re: join <--> split with delimiter in variable
Message-Id: <3330D46D.64E7@egames.com>

[mail&post]
Bruce Mohler wrote:
> I have a variable to store my delimiter (a '|' right now).
>         $Delimiter = "|";

> However, when I come later to split the name/file name pairs, it doesn't
> work:
>         ( $Name, $FileName ) = split $Delimiter, $ListOfFiles[$Index];

That first argument to split() is interpreted as a regular 
expression.  '|' has a special meaning in a regex (it's the 
alternation meta-character).  In your example, it's the 
equivalent of
  split /|/, $str;

That regex means "match a null string OR a null string", so
the split matches after every character.  Use the quotemeta
function to escape regex metachars:

   split(quotemeta $Delimiter, ...);
or:
   split(/\Q$Delimiter\E/, ...);

docs on split: man perlfunc, Camel p220
docs on quotemeta: man perlfunc, Camel p201
docs on regex: man perlre, Camel p58-69

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"Sometimes you just have to step in it and see if it stinks"  O-
    -- Sonia Orin Lyris



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

Date: Thu, 20 Mar 1997 20:50:26 +0100
From: Thomas Buehner <buehner@pfaffenhofen.netsurf.de>
Subject: Re: Lost backslash
Message-Id: <VA.00000075.0027ff8c@intersco.internet.de>

> > When I run this script:
> > 
> >  $test = '\.\\test';
> >  print $test;
> >  
> > what gets printed is: \.\test
> > 
> You can do $test = '\.\\te\'st'; to get ' into the string. Well then
> you need a way to get \ into the string, and the way is double
> backslash.

Thanks!

So, the safest thing to do when you want to escape the backslash hunt 
for good is to use q!\.\\test! ...

Thomas Buehner




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

Date: 20 Mar 1997 13:23:01 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Kevin Huber <Kevin.T.Huber@cdc.com>
Subject: Re: Opening files in subdirectories
Message-Id: <8cd8sunwii.fsf@gadget.cscaper.com>

>>>>> "Kevin" == Kevin Huber <Kevin.T.Huber@cdc.com> writes:

Kevin> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
>> Um, you *did* read 
>> http://www.perl.faq/perl/faq/idiots-guide.html
>> Didn't you?

Kevin> I think Tom meant http://www.perl.com/perl/faq/idiots-guide.html.

Although a TLD of ".faq" has a nice ring to it, doesn't it?

	http://www.cgi.faq/
	http://www.unix.faq/
	http://www.ascii.faq/	:-)

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

-- 
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@ora.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: 21 Mar 1997 00:39:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: overloading operators?
Message-Id: <5gslbn$q7o$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Russ Allbery 
<rra@cs.stanford.edu>],
who wrote in article <qum913imebm.fsf@cyclone.stanford.edu>:
> The package was also in 5.003, but I know extensive work has been done on
> it since then, so it may not be fully functional in that version.

"It" is there from day 1 (well, I think from 5.000alpha6 or around, so
maybe day 2 from Andy's point of view ;-).  Some minor bugs are
corrected time-to-time (say, until recently you could use %OVERLOAD
for overloading - no more!).

Ilya


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

Date: Thu, 20 Mar 1997 09:55:46 -0800
From: Jerome O'Neil <joneil@is.ssd.k12.wa.us>
Subject: Perl Data Structures Cookbook.  Wher did it go?
Message-Id: <33317A22.5178@is.ssd.k12.wa.us>

I am having some problems finding Tom's Perl Data Structures Cookbook
on-line.  The FTP site says it isn't where it used to be, and I'm
wondering if it is somewhere else?

Thanks!

Jerome


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

Date: 20 Mar 1997 20:29:29 GMT
From: "Daron Wilson" <multitek@teleport.com>
Subject: Perl for Davis WeatherStation
Message-Id: <01bc356d$4eddd700$0100a8c0@beavis.multitek.net>


Wild question...i have a Davis Weather Monitor II, and was considering
getting the real time data from it and putting it into my linux computer,
then putting the data on my web page.  However, it looks way over my
head...has anyone heard of this being done?  Maybe it has been and i can
save the work of figuring it out?

thanks in advance

Daron

multitek@teleport.com



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

Date: Thu, 20 Mar 1997 12:39:08 -0500
From: Wade Leftwich <wade@demographics.com>
To: josh@dowdell.com
Subject: Re: Perl for NT list?
Message-Id: <3331763C.548B@demographics.com>

Josh Dowdell wrote:
> 
> Does anyone know if there is a newsgroup specific to NT issues?
> Specifically, the newest version I've found that supports ISAPI
> correctly is 5.001m.  I found a 5.003 but when it installed, there was
> no ISAPI.DLL at all.  I've been all over perl.com and download servers
> so either I missed something or I already have the latest version for
> ISAPI.
> 
> Thanks
> Josh


http://www.activeware.com has links to the perl-win32-users list,
archives, and Evangelo's excellent perl-win32 FAQ.

Wade Leftwich <wade@demographics.com>
American Demographics / Ithaca NY


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

Date: Thu, 20 Mar 1997 16:04:36 -0500
From: Pascal Deschenes <davinci@videotron.ca>
Subject: Re: Perl on Windows 95
Message-Id: <3331A663.6F75@videotron.ca>

Paul Downing wrote:
> 
> On Mon, 24 Feb 1997 12:57:06 -0500, Peter Holtan <puzzled@cris.com>
> wrote:
> 
> >Hank,
> >
> >I have the same question as Mark did.  Please excuse me if my question
> >sounds stupid, but I am very new to this.  Where can I get a server? Is
> >there a good one that you would suggest that I could download for free?
> >I hope I could get a server for Windows95, I have LINUX but I have too
> >many problems with it and X runs so damn slow.
> >
> 
> If you are running the new version of Win 95, the OSR2, it has a
> Personal Web Server that runs as a network service.
> 
> As far as Linux and X goes, it got either a very slow machine or it is
> configured wrong. I have used X on a 386DX/20 with 8MB of RAM with no
> problem. Check your settings and take that gripe to the comp.linux
> groups. :-)
> 
> Paul Downing
> ------------------------------------------------------------
> Enterprise Network Consulting / owner
> Baker, Louisiana
> E-mail: enc@pobox.com
> -------------------------------------------------------------

Hi ya!
What about website 1.1e server?? grab it for free at
http://website.ora.com
from oreilly soft.
or maybe try this fascinating one called !Fnord from GNU which is a very
simple one.
Both works fine on win95 (trust me, i ve try it!;-)

-- 
Pascal Deschjnes, Webmaster
pasde@videotron.ca
"Everything looks fine from a certain point of view." -me


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

Date: Thu, 20 Mar 1997 22:14:30 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Recognizing spaces
Message-Id: <6v1tg5.jk.ln@localhost>

Matt Riggsby (mriggsby@sybex.com) wrote:
: I've written most of a subroutine that regularizes the width of an
: incoming chunk of text.  What it's supposed to do is to take the text
: (which I'm calling $message), strip out any existing linefeeds, then
: parse through the text and put in a \n after every word that takes a
: line over a given number of characters (as the code fragment below
: indicates, I'm trying to end up with lines not much over 60 characters
: long).  It works tolerably well except for one thing:  it ignores one of
: my conditions.  Regardless of how I state it, it chops the text neatly
: at 60 characters, usually in the middle of a word.  I have tried
: reordering the criteria, using different operators (e.g.: both
: conditions joined by an "and"), and defining the blank space differently
: (' ', the literal operator, and the whitespace operator have all failed
: as well as the current design).  I'm including the problematic fragment
: below.  Any ideas what I'm missing?
                    ^^^^^^^^^^^^^^^^^


The Text::Wrap module perhaps?

Or, just do it with perl's format?

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

while ($message = <>) {
   write;
}

format STDOUT=
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$message
 .
---------------------


Or is this just an exercise that you are using to learn perl?


[ snip reinventing of wheel code ]


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Thu, 20 Mar 1997 13:03:11 -0800
From: Zachary Deretsky <zach@aristotech.com>
Subject: Redirestion of STDOUT under NT: assoc, ftype problems.
Message-Id: <3331A60F.2B4B@aristotech.com>

I posted a message about redirection of STDOUT, STDERR which works under
Unix and does not under NT. I traced the problem to the "assoc, ftype,
PATHEXT" which replaces the shebang (like #!/usr/bin/perl) of calling
scripts directly. My conclusion: this method is flaky; use 'perl
script.pl' instead of 'script'. 

I have:
M:\>assoc .pl
 .pl=Perl

M:\>ftype Perl
Perl=perl.exe %1 %*

PATHEXT=.pl;.com;.exe;.bat;.cmd

Two test scripts:
-------------------------------------
D:\atools\src>cat dad.pl
use Getopt::Std;
getopt();

$logfile = $0 . '.log';
if($opt_L) {
    open(LOG, ">$logfile") or die "Can't open $logfile";
    $oldFh = select(LOG); $| = 1; select($oldFh);
    open(STDOUT, ">&LOG") or die "Can't redirect stdout to $logfile";
}

$oldFh = select(STDOUT); $| = 1; select($oldFh);

$sysCommand = join(' ',@ARGV);
print "Executing $sysCommand\n";
system($sysCommand);


D:\atools\src>cat son.pl
$| = 1;
print "I am called as $0 $ARGV[0]\n";

$level = $ARGV[0] - 1;
($level > 0) || die "EXITING\n";
$sysCommand = "$0 $level";
print "Calling $sysCommand\n";
system($sysCommand);
 ------------------------------

Results of 2 runs:
 ------------------------------
D:\atools\src>dad son 2
Executing son 2
I am called as D:\atools\src\son.pl 2
Calling D:\atools\src\son.pl 1
I am called as D:\atools\src\son.pl 1
EXITING

D:\atools\src>dad -L son 2
EXITING

D:\atools\src>cat dad.pl.log
Executing son 2
-----------------------------------------------
When I alter both scripts to call perl, that is have
$sysCommand = "perl " . join(' ',@ARGV);
and $sysCommand = "perl $0 $level";
plus I call 'perl dad.pl -L son.pl 2'
I get complete logfile.


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

Date: Thu, 20 Mar 1997 17:05:01 -0500
From: Bruno Pagis <pagib@aur.alcatel.com>
Subject: regex in perl4
Message-Id: <3331B48D.64F2@aur.alcatel.com>

I want to extract the second field (the one conaining Ys)
in the following lines:
X:Y:Z:
XXX:YYYY:Z:WW:Q
ZZ:YY:DD:SSSSSS:HHHHH

And I'm stuck. In perl5, I would do
/^.*?:(.*?):.*$/
but what about perl4 where non-greedy modifiers don't exist.


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

Date: Wed, 19 Mar 1997 15:05:30 -0500
From: Marcus Goncalves <goncalves@process.com>
Subject: Seeking security applets
Message-Id: <3330470A.51F@process.com>

Guys,

I'm finishing a book on Internet Security and am seeking applets sample
codes, small apps and so on, to enhance Internet security.  Those
interested to contribute, please forward me your material.  If suitable
I'll publish it on the book, credit and mention your URL/e-mail address,
as well as acknowledge your contribution on the book as a contributor.
Of course, you'll also receive a complementary copy of the book.

Please forward material/questions to goncalves@process.com

Thanks!

Marcus Goncalves
goncalves@process.com


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

Date: 20 Mar 1997 20:15:26 GMT
From: milan@xilinx.com (Milan Saini)
Subject: Sort question
Message-Id: <5gs5su$irn@mailman.xilinx>


Hi

I want to sort a hash but am not getting the order I seek:

#!/usr/local/gnu/bin/perl

%list1=("1_2.9" => 1,"1_2.7" => 1,"1_2.11" => 1);

foreach $keys (sort  keys %list1)
{
print "$keys\n";
}
~
Output:
1_2.11
1_2.7
1_2.9


What I actually want is:

1_2.7
1_2.9
1_2.11              

Can someone please help

Thanks
Milan
-- 
  / 7\'7 Milan Saini (milan@xilinx.com)
  \ \ `  Xilinx                              Telephone: 408-559-7778
  / /    2100 Logic Drive                    Direct:    408-879-5300
  \_\/.\ San Jose, California 95124-3450     FAX:       408-879-4676


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

Date: 20 Mar 1997 16:47:55 GMT
From: really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email
Subject: Re: Split
Message-Id: <ELIOT.97Mar20114755@kern1.dg.com>

   > 
   > 
   > Hi all!
   > I have a program:
   > 
   > $tmp="a|||b|||";
   > @li=split('\|',$tmp);
   > 
   >         This program split string into array with size only 4.  Why?
   >                                                 Marek !
   > 
   > --
   > fapsom@hron.fei.tuke.sk

   I have copied and tested your prog and it appears that the PERL split
   command only recognises occurences up to the last non empty occurance.

Exactly.  In fact, on page 97 of the cama, I mean lamel, uh, flat-backed-
animal book, it says

	Empty trailing fields do not become part of the list.

Topher Eliot                           Data General Unix Core Development
(919) 248-6371                                        eliot at dg-rtp.dg.com
Obviously, I speak for myself, not for DG.
Visit misc.consumers.house archive at http://www.geocities.com/Heartland/7400
"I like to get the chicks messy."  
	-- Peter, age 4, on why he likes the barnyard-scene cereal bowl.


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

Date: 20 Mar 1997 15:30:53 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: stat file $mode anomaly?
Message-Id: <8jzpvywbk2.fsf@nynexst.com>

"John W. St. Clair" <stclairj@erols.com> writes:
>      Can anyone out there tell me why when I call the
> stat function on a file, and look at the $mode field, the file 
> permisson returned (in decimal) is off by +32,768??

Without doing the math, I'd guess the file's REGULAR-FILE bit is set.
Perl's stat function is a direct interface into the stat system call.
man stat for details.

-Tom


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

Date: Thu, 20 Mar 1997 16:32:58 -0800
From: Karl Bridge <wholething@bc.sympatico.ca>
Subject: Substitution question
Message-Id: <3331D73A.6902@bc.sympatico.ca>

Hi, I am trying to strip tags out of an HTML file and reformat a section
of the file to present it in a different manner.

I seem to be having great difficulty with something I would have thought
would be quite simple. We are developing on a Novell IntranetWare Web
server running a subset of perl 4 commands that Novell has implemented.

I would like to take a line of HTML:
<i>and</i> <b><a href=http://www.xxx.com>testing</b></a>
and strip out the tag <a href=http://www.xxx.com>.

When I use the perl substitution:
	$line =~ s/\<a href.*\>//g;
It strips out the entire line from the anchor tag.

Any help would be appreciated.

KB


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

Date: 20 Mar 1997 16:55:26 GMT
From: Scott Cairns <74602.3516@CompuServe.COM>
Subject: SybPerl Newbie Questions
Message-Id: <5grq5u$qju$1@mhafc.production.compuserve.com>

I have written a few prototype perl scripts using the sybperl 
package.  One of the scripts reads the list of non-system 
databases from master..sysdatabases and issues a dump command.

The first dump fires off fine but the next ones die with the 
infamous "attempt to start new operation with results pending".
I've seen simalar behavior/problems with other calls to the 
sybperl implementation of dbresults().  It doesn't seem to block 
on operations like dump or load.  It's almost like it forks off 
the operation and then comes back to the caller immediately.  

Now maybe this has something to do with the fact that it's a 
System-11 environment and backup server is doing all the work but 
one would think/hope that there would be some way of knowing when 
the dump/load is finished.  After all, if you executed the same 
command in an isql session, you block until the dump/load is 
finished. Otherwise my high hopes for replacing all my lame 
csh/isql scripts with more elegant perl/sybperl ones will be kind 
of dashed as this is pretty basic stuff.

-- 
The beatings will continue until morale improves.


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

Date: Thu, 20 Mar 1997 21:17:05 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Win32: How to use a MessageBox or Dialog
Message-Id: <ebohlmanE7D1sH.IvA@netcom.com>

John Dallman (jgd@cix.compulink.co.uk) wrote:
: Achim Bursian <ea1217@fen.baynet.de> wrote:

: > I'd like to get some userinput through a windows dialog in Perl for 
: > Win32.

: As far as I can tell, you can't The Win32 module doesn't include any such 
: calls.

When is Perl/Tk going to be ported to Win32?



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

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

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