[7170] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 795 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 30 18:21:43 1997

Date: Wed, 30 Jul 97 15:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 30 Jul 1997     Volume: 8 Number: 795

Today's topics:
     Re: "Fast forward" within while loop? <dq@leland.Stanford.EDU>
     [Q] Converter between ELM filter-rules file to procmail <ricky@ornet.co.il>
     Re: accessing .dbf files (Dr. Frank J. Mabry, Jr.)
     Re: Any nice "Powered by Perl" gifs? (Logan Ratner)
     Re: Array n dimensions (RTFM! :-) <pittelli@ehsct7.envmed.rochester.edu>
     Re: comment (Tad McClellan)
     Difference between miniperl and perl (Danny Aldham)
     help with perl script for web server admin. (Shane Davies)
     Re: Help: Form2mail <pittelli@ehsct7.envmed.rochester.edu>
     Re: HELP: perl 5.001 WinNT <pittelli@ehsct7.envmed.rochester.edu>
     Need Survey script for $$$ <downtube@downtube.com>
     NEW Search Engine Secrets eric@searchmagic.com
     Nifty hash initialization, but why? (Mark A. Lehmann)
     Re: Nifty hash initialization, but why? <adam@fluid.com>
     Re: Opposite of ord <jbokma@caiw.nl>
     Perl code for statistics on linux maillog <tony@peregrinco.com>
     Re: Perl for DOS (Ed Thomson)
     Re: PERL on MS Internet Information Server <pittelli@ehsct7.envmed.rochester.edu>
     Re: perl on Win32 - fork() (Danny Aldham)
     Re: Perl Script with Netscape 4.01 <rootbeer@teleport.com>
     security holes in perl 5.00401 @_@ (Gil)
     send mail from perl <mkasikci@escortnet.com>
     Re: Sorting IP's (Daniel E. Macks)
     Re: supressing output (Michael James Braunstein)
     Re: Too many people in this group are arrogant #*(@# (R <zot@ampersand.com>
     Trouble with 'for my $line (@array) {...}' jmohr@grizzly.ccsd.k12.wy.us
     Re: Trouble with 'for my $line (@array) {...}' (Tim  Smith)
     Re: Unix time, local time, year 2000 question. (Michael Stillwell)
     Re: Unix time, local time, year 2000 question. <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 29 Jul 1997 18:32:50 -0700
From: Qiang Dai <dq@leland.Stanford.EDU>
To: Matt Roper <mattrope@mdhost.cse.tek.com>
Subject: Re: "Fast forward" within while loop?
Message-Id: <Pine.GSO.3.96.970729180037.16528A-100000@epic3.Stanford.EDU>

This does not quite do it because I may want to
do something with the lines_to_ignore -- I don't
want to ignore them. Also, the more interesting
case is when I have to identify the starting line
with a regex. An example:

 .
 .
 .
WantedBegin
 .
 .
 .
WantedEnd
 .
 .
 .

I want to extract the lines between WantedBegin
and WantedEnd. I could do something like:
$on = undef;
LOOP: while (<FIN>){
	some_stuff unless $on;
	if /WantedBegin/ {
		$on++;
		next;
	}
	if /WantedEnd/ {
		$on = undef;
	}
	other_stuff unless $on;

	print FOUT if $on; 
};

This is ok. But suppose I have many blocks I want
to process and extract to different files.
I could use while loop multiple times to extract each block
one at a time, or use a boolean for each block,
which is turned on when the starting line is 
encountered, and turned off when the ending line
is encounted. The former solution is too wordy,
while the latter is too confusing (and wordy too).

I would rather have this:

while (<FIN>) {
	some_stuff;
	if (/WantedBegin/) {
		next if /WantedEnd/; #switch to normal looping
		print FOUT;
		... 
		# The next line starts a special looping, which bypass
		# some_stuff and other_stuff. How?
		next_but_come_back_to_this_block;
	};
	other_stuff;
}

John


On Tue, 29 Jul 1997, Matt Roper wrote:

> 
> Maybe you need to use something like:
> 
> for ($i=1;$i<=$lines_to_ignore;$i++) {
> 	$junk=<FILEHANDLE>;
> }
> 
> Hope this helps.
> 
> 
> On Tue, 29 Jul 1997, Qiang Dai wrote:
> 
> > Hi,
> > 
> > I often need to extract certain number of lines from a file.
> > Sometimes I know how many lines I want, sometimes I
> > know what the starting and ending lines are. It would be
> > convenient if I could just ask the while loop to advance
> > so many lines, once I have identified the starting line,
> > without the lines being processed by other statements
> > in the while loop. I am now doing this by turning on and
> > off a boolean variable. It gets very confusing if I need
> > to do a few of these within the same while loop.
> > 
> > Is there a good construct in Perl that does this more
> > efficiently? 
> > 
> > Thanks,
> > John
> > 
> > 
> > 
> 
> ==============
> Matt Roper
> mattrope@mdhost.cse.tek.com
> 
> 

============================	=============================
Qiang John Dai			email: dq@leland.stanford.edu
Field of Finance	        Home Phone: 415-497-4807
Graduate School of Business	72E Escondido Village 
Stanford University		Stanford, CA 94305
============================    =============================

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! After August 1, 1997, the area code will change to 650 !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



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

Date: Tue, 29 Jul 1997 16:49:04 +0300
From: Ricardo Marek <ricky@ornet.co.il>
Subject: [Q] Converter between ELM filter-rules file to procmailrc file?
Message-Id: <33DDF4D0.41C67EA6@ornet.co.il>

Hello,

Does such animal exist? (to convert the ELM filter-rules file into a
procmailrc file

Please answer via e-mail

Thanks.

-- 
--- Ricky                            -*- Mode: Another-Unix-Hacker -*-
------------------------------------------------------------------------------
--- e-mail: ricky@ornet.co.il       ORNET Data Communication
Technologies Ltd.  
---   http://w3.ornet.co.il/~ricky           (A Siemens Company)
------------------------------------------------------------------------------
-    "With a PC, I always felt limited by the software available.
-     On Unix, I am limited only by my own knowledge." -- Peter J.
Schoenster


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

Date: 29 Jul 97 20:12:24 GMT
From: df6954@eecs1.eecs.usma.edu (Dr. Frank J. Mabry, Jr.)
Subject: Re: accessing .dbf files
Message-Id: <33DE4EA8.6AB8@eecs1.eecs.usma.edu>

Mike Aarset wrote:
 ...
> ... I want to make the info
> more organized in the files so that
> I can access the info or specific info
> in a more organized manner. Right now if I
> need to read some info off the file I can only
> read  a line at a time.


The following is from a response I wrote earlier today
about accessing simple (but possibly large) databases
from Perl ...

A simple approach that could be used to implement access 
to your database is as follows:

1-assume that the database is sorted by the leftmost data.  
   Each record is stored as a line of text.

2-modify the look code usually distributed with perl to use
   the file containing your database.

Look uses a binary search and assumes that the records of 
the database are stored as lines.  You could modify the code 
to use some other record format.  The basic technique of access
to a sorted, variable length record database has been around 
since before UNIX (I first recall bumping into the code in Multics).
Of course that sort of dates me, but then I am married with
grandchildren.

One very significant benefit of this approach is that
you can use a text editor to maintain the database 
(assuming that the database is ROCS (referenced often
but changed seldom) ... another assumption that you
must judge for yourself).

Just to save you time looking up the look.pl code 
I have appended it:

;# Usage: &look(*FILEHANDLE,$key,$dict,$fold)

;# Sets file position in FILEHANDLE to be first line 
;# greater than or equal (stringwise) to $key.  
;# Pass flags for dictionary order and case folding.

sub look {
    local(*FH,$key,$dict,$fold) = @_;
    local($max,$min,$mid,$_);
    local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,
		$size,$atime,$mtime,$ctime,
		$blksize,$blocks) = stat(FH);
    $blksize = 8192 unless $blksize;
    $key =~ s/[^\w\s]//g if $dict;
    $key =~ y/A-Z/a-z/ if $fold;
    $max = int($size / $blksize);
    while ($max - $min > 1) {
	$mid = int(($max + $min) / 2);
	seek(FH,$mid * $blksize,0);
	$_ = <FH> if $mid;		# probably a partial line
	$_ = <FH>;
	chop;
	s/[^\w\s]//g if $dict;
	y/A-Z/a-z/ if $fold;
	if ($_ lt $key) {
	    $min = $mid;
	}
	else {
	    $max = $mid;
	}
    }
    $min *= $blksize;
    seek(FH,$min,0);
    <FH> if $min;
    while (<FH>) {
	chop;
	s/[^\w\s]//g if $dict;
	y/A-Z/a-z/ if $fold;
	last if $_ ge $key;
	$min = tell(FH);
    }
    seek(FH,$min,0);
    $min;
}

1;
------------------------
I used look extensively in 1977 to develop a hypertext and 
knowledge base management system at the University of Illinois.  
 

Dr. Frank J. Mabry, Jr.
Dept. of Elec. Eng. & Comp. Sci.
U.S. Military Academy
West Point, NY 10996

Email: df6954@eecs1.eecs.usma.edu
Phone: (914)-938-2960


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

Date: 30 Jul 1997 18:45:49 GMT
From: ratner@dawn.cs.rice.edu (Logan Ratner)
Subject: Re: Any nice "Powered by Perl" gifs?
Message-Id: <5ro24t$khq$1@joe.rice.edu>

In article <01bc9cde$d3c64370$111e71c6@ohmigod>,
Jeffrey R. Drumm <drummj@mail.mmc.org> wrote:
>Hey, I hear Joe Camel is looking for work . . . and the obvious inference
>that "Perl Smokes" shouldn't displease the readers of this group.

Like the song says:
"I may have given up cigarettes, but that doesn't mean I stopped smoking!"

(couldn't resist)
-- 
Logan Ratner (ratner@rice.edu)   *  CRPC, Rice University, Houston
http://www.cs.rice.edu/~ratner/  *  http://softlib.rice.edu/CRPC/
Big Brother is clumsy and obvious,  Its Little Cousins that worry me.
         I am not Ms. Ratner despite what the NSA may think. 


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

Date: Tue, 29 Jul 1997 20:21:08 -0600
From: Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu>
Subject: Re: Array n dimensions (RTFM! :-)
Message-Id: <870225211.1155@dejanews.com>

Why not use an associative array? Works at least as far back as 4.036:
$t{$x,$y,$z) = "coordinates";

In article <5rebof$2sj3@eccws1.dearborn.ford.com>,
  fox@pt0204.pto.ford.com wrote:
>
> In article <33D8C1F0.456D@astro.estec.esa.nl>,
> Uwe Lammers <Uwe.Lammers@astro.estec.esa.nl> writes:
> >
> > Jerome Quelin wrote:
> > > How can I use (or simulate ?) array of n dimensions ?
> > > How can manipulate them ?
> >
> > [...] This is used to mimic multi-dim arrays in Perl which are not
> > natively supported.
>
> He should have answered with "read the manual!"  At least that would have
> been a *correct* answer...  You'll find out how to make a multi-dimensional
> array (or "List of Lists") in the perllol man page.  Here's an example
> from the first page of the manual:
>
> | A list of lists, or an array of an array if you would, is just a regular
> | old array @LoL that you can get at with two subscripts, like C<$LoL[3][2]>.
> | Here's a declaration of the array:
> |
> |     # assign to our array a list of list references
> |     @LoL = (
> |            [ "fred", "barney" ],
> |            [ "george", "jane", "elroy" ],
> |            [ "homer", "marge", "bart" ],
> |     );
> |
> |     print $LoL[2][2];
> |   bart
>
> Only works with Perl 5.  (Do we even need to say that anymore?)
>
> - Ken
>
> --
> Ken Fox (kfox@ford.com)                  | My opinions or statements do
>                                          | not represent those of, nor are
> Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
> Analytical Powertrain Methods Department |
> Software Development Section             | "Is this some sort of trick
>                                          |  question or what?" -- Calvin

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


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

Date: Tue, 29 Jul 1997 18:42:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: comment
Message-Id: <25vlr5.us3.ln@localhost>

Simon Fairey (sfairey@adc.metrica.co.uk) wrote:
: John Liao wrote:

: > Is there a equivalent  /*   */ for comments in perl?
               ^^^^^^^^^^^^^^^^^^^
               ^^^^^^^^^^^^^^^^^^^

:   Exactly the same as other shell scripts, use a hash to denote a
: comment.


Which is, of course, NOT equivalent to C's /*   */ ...


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


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

Date: 29 Jul 1997 22:28:25 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Difference between miniperl and perl
Message-Id: <5rmjdp$6uo$1@lennon.postino.com>

I am having a bear of a time building perl5.004_01 using
the gnuwin32 package from cygnus. I have got to the point
where I have built miniperl, all the utilities and most
(I think) of the libraries. I have manually stuffed the
libraries into the correct directories, and am considering
using miniperl instead of perl, which hasn't built yet.
What functionality is added to the perl binary over miniperl
that might cause me problems? 

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Wed, 30 Jul 1997 01:42:37 GMT
From: Shane.Davies.1@uni.massey.ac.nz (Shane Davies)
Subject: help with perl script for web server admin.
Message-Id: <33de9bae.73182676@news.massey.ac.nz>

Hello All,

I have a problem, I am running Netscape's Fasttrack web server on
win95 and wish to write a perl script to edit the user database used
by the server.

I am new to perl and all it's ways so would apreciate any help.

The script is to help in the registration of users at my web site
   http://telerobot.massey.ac.nz/

Thanks Shane.


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

Date: Tue, 29 Jul 1997 20:01:40 -0600
From: Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu>
Subject: Re: Help: Form2mail
Message-Id: <870224360.419@dejanews.com>

I'm not sure how form2mail works, but you can usemy deceptively simple
SMTP/sendmail mailer for Unix/NT at:
http://128.151.21.16/wwwrlp/perlcal/support.htm There's just two vars
that have to be set (actually, none to just test it out), and your forms
need 'redirect' and 'recipient' vars.

In article <01bc9c13$f69fa2e0$0d9ccbc7@alekto.alekto>,
  "Lior" <toot@inter.net.il> wrote:
>
> Hello!
> Thanks in advance for your help. I am using the Form2mail perl script for
> NT
> and it doesn't work for me at all. I made some changes
> According to the instruction they gave with the script and I am getting
> errors all
> over again (The changes marked with red in the file attached).
> Please help me with this one.
>                                           Lior.
>
> begin 600 form2mail.pl
> <encoded_portion_removed>
> 8#0H@(" @?0T*(" @("5&3U)-.PT*?0T*
> `
> end

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


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

Date: Tue, 29 Jul 1997 19:41:11 -0600
From: Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu>
To: leonid@cs.bu.edu
Subject: Re: HELP: perl 5.001 WinNT
Message-Id: <870222970.31878@dejanews.com>

Also, you may want to use a platform-independent method (well, that's my
opinion at least).
Try:

opendir(DIR,'/somewhere-from-root/');
print join("\n",readdir(DIR));
closedir(DIR);


In article <5rkm5p$2c6$1@news01.li.net>,
  lparillo@newshost.li.net (Parillo) wrote:
>
> If this fails when running on a web server, it could be directory
> permissions.
>
> lparillo at suffolk dot lib dot ny dot us
>
> Leonid Lamburt (leonid@cs.bu.edu) wrote:
> : I am trying to get the list of files in some directory:
>
> : The following doesn't work, even though I can execute the command
> : from the command prompt:
>
> : $files = `dir c:\somedir /B`;
> : print $files;
>
> : What am I doing wrong?
> : (If nothing, is there any work around ?)

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


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

Date: Wed, 30 Jul 1997 17:26:00 -0400
From: Downtube <downtube@downtube.com>
Subject: Need Survey script for $$$
Message-Id: <33DFB168.7C16@downtube.com>

I am looking for a cool survey script so that people can rate bike parts
from 1-10 on my site, with the script giving the average score of each
part. I also want it to have a password authorization so people can go
back and change their product reviews/ratings. the closest thing I found
was at Joe's scripts from the Crypt. Anyone know where I can find what i
want? If not, anyone want to create it for cash? e-mail me what you'd
charge for this. thanks in advance.


Yan


-- 
 /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
 \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
 /\                                                                   
 \/ Yan Lyansky <yan@downtube.com>                                     
 /\ Creator of the Downtube <http://www.downtube.com>                  
 \/ Ph.D. Candidate in Mathematics                                     
 /\ Biked X-Country                                                     
 \/              -----         
__o                                       
 /\         --   ----     _ \ \_                                       
 \/                     ......   (_)/
(_)                                   
 /\                                                                    
 \/                                                                   
 /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
 \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/


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

Date: 29 Jul 97 22:28:44 GMT
From: eric@searchmagic.com
Subject: NEW Search Engine Secrets
Message-Id: <33de6e9c.0@news1.abac.com>


HOW CAN YOU BECOME SUCCESSFUL ON THE INTERNET?
The Secret is Don't get lost in the Search Engines
Do you  want to know the secrets to getting the greatest number of hits by
BEST POSITIONING YOUR WEB SITE ON THE SEARCH ENGINES?  No problem, our
*complete* scientific study, shows exactly how!  In fact, the program is so
powerful, it's dangerous to your competitors
                    ...PLUS....
Two (2) absolutely NEW tricks just created by our staff on July 8, 1997
be the first to use them

http://www.e-earth.net/reports.htm


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

Date: 29 Jul 1997 18:03:29 -0500
From: mlehmann@prismnet.com (Mark A. Lehmann)
Subject: Nifty hash initialization, but why?
Message-Id: <5byb6psbpa.fsf@smokey.prismnet.com>

I really like this but I don't understand why this works and if it is
dangerous.

  @inputs = qw(first last email);

  @{\%values}{@inputs} = qw(Mark Lehmann mlehmann@earthling.net);

  now

  %values == ('first' => 'Mark',
              'last'  => 'Lehmann',
              'email' => 'mlehamnn@earthling.net')

Why does this work?


-- 
Mark Lehmann.


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

Date: Tue, 29 Jul 1997 18:59:03 -0700
From: adam margulies <adam@fluid.com>
Subject: Re: Nifty hash initialization, but why?
Message-Id: <33DE9FE7.15FB@fluid.com>

That is an obfuscated way of initializing a list:

a clearer example:

@{%h}{"1","2","3"} = ("a","b","c");

clearer still:

($h{"1"}, $h{"2"}, $h{"3"}) = ("a","b","c");





Mark A. Lehmann wrote:
> 
> I really like this but I don't understand why this works and if it is
> dangerous.
> 
>   @inputs = qw(first last email);
> 
>   @{\%values}{@inputs} = qw(Mark Lehmann mlehmann@earthling.net);
> 
>   now
> 
>   %values == ('first' => 'Mark',
>               'last'  => 'Lehmann',
>               'email' => 'mlehamnn@earthling.net')
> 
> Why does this work?
> 
> --
> Mark Lehmann.


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

Date: 30 Jul 1997 09:04:23 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: Opposite of ord
Message-Id: <01bc9cc7$a238fd00$c50ab2c2@tschai>



Christopher Chan <chris@cybertech.com.sg> wrote in article
<33DDC972.5AFB@cybertech.com.sg>...
> ord converts a alphabet to ascii.  Is there a function to do the
> reverse?  Thank you.

chr, e.g. chr(65) is "A" in ASCII. If you want to convert a list of
codes, use pack("C*", LIST);

(e.g. pack("C*", 65, 66, 67), gives ABC

see also page 151 of "Programming Perl" (2nd edition)

John


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

Need a Freelance Software Developer (MSc)? (CGI, Perl, Java, C, C++)

http://www.caiw.nl/~jbokma [Java demo's, Curriculum Vitae and
more...]

email: jbokma@caiw.nl  phone: +31 10 4291827



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

Date: Tue, 29 Jul 1997 14:53:18 -0700
From: Tony McCormick <tony@peregrinco.com>
Subject: Perl code for statistics on linux maillog
Message-Id: <33DE664E.2A4D7121@peregrinco.com>

Has anyone written a PERL pgm for getting and keeping statistics
from the /var/log/maillog file created (presumably) by Linux sendmail?

I looked at CPAN and searched the web to no avail.
 
-- 
Tony McCormick, Systems Analyst      (503) 690-1111
mailto://tonymcc@agora.rdrop.com or http://www.rdrop.com/~tonymcc
--  "Despite the cost of living, have you noticed how it remains so
popular?"--


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

Date: 30 Jul 1997 20:20:08 GMT
From: ethomson@cu-online.com (Ed Thomson)
Subject: Re: Perl for DOS
Message-Id: <5ro7lo$69q$1@news.cu-online.com>

A friend (masses@et.byu.edu) wrote:
> Has anyone seen perl for DOS?  No, Win32 doesn't work.
> Thanks for your time,

http://www.simtel.net/simtel.net/msdos/perl.html

Good luck.



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

Date: Tue, 29 Jul 1997 19:36:30 -0600
From: Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu>
To: alta@tab.com
Subject: Re: PERL on MS Internet Information Server
Message-Id: <870222254.31663@dejanews.com>

See:
http://128.151.21.16/wwwrlp/perlcal/support.htm
 ...a composite of info from a few sources, including Microsoft and my own
experience. The instructions for installing are the same as for upgrading.
Tell me if you have any problems.

-Randy

In article <01bc9bdd$be95d760$034eaacf@miked>,
  "ALTA RESEARCH" <alta@tab.com> wrote:
>
> We are in the process of configuring PERL (CGI) on the MS Internet
> Information Server.
>
> There is very little documentation, either from Microsoft or on the WWW.
>
> Has anyone come across a good information resource?
>
> Please help.
>
> This seems like a very heavy handed action by Microsoft.  Are they trying
> to limit support for PERL in an attempt to force everyone into ActiveX and
> Visual Basic?

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


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

Date: 29 Jul 1997 22:05:42 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: perl on Win32 - fork()
Message-Id: <5rmi36$6go$1@lennon.postino.com>

Scott McMahan (scott@lighthouse.softbase.com) wrote:
: Andrew Cheyne (stud6x19@bnr.ca) wrote:
: :    I am porting a Unix perl script to perl for Win32 and keep
: : getting an error message stating that fork is unspoorted. IS
: : this true? Is it available anywhere else? 
: Thanks to Windows NT's VMS origins, it uses the VMS process
: model, not the UNIX one. Forking as we know it in UNIX is
: impossible. Windows NT uses threads where UNIX would use
: processes. Since there are no multithreading packages
: for Win32 Perl that I know of, you're out of luck.

I do not believe this is correct. Using the GNU-win32 tools
from cygnus.com , it _is_ possible to write code that properly
forks. I still have not successfully built perl5.004_01 from
scratch using the gnuwin32 hints, but I have been able to build
miniperl, and it DOES support the fork function.

>From the gunwin32 faq:

   The next task was to port the tools to Win NT/95.  We could have done
this by rewriting large portions of the source to work within the
context of the Win32 API.  But this would have meant spending a huge
amount of time on each and every tool.  Instead, we took a substantially
different approach by writing a shared library (cygwin.dll) that adds
the necessary unix-like functionality missing from the Win32 API (fork,
spawn, signals, select, sockets, etc.).  (We call this new interface the
Cygwin32 API).  Once written, it was possible to build working Win32
tools using unix-hosted cross-compilers, linking against this library.

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.


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

Date: Wed, 30 Jul 1997 09:40:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Anthony Danh <cyberkid@tamos.gmu.edu>
Subject: Re: Perl Script with Netscape 4.01
Message-Id: <Pine.GSO.3.96.970730093136.23957L-100000@kelly.teleport.com>

On 28 Jul 1997, Anthony Danh wrote:

> 	Does anyone know why a perl script which ran perfectly with
> Netscape 3.X or lower, but could not run with Netsape 4.01?

Perl neither knows nor cares what version your browser is. In fact, it has
no idea that browsers exist. As far as Perl is concerned, it's all just
data in and data out. 

So, this question might be analogous to asking "Does anyone know why my
Toyota can go through the drive-through at MacDonalds but it won't go to
Burger King?" Chances are it's not the Toyota's fault. Maybe the problem
is that the driver keeps asking for a Quarter Pounder. Or maybe the driver
is getting lost and going to Dairy Queen by mistake. Or maybe the driver
went to Burger King and discovered that he had left his wallet in his
other pants. :-)

In any case, the problem doesn't sound like Perl's doing. See whether the
output of the script is in the right format for Netscape 4.01, possibly by
asking about it in a browser newsgroup. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 30 Jul 1997 00:24:08 GMT
From: mingtian@hotmail.com (Gil)
Subject: security holes in perl 5.00401 @_@
Message-Id: <33de8936.952112@usenet.kornet.nm.kr>

earth.gaianet.net has hacked by someone, the system admin
told me it was perl 5.00401, the hacker deleted /bin/sh
using perl 5.00401's security holes..

any opinion on this?

 ...
Gil 
Homepage: http://soback.kornet.nm.kr/~chlang/
">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">
!F 1W4k 3*?!0T4B >pA&3* GQ<[@L 2I@L?4@84O 0q8q1f 59>F3*?@4B  !F
">   594c ?6?!<- H/Hw 9L<RA~0m @V4B 5i2I GQ<[@L?M55 00>F    ">
!F     H%@Z@V>n >5>5GQ 3*@G 0!=??! Hq8A@; @|GXAV4x 2I        !F
!F                  "4^7!<- >HAV8i ;/>n6s"                   !F
">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">!%">


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

Date: Wed, 30 Jul 1997 10:24:16 +0300
From: "Murat KASIKCIOGLU" <mkasikci@escortnet.com>
Subject: send mail from perl
Message-Id: <5rmnfs$qko@jungle.escortnet.com>

Hi,

How can I send e-mail from perl program. ?

Thanks.

Murat.
mkasikci@escortnet.com
www.insaat.net


Ps. I'm using SCO UNIX SYSTEM 5 and have tried to make with MAIL::SEND.PM,
but didn't work.






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

Date: 28 Jul 1997 22:24:18 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: Sorting IP's
Message-Id: <5rj66i$ng3$1@netnews.upenn.edu>

Dennis Mercer (dmercer@Glue.umd.edu) said:
: I've got a quick perl question... Anyone here know of a way to sort IP's?
: The only thing I can think of is to grep the IP's from my database... It's
: a database of all our servers, and when I try to sort it by IP, it is
: slow, because it has to grep such a long range of numbers...  If anyone
: has any suggestions, please let me know...

Holy parallel threads, Batman! Mosey over to the thread that began
with msg-id <33DCACB1.322C@mathworks.com> (subject: interesting
sorting problem).

dan

-- 
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks



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

Date: 30 Jul 1997 00:35:43 GMT
From: mjb1@alpha3.csd.uwm.edu (Michael James Braunstein)
Subject: Re: supressing output
Message-Id: <5rm28v$tik@uwm.edu>

on 20 Jul 1997 21:45:13 GMT Greg Land muttered:
> Here is another problem I have... unrelated to the previos post.  I have a dos based file and want to remove the ^M's.  I know that the unix command to do this is dos2unix, but that prints out a message saying:

you can save loading perl if this is all you want to accomplish:

in c/tcsh:   cat file.dos | tr -d \015 > file.unix >&/dev/null
in ba/sh:    cat file.dos | tr -d \015 > file.unix 2>/dev/null


-mjb


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

Date: 30 Jul 1997 15:34:00 -0400
From: Mark Atwood <zot@ampersand.com>
Subject: Re: Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
Message-Id: <v6oh7ks5av.fsf@tick.dev.ampersand.com>

bart.mediamind@tornado.be (Bart Lateur) writes:
> 
> Just HOW do you do it? I bet you download every post in this newsgroup,
> and then grep through the files looking for your name. I dare even bet
> that it's written in Perl. :-)
> 

It's not terribly hard. I use DejaNews or AltaVista every few days to
look for *my* name. It's an easy way to find any follow ups to you in
threads you aren't following closely, or that havnt made it to you
yet.

Now what is slick is to write a script that hits the news archiver
automatically and builds a report slash web page pointing to all the
articles referring to you. I think Randal wrote such a thing up for
one of his magazine columns. The first one I ever saw is by Elf
Sternberg. I think there is a CPAN module that makes doing such a
thing easier now. I havn't bothered.

The canonical "first person" to scan the news stream for references to
himself was "Kibo". Is he going to follow up to this now that I have
invoked his Name? :)

-- 
Mark Atwood       | Thank you gentlemen, you are everything we have come to
zot@ampersand.com | expect from years of government training. -- MIB Zed



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

Date: Tue, 29 Jul 1997 16:02:25 -0600
From: jmohr@grizzly.ccsd.k12.wy.us
Subject: Trouble with 'for my $line (@array) {...}'
Message-Id: <870209639.19352@dejanews.com>

Recently there was a script by Randall Schwartz in (I think) SunExpert
(maybe it was SysAdmin) Magazine which went to the Dilbert web site and
got all the recent comic gifs from that site.  I found the script and
downloaded it, calling it dilbert.pl, but it won't compile under my
version of Perl 5.003 running on Linux.  I get this error:

Missing $ on loop variable at dilbert.pl line 44.

Below is the code. (I added the line numbers.)



I can't find a reference to this syntax.  I've always seen 'for' used in
the context as:

for (x=0;x<10;x++){
}

but not as in line 44.
I've also tried 'foreach $url (@old_urls)' but I get the error:

Variable "$url" is not imported at dilbert.pl line 44.
(Did you mean &url instead")

Is this something new in perl 5.004??  How can I get around this.  I have
a need for a variation of this script but I need to get it to compile
first.  Any suggestions??

TIA,

John Mohr
Communications Specialist
Campbell County School District
Gillette, Wyoming

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


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

Date: 29 Jul 1997 17:04:52 -0700
From: trs@azstarnet.com (Tim  Smith)
Subject: Re: Trouble with 'for my $line (@array) {...}'
Message-Id: <5rm0f4$la3@web.azstarnet.com>

In article <870209639.19352@dejanews.com>,
 <jmohr@grizzly.ccsd.k12.wy.us> wrote:
>I can't find a reference to this syntax.
>Is this something new in perl 5.004?

Yes, it's new to 5.004.  You should try something like:

my $url;	# lexical var, don't need no stinkin' package
foreach $url (@xyz) {
    # do something with $url
}

under 5.003.  Or, if you can, just upgrade to 5.004 and you'll save
being bit by other new code later on.

Enjoy,

Tim



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

Date: 30 Jul 1997 00:15:27 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <slrn45tt1sv.iok.mist@aurora.cc.monash.edu.au>

On Sun, 27 Jul 1997 01:46:08 -0400, Lynn Walton <wwalton@ee.net> wrote:
: I was surprised, when I stumbled upon a sentence I hadn't noticed before
: in the camel book (p. 185) where it says "the year field returned from
: localtime has had 1,900 subtracted from it."   I guess I had thought
: that the first 2 digits were just dropped.  If the book is correct, I
: would expect it to return the number 100 in the year 2000.

As other posts in this thread have stated, it will return 100.  I'm
interested, though, if all versions of perl will return 100, or if
this was a backwards-compatible change to deal with the Y2K problem.
There doesn't seem to be any good reason to return year - 1900 instead
of just year.

Michael

-- 
 .. ABSOLUT .SIG. ..
 .. Michael Stillwell ..
 .. mist@yoyo.cc.monash.edu.au ..
 .. http://yoyo.cc.monash.edu.au/~mist/ ..


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

Date: Wed, 30 Jul 1997 10:43:50 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Neil Briscoe <neilb@zetnet.co.uk>
Subject: Re: Unix time, local time, year 2000 question.
Message-Id: <Pine.GSO.3.96.970730104329.23957P-100000@kelly.teleport.com>

On 29 Jul 1997, Neil Briscoe wrote:

> Don't any of you experts ever make typos?

Of crouse not!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

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

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