[8100] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1719 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 24 06:07:07 1998

Date: Sat, 24 Jan 98 03:00:24 -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           Sat, 24 Jan 1998     Volume: 8 Number: 1719

Today's topics:
    Re: @ == @, comparing arrays <rjk@coos.dartmouth.edu>
    Re: @ == @, comparing arrays <rjk@coos.dartmouth.edu>
    Re: `dir`command in IIS3.0 gives no output <jbattikha@highsynth.com>
    Re: `dir`command in IIS3.0 gives no output (Betty Kainz)
    Re: `dir`command in IIS3.0 gives no output (Martin Vorlaender)
    Re: Browser Identification? (Abigail)
        Can't get Perl to find modules in Lib directory when co <jpetri@iw.net>
    Re: DBI::Oracle question <ajh@rtk.com>
    Re: email address (Abigail)
    Re: Finding the missing bracket? (Michael Budash)
    Re: Freidl's book mystery (Bart Lateur)
        Help Please <mario_soares@hotmail.com>
    Re: Help Please (brian d foy)
    Re: Help Renaming Files.... (brian d foy)
    Re: Help w/ regexp (brian d foy)
    Re: HELP--Perl on MacIntosh (John Moreno)
    Re: HOw to check for file existence in each home direct <joseph@5sigma.com>
    Re: HOw to check for file existence in each home direct <joseph@5sigma.com>
        How to get at stuff piped into Perl? <kairys@mi.sl.com>
    Re: Is Perl cron-able? (brian d foy)
        matrices... <marcop@unipg.it>
    Re: perl to delete Unix accts <rjk@coos.dartmouth.edu>
    Re: POSIX (?) under perl for Win95 rodney@bond.net
    Re: Rexexp and href <rjk@coos.dartmouth.edu>
    Re: Server Push Problem (brian d foy)
        Some help with the 'reverse' command please..... <sviper@inav.net>
    Re: Some help with the 'reverse' command please..... <ajh@rtk.com>
        Sort::Fields <joseph@5sigma.com>
    Re: Survival Of perl <ajohnson@gpu.srv.ualberta.ca>
    Re: Survival Of perl <quillan@doitnow.com>
        Win32 Perl 5 Bld 307 problem with system `commands` (Clint Grimes)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 24 Jan 1998 03:10:33 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: @ == @, comparing arrays
Message-Id: <34C9A1F9.73C842B9@coos.dartmouth.edu>

Earl Hood wrote:
> 
> In article <34C792B6.21A7@wco.com>, Steven Smith  <steves@wco.com> wrote:
> >Is there an easy way to tell if all elements of the array
> >are the same short of a short subroutine?
> 
>         (@a1 == @a2) and ("@a1" eq "@a2")

@a1 = ('a', 'b c');
@a2 = ('a b', 'c');

Your code will incorrectly report that the above two arrays are the same.

Chipmunk


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

Date: Sat, 24 Jan 1998 03:16:06 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: @ == @, comparing arrays
Message-Id: <34C9A345.426A5807@coos.dartmouth.edu>

Charles DeRykus wrote:
> 
> In article <6a9aai$s93$1@client3.news.psi.net>,
> Abigail <abigail@fnx.com> wrote:
> if (@array1 == @array2 and "@array1" eq "@array2" and
>     "@{[reverse @array1]}" eq "@{[reverse @array2]}")  {
>        # arrays are same
> }
> 
> Or, does the qualification need more work ;)

Yes.

@array1 = ('a', 'a a');
@array2 = ('a a', 'a');

Your code reports that those two arrays are the same.

Chipmunk


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

Date: Sat, 24 Jan 1998 01:07:34 -0500
From: Jihad Battikha <jbattikha@highsynth.com>
To: Kerry Peterson <peterson@cns.uni.edu>
Subject: Re: `dir`command in IIS3.0 gives no output
Message-Id: <34C98526.1E177F01@highsynth.com>

Bob Trieger wrote:

> > Try $ls = `command /c dir\/b $directory_name`;
> > I think that should work, I don't think Perl finds the dir command because
> > it is a function of the shell, rather than a separate executable.
> 
> That won't work either, tried it 2 weeks ago when I was looking for a
> solution to the same problem. It is somewhere between IIS and perl32
> that the problem is occuring, the script works from the command line.

You can try capturing the output into an array and then joining the
array.

Here's a mini-script you can try:

print "Content-type: text/html\n\n";
@ls = `dir`;
$ls = join('',@ls);
# Don't forget to convert brackets when outputting to a web browser!
$ls =~ s/</&lt\;/g;
$ls =~ s/>/&gt\;/g;
print "<pre>\n$ls\n</pre>\n";
exit;

You'll probably want to modify the string parsing to suite your needs
(esp. if you're trying to retrofit this into someone else's script) but
at least this will return _something_ to you.

Hope that helps...

-- 
===================================================================
 Jihad Battikha <jbattikha@highsynth.com> http://www.highsynth.com
 -=< graphics . 2d/3d animation . illustration . web authoring >=-
 -----------------------------------------------------------------
 PGP: http://www.highsynth.com/jihad/pgp.htm
 - fingerprint: 9B5E 0484 0D88 6454 380B  964D E9B7 7A58 15C0 CAD7
 - expires: 1/1/1999
===================================================================


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

Date: 24 Jan 1998 11:09:00 +0100
From: midimani@site88.ping.at (Betty Kainz)
Subject: Re: `dir`command in IIS3.0 gives no output
Message-Id: <6mV35PAhdNB@site88.ping.at>

Hi Bob !

On 23 Jan 98 corky@ultranet.com wrote :

>  Toby Gebhart wrote:
>  > Try $ls = `command /c dir\/b $directory_name`;
>  > I think that should work, I don't think Perl finds the dir
>  > command because it is a function of the shell, rather than a
>  > separate executable.
>  That won't work either, tried it 2 weeks ago when I was looking
>  for a solution to the same problem. It is somewhere between IIS
>  and perl32 that the problem is occuring, the script works from the
>  command line.
Tom Christiansen is right...we really are PoBs. ;-(

I had the same sort of problem a couple of weeks ago getting a shell  
command that worked on an O'Reilly Website server to work on IIS 3.0.
I kept getting empty output from IIS. If I didn't need to have my
script executable on both s4ervers, I'd have uninstalled IIS on the spot,
without shedding a single tear. ;-)

Then I  checked to see which NT account the service for IIS was running  
under. In my case, it was the following "net" command, and the account for  
the service was a local account, so it couldn't execute that command.
I changed the account that the service was running under and it worked.

I don't know if this could be your problem, since yours is a "dir"  
command, but I guess it's worth mentioning anyway.

Another suggestion...you could also try your "dir" command with a pipe,
like this:

open(GROUPS, "net group /DOMAIN |") or die $!;
my @netgroups = (<GROUPS>);

When you find the right solution, please post it so we all know it. :-)

 ...hope it helps, :-)
Betty


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

Date: Sat, 24 Jan 1998 11:20:27 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: `dir`command in IIS3.0 gives no output
Message-Id: <34c9c06b.524144494f47414741@radiogaga.harz.de>

Bob Trieger (corky@ultranet.com) wrote:
: Toby Gebhart wrote:
: > Try $ls = `command /c dir\/b $directory_name`;
: > I think that should work, I don't think Perl finds the dir command because
: > it is a function of the shell, rather than a separate executable.

: That won't work either, tried it 2 weeks ago when I was looking for a
: solution to the same problem. It is somewhere between IIS and perl32
: that the problem is occuring, the script works from the command line.

AFAIK, I/O redirection won't work unless you tell IIS to create a
console for the CGI.

Try setting

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\
CreateProcessWithNewConsole

to REG_DWORD 1 in the registry, and restart IIS.

This at least works for IIS3 - MicroCrap changed all of the registry
stuff with IIS4 :-((

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 24 Jan 1998 06:21:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Browser Identification?
Message-Id: <6ac19q$9fd$2@client2.news.psi.net>

darkcyde (bazaillion@primary.net) wrote on 1606 September 1993 in
<URL: news:34C929E8.3C17@primary.net>:
++ Hello,
++ 
++ I am writing a Perl script to do browser identification, does anyone
++ know of a web site that has all the latest UserAgent variables for all
++ the latest browsers.

There isn't, as my Netscape and MSIE will be reported as 'HTML Stripper'
followed by whatever RCS version is the most recent.

I'm pretty sure that's not on a web site.

++ I need them for Netscape Navigator 3.0, Netscape Communicator 4.0,
++ Internet Explorer 3.0, and Internet Explorer 4.0.

Ah, so you ignore 98% of the browser types?

Now, what has your question to do with Perl???


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Fri, 23 Jan 1998 23:56:31 -0600
From: "John Petri" <jpetri@iw.net>
Subject: Can't get Perl to find modules in Lib directory when compiling
Message-Id: <01bd288c$021b06a0$c3b980d0@john>

Could someone please help,
I'm having a problem when my scripts compile.  
Perl doesn't seem to know where to look when it loads modules (they're in
the Lib directory.) 
Is there some configuration I need to do first?

Thanks,
John.



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

Date: 24 Jan 1998 08:26:45 GMT
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: DBI::Oracle question
Message-Id: <885630404.589702@ridge.spiritone.com>

"Verma Kakarlapudi" wrote in message
<001d01bd2858b9e704c0de123018@default.pha.adelphia.net>...
>$dbh = $DBI->connect('database', 'user', 'passwd');
>my $cur = $dbh->prepare(q{
>                             SELECT  f_name, l_name
>                             FROM     tbl1, tbl2
>                             WHERE   tbl1.sex = ?
>                             AND        tbl2.previous_positions in (?)
>                             AND        tbl1.id = tbl2.id
>});
>
>$cur->execute('M', $str);


DBI::Oracle will tell you what the problem is if you ask for it.  Try adding
error checking to your DBI calls:

  $dbh = $DBI->connect('database', 'user', 'passwd', 'Oracle')
      or die "Can't connect: $DBI::errstr";
  my $cur = $dbh->prepare( q{ ... } )
      or die "Can't prepare tbl1,tbl2 select: $DBI::errstr";
  $cur->execute('M', $str)
      or die "Can't execute tbl1,tbl2 select: $DBI::errstr";

The DBI::Oracle messages are amazingly helpful -- $DBI::errstr will likely
even point out the exact spot in your SQL that's causing the problem.
You'll save yourself a lot of trouble if you get in the habit of always
checking the return values.

Aaron Harsh
ajh@rtk.com




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

Date: 24 Jan 1998 06:26:15 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: email address
Message-Id: <6ac1i7$9fd$3@client2.news.psi.net>

G. E. Terry (admin@net-ops.net) wrote on 1606 September 1993 in
<URL: news:6ab03p$2gj$1@ns2.adult-host.net>:
++ 
++ What would be the best way to test a variable called $emailaddress to see if 
++ it contains an email address in the correct format?


Implement the BNF from RFC 822 as a PDA.
Parse. 
It's valid if you end in a valid state.

That of course doesn't say the address exists. Nor does it deal with
bang paths.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Sat, 24 Jan 1998 02:40:57 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Finding the missing bracket?
Message-Id: <mbudash-2401980240580001@d100.pm3.sonic.net>

In article <Pine.GSO.3.96.980123134723.17597Q-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:

>> On 22 Jan 1998, Junbiao Zhang wrote:
>> 
>> >       I was modifying a fairly big perl script and accidentally missed a
>> > right bracket in a subroutine. 
>> 
>> > I ended up doing a binary search (inserting a right bracket at a place
>> > and compile) to identify the problem. 
>> > 
>> >       Is there a better way to deal with such a problem? 
>> 
>> A programmers' text editor should be able to help you indent code properly
>> and to match up braces in pairs.

[snip]

Could you (and/or the others 'round here) be so kind as to recommend such
an editor, i.e., one that is perl-savvy?

TIA -

-- 
Michael Budash, Owner * Michael Budash Consulting
mbudash@sonic.net * http://www.sonic.net/~mbudash
707-255-5371 * 707-258-7800 x7736


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

Date: Sat, 24 Jan 1998 09:39:20 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Freidl's book mystery
Message-Id: <34cab6af.4584974@news.tornado.be>

Tom Christiansen <tchrist@mox.perl.com> wrote:

>All you have to do is set up your regular expressions 
>cleanly.  You don't have *one* regexp.  Make a lexer, maybe with state.
>
>    TOKEN: while (length) { 
>	next TOKEN if s/^\s+//;
>
>	if (s/(\d+)//) {
>	    do_num($1);
>	    next TOKEN;
>	} 
>	if (s/(\w+)//) {
>	    do_ident($1);
>	    next TOKEN;
>	} 
>	# et cetera
>    }

You must have forgotten the leading "^" in those regular expressions.

That is a real pitfal for regular expressions: that it may skip parts
you would be interested in, without even mentiononing they were there.

p.s. I noticed you have the same layout style for blocks as me. You
don't see that style too much.

	Bart.


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

Date: Sat, 24 Jan 1998 05:42:16 +0100
From: Mario Soares <mario_soares@hotmail.com>
Subject: Help Please
Message-Id: <34C97128.12E6@hotmail.com>

I have a searchable database written in perl I would like to do the
following:

 ... add some code in the script that just allow the users to search
with words with more than three letters.

Thank you

Mario


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

Date: Sat, 24 Jan 1998 01:50:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help Please
Message-Id: <comdog-2401980150130001@news.panix.com>
Keywords: just another new york perl hacker

Please read this information on how to choose a good subject for a post:
       <URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>


In article <34C97128.12E6@hotmail.com>, Mario Soares <mario_soares@hotmail.com> posted:

> I have a searchable database written in perl I would like to do the
> following:
> 
> ... add some code in the script that just allow the users to search
> with words with more than three letters.
> 
> Thank you

well, good luck then :)

(perhaps you had a question?)

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Sat, 24 Jan 1998 02:01:57 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help Renaming Files....
Message-Id: <comdog-2401980201570001@news.panix.com>
Keywords: just another new york perl hacker

In article <34C96D07.2A14@polaccess.com>, marcin@polaccess.com posted:

> I have a bunch of HTM files and I want to rename them so that they are
> in  some kind of order....

> system ("mv $thisfile $newfile");

what's wrong with rename?

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Sat, 24 Jan 1998 02:00:04 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help w/ regexp
Message-Id: <comdog-2401980200040001@news.panix.com>
Keywords: just another new york perl hacker

In article <34C8D275.E251DC33@weboneinc.com>, Douglas Clifton <doug1@weboneinc.com> posted:

> Martien Verbruggen wrote:
> 
> > In article <34C7CA6A.20B9D23B@weboneinc.com>,
> >         Douglas Clifton <doug1@weboneinc.com> writes:
> >
> > > I'm trying to figure out a way to match a range of numbers.
> > > I know about the [0-9] syntax, but the numbers would be
> > > more like 15-31, [15-31] does not work.

> > if ($beg >= 15 and $end <= 31) { ... }
> 
> To be more to-the-point: given an array that has N
> tab delimited fields ending in a number (day into the
> year) I want to remove all lines not in the above
> mentioned range. Rather than using a loop and split()
> I thought it might be simplier to use grep():
> 
> @log = grep /[$beg-$end]\n$/, @log;


well, you could use a regex if you really wanted to.  you can
follow the example in Mastering Regular Expressions (the same
one to which Elijah mentioned in the IP# thread earlier this
week - the calendar example)

   some pattern like

   (?:
      1[5-9]
         |
      2[0-9]
         |
      3[0-1]
   )

but depending on the distribution of values in the data, it might
be quicker to extract the last two digits and perform the suggested
numerical comparisons.  Benchmark would be enlightening :)

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Sat, 24 Jan 1998 02:35:31 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: HELP--Perl on MacIntosh
Message-Id: <1d3c8sj.bmx4skmjhxN@roxboro0-011.dyn.interpath.net>

gloria <gloria@akula.com> wrote:

> Hi I'm new here and  I am looking for any info about Perl for the
> MacIntosh environment. I am a software applications instructor and I was
> asked by my company to set up a curriculum for CGI/Perl. Can anyone guide
> me as to what I need on my system to study this? Is there a Perl
> interpreter I

Look for MacPerl.
 
> need? If so where can I download it for a Mac running on system 7.5.5? Do
> I need to run a Web server? WebStar?

You'll need something to test your CGI scripts.

> Any help will be gratefully appreciated. You can write me direct.Thank
> you.

If you want email copies of responses to your post see if you can't
include the header, Mail-Copies-To: gloria@akula.com

-- 
John Moreno


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

Date: Sat, 24 Jan 1998 00:25:50 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: HOw to check for file existence in each home directory of Unix users
Message-Id: <34C9967D.B209B78@5sigma.com>

no ... getpwnam or getpwent please!

	-joseph
	 http://www.effectiveperl.com

Clay Irving wrote:
> 
> In <34C7CA56.198FA24F@bms.com> Dan Roberts <roberts_d@bms.com> writes:
> 
> >What I need to do is check for the existence of a .forward file in each
> >of my users homme directories.
> >Then, if there is no .forward file in the users hoem dir I would get
> >that users loginid
> >printed to a file.
> 
> Something like:
> 
>   #!/usr/local/bin/perl -w
> 
>   # open the password file
>   open PWD, "/etc/passwd" or die "Can't open password file: $!\n";


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

Date: Sat, 24 Jan 1998 00:24:35 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: HOw to check for file existence in each home directory of Unix users
Message-Id: <34C99632.5255D3B8@5sigma.com>

$name = 'joseph';
$home = (getpwnam $name)[7];
print ".forward exists\n" if -e "$home/.forward";

	-joseph
	 http://www.effectiveperl.com

Dan Roberts wrote:
> 
> Hello
> 
> What I need to do is check for the existence of a .forward file in each
> of my users homme directories.


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

Date: Fri, 23 Jan 1998 12:09:34 -0500
From: "Michael Kairys" <kairys@mi.sl.com>
Subject: How to get at stuff piped into Perl?
Message-Id: <34c8db45.0@news.ic.net>

Environment: Windows NT, Perl 5.04.04

I want to pipe lists of files into Perl and assemble them into a command,
eg.

> grep foo * | myscript.pl

I can't figure out how to get at the output of the grep once I'm in
myscript.pl. I've read all the references I can find about pipes but they
all seem to be talking about using open and creating a process to read/write
from/to.




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

Date: Sat, 24 Jan 1998 01:42:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Is Perl cron-able?
Message-Id: <comdog-2401980142080001@news.panix.com>
Keywords: just another new york perl hacker

In article <01bd2867$6995a800$LocalHost@jgaff.earthlink.net>, "jgaff" <jgaff@_no_spam_technologist.com> posted:

> Does Perl have special problems or considerations when running as a cron
> job?

not anything specific to Perl.  it has the same considerations as
anything else run by cron.


> The cron man page said cron executes from its own environment variables
> which include
> a PATH of /bin:/usr/bin.
> The Perl executable program is in /opt/Perl5/bin. I will try linking that
> file to /usr/bin

use the path to perl in the #! line.  no special path is needed.

> Will the linked Perl executable program work as a link (hard or soft??)?

sure.  often /usr/bin/perl is a link.

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Sat, 24 Jan 1998 11:23:20 +0100
From: Pallotta Marco <marcop@unipg.it>
Subject: matrices...
Message-Id: <34C9C118.41C6@unipg.it>

Hi!!
How can I do if I want to use matrices in Perl ????????
That is, if I want (for istance) a 7 x 2 array how can i do?
I have an array with the days of the week:
@days = (mon,tue,wed,thu,fri,sat,sun);
I want associate every short name with the long name (mon with monday,
ecc. .....), and I want to create a 7 x 2 array.
I know I can make another array but I want to use only one.

If there is someone can help me I'd be very happy :))))))

Thanks
Marco.
-- 
                                \||||/
                                (o  o)
            _______________oOOOo_(__)_oOOOo_________________
 __________|               ******************               |__________
 \         |               * Marco Pallotta *               |         / 
  \        |               ******************               |        /
   \       |                                                |       / 
    \      |         1st e-mail: marcop@unipg.it            |      /
     \     |         2nd e-mail: marcop@rp.unipg.it         |     /
     /     |                                                |     \
    /      |           http://www.unipg.it/~marcop          |      \ 
   /       | http://cronos.rp.unipg.it/~marcop/welcome.html |       \
  /        |________________________________________________|        \
 /____________)              |___|  |___|               (_____________\
                              | |    | |
                             ooooO  Ooooo


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

Date: Sat, 24 Jan 1998 02:56:31 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: perl to delete Unix accts
Message-Id: <34C99EAF.C5E621F8@coos.dartmouth.edu>

Randy Rokosz wrote:
> 
> if ($username =~ /^([-\@\w.]+)$/) {
>  $username = $1;
> }
> system "/usr/sbin/userdel -r $username";

What would happen if $username didn't match that regular expression?

If it were, for example, "; rm -rf /"

Chipmunk


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

Date: Sat, 24 Jan 1998 00:33:06 -0600
From: rodney@bond.net
Subject: Re: POSIX (?) under perl for Win95
Message-Id: <885623049.153157643@dejanews.com>

In article <6aajka$pfs@srvr1.engin.umich.edu>,
  gsar@engin.umich.edu (Gurusamy Sarathy) wrote:
[snip]
> >
> >This one should have the POSIX stuff with it.
>
> Unfortunately, no.  Win32 is not POSIX compliant and that perl is a
> *Win32* port.  MS claims Windows NT is POSIX capable, but the POSIX
> subsystem can't access the Win32 subsystem and vice versa, so it is
> not much good.

The MS Posix subsystem is Posix.1. But it is hard to use. If you replace
the MS Posix subsystem with the OpenNT subsystem (read Unix) the above
problems largely go away. The Unix version of Perl runs on OpenNT with
no functionality loss (you can fork, exec, access sockets). OpenNT has
had this for months now (www.opennt.com). Why bother with the Win32 "port"
when it's missing so much??

- Rodney

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Sat, 24 Jan 1998 02:46:47 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Rexexp and href
Message-Id: <34C99C67.1EE1CC79@coos.dartmouth.edu>

brian d foy wrote:
> 
> In article <34C70B70.359B@netjob.dk>, e.christensen@netjob.dk posted:
> 
> >$linier=~ /(\<a href.*?\/a\>)/ig;
> >print $1;
> >
> >But it only gives me one matsch
> 
> when you do it like this, the matching operator
> faithfully does a global match.  since you aren't saving
> the results as you go along, it just keeps replacing $1
> with the next thingy it finds.  at the end you have the
> last thingy it found.

That is not true for the match operator in a scalar context.
The /g modifier is only significant inside a loop.
Otherwise, the match operator stops at the first match,
and at the end $1 holds the *first* thingy found.
It's only when inside a loop that the it will iterate
over later matches.

  DB<1> $_ = "abc"

  DB<2> m/(.)/g and print $1
a
  DB<3> m/(.)/ and print $1
a

Chipmunk


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

Date: Sat, 24 Jan 1998 01:45:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Server Push Problem
Message-Id: <comdog-2401980145530001@news.panix.com>
Keywords: just another new york perl hacker

In article <34C95871.247D@arrowweb.com>, mhanson@arrowweb.com posted:

> How come this server push program doesn't work? I have it named
> nph-mail.cgi but it keeps on giving errors. But i have checked it over
> and i can't find anything wrong with it. 

it would be helpful to include the error messages if you expect
useful help :)

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 23:27:35 -0600
From: Steel Viper <sviper@inav.net>
Subject: Some help with the 'reverse' command please.....
Message-Id: <34C97BC7.610B19B7@inav.net>

This is a multi-part message in MIME format.
--------------4BF7251FCC930332D12E42AC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


--------------4BF7251FCC930332D12E42AC
Content-Type: text/plain; charset=us-ascii; name="post.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="post.txt"

Please observe the following simple example:


#!/usr/bin/perl -w

# Get strings from STDIN
print("Enter lines of text and press <Ctrl-D> when finished:\n");
@string_array = <STDIN>;

# Print array out in reverse order
@string_array = reverse(@string_array);
print("\n@string_array\n");
print("\n" . reverse(@string_array) . "\n");


If this is run, the first print statement prints out the lines in the
opposite order they were entered, however the second print statement
reverses the entire line one at a time. I do not understand what is
going on. Please explain. Humble thanks.


Steel Viper

--------------4BF7251FCC930332D12E42AC--



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

Date: 24 Jan 1998 08:56:53 GMT
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: Some help with the 'reverse' command please.....
Message-Id: <885632213.258899@ridge.spiritone.com>

Steel Viper wrote in message <34C97BC7.610B19B7@inav.net>...
> print("\n@string_array\n");
> print("\n" . reverse(@string_array) . "\n");
>
> If this is run, the first print statement prints
> out the lines in the opposite order they were
> entered, however the second print statement
> reverses the entire line one at a time.

Dear Mr. Viper,

I think you need to consult two important pieces of documentation:

First, read the perlfunc manpage for the description of the 'reverse'
function.

Second, please check the documentation for "Mozilla 4.04 [en] (X11; U; Linux
2.0.32 i586)" and figure out how to send your questions in the message body
rather than as an attachment :-)

Aaron Harsh
ajh@rtk.com




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

Date: Sat, 24 Jan 1998 01:06:29 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Sort::Fields
Message-Id: <34C9A003.FAE63EC0@5sigma.com>

I'd like to wrap the code at the bottom of

  http://www.effectiveperl.com/recipes/sorting.html

and turn it into a module called Sort::Fields.  It would work
something like:

  use Sort::Fields;
  ...
  @sorted = fieldsort ':', ['3n', -2], @data;

I will probably enhance it so that field '0' is the entire original
text.

Any objections?  Pretty straightforward, would be useful.  I don't
want to make the interface more complicated, otherwise no one will
use it.  :-(

	-joseph

(followup to comp.lang.perl.modules)

-- 
Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Fri, 23 Jan 1998 23:09:01 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Survival Of perl
Message-Id: <34C9776D.781AE934@gpu.srv.ualberta.ca>

Aamer Nazir wrote:
!
! Hi,
! I have a question which some people would consider 'dumb, but it
! is not.I want to ask all of you people that what is the FUTURE of
! perl.I mean with the coming of NT servers and Softwares like
! FrontPage ,is perl going to survive.I am asking this question
! because I want to learn this language but first of all I would
! like to know what you people think about the language and what
! are its applications.

why would NT servers and FrontPage affect the continuing
survival of Perl?...

Perl is a versatile and extremely useful language...listing
its application areas would take far too much space and
only wind up exposing my ignorance of the plethora of 
problem spaces to which Perl can be usefully applied...

the only thing that I can think of that will come along and
affect the survival of perl5 is perl6 ... but given
the continuing survival of perl4, even this is arguable :-)

regards
andrew


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

Date: Fri, 23 Jan 1998 23:51:09 -0700
From: "John C. Quillan" <quillan@doitnow.com>
Subject: Re: Survival Of perl
Message-Id: <34C98F5D.1CB82731@doitnow.com>

Aamer Nazir wrote:
> 
> Hi,
> I have a question which some people would consider 'dumb, but it is not.I
> want to ask all of you people that what is the FUTURE of perl.I mean with
> the coming of NT servers and Softwares like FrontPage ,is perl going to
> survive.I am asking this question because I want to learn this language but
> first of all I would like to know what you people think about the language
> and what are its applications.
> Thanks in advance,
> Aamer Nazir
> nazira@cadvision.com

Learn the language.

Perl will be around for a long time.  It is already 10 years old.

It future is what ever it want or needs to be.  With its source
being free, and the ability to add extentions, Perl will continue
to grow and be able to solve new and chalanging problems.

As far as a language goes: You can argue back and forth about
programming language issues but what I can say I like about
perl is that it is PRATICAL.  It can get quite a few jobs
done, done well, and done quickly.

Enjoy Perl.

John C. Quillan


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

Date: Sat, 24 Jan 1998 06:50:52 GMT
From: cgrimes72@earthlink.net (Clint Grimes)
Subject: Win32 Perl 5 Bld 307 problem with system `commands`
Message-Id: <34cd8f47.1851052@news.earthlink.net>

Help! New guy learning Perl.
I'm using Perl 5.003_07

2 things:

1) Everytime I call an external command (i.e. `nbtstat -A $ip`) the A:
drive spins up (it's not in my system path) which slows down execution
considerably.  Why?  How can I stop it?

2) Output from system commands, like the above, don't feed $_ if I'm
currently in a Netware drive (Netware 4.11, Internetware Client 32).
I'm currently kludging my way around this by Mapping the Netware drive
to and NT Share and 'Net Use'ing the share.  I assume this is a side
effect of the VLM, but surely there's a fix or way around it.

Any help is greatly appreciated.  Maybe a different compiler set?

Thanks,
-Clint


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

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

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