[8575] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2192 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 27 05:08:14 1998

Date: Fri, 27 Mar 98 02:00:30 -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           Fri, 27 Mar 1998     Volume: 8 Number: 2192

Today's topics:
        3270 (DetlefEnge)
        Command line arguments (Tony Christian Svderudd)
    Re: Command line arguments <amar@iss-gmbh.de>
    Re: Copy file command. <jhi@alpha.hut.fi>
    Re: Flogging a Dead Horse Re: Primes via regexen (Abigail)
    Re: Flogging a Dead Horse Re: Primes via regexen <tchrist@mox.perl.com>
    Re: Forced log out after a defined total time, how? moetteli@citeu.unige.ch
    Re: How to generate a Cartesian product of a varying nu (brian d foy)
    Re: need regexp help <danboo@negia.net>
    Re: need regexp help (Abigail)
    Re: Odd-Numbered Array to Hash (Bart Lateur)
    Re: Perl Libraries y2k compliance <tchrist@mox.perl.com>
    Re: PROPOSAL: The Perl Dictionary (brian d foy)
    Re: PROPOSAL: The Perl Dictionary <uri@sysarch.com>
    Re: PROPOSAL: The Perl Dictionary (brian d foy)
        proposal: while $line (<FILE>) <danboo@negia.net>
        S.O.S Necesito Adobe Page Maker Versisn 3.0 para Window <vinfra@mad.servicom.es>
    Re: Someone put my munged e-mail address on a spam list <Russell_Schulz@locutus.ofB.ORG>
        Still a novice (getting older) still needing RegExpr he (stephen benson)
    Re: trivial example reveals a taint problem? <sbekman@iil.intel.com>
    Re: What is a JAPH (David Oswald)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 27 Mar 1998 09:02:22 GMT
From: detlefenge@aol.com (DetlefEnge)
Subject: 3270
Message-Id: <1998032709022201.EAA21659@ladder03.news.aol.com>

Is anybody aware of a module like Net::Telnet that is capable of emulating an
IBM 3270 terminal?

TIA

Detlef


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

Date: 27 Mar 1998 06:25:31 GMT
From: e75727@majakka.uwasa.fi (Tony Christian Svderudd)
Subject: Command line arguments
Message-Id: <6ffgor$77k$1@verkko.uwasa.fi>

I'm trying to do a program that modifies html-files. 
How do I pass the command line arguments to program as variables?
F.ex. 'program tony.html' should process the tony.html and
'program *' should process all html-files in directory.


Tony -- e75727@uwasa.fi 




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

Date: Fri, 27 Mar 1998 08:30:23 +0100
From: Amar Subramanian <amar@iss-gmbh.de>
To: Tony Christian Svderudd <e75727@majakka.uwasa.fi>
Subject: Re: Command line arguments
Message-Id: <351B558F.171E@iss-gmbh.de>

Tony Christian Svderudd wrote:
> 
> I'm trying to do a program that modifies html-files.
> How do I pass the command line arguments to program as variables?
> F.ex. 'program tony.html' should process the tony.html and
> 'program *' should process all html-files in directory.

you can read the arguments from the array @ARGV

regards amar


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

Date: 27 Mar 1998 10:28:21 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Copy file command.
Message-Id: <oeezpicv8pm.fsf@alpha.hut.fi>


gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
> Part of the power of perl is the ability to easily call external
> programs.  It's the UNIX way.  It's simple.  It's code reuse!

Spawning external programs is IMHO not the UNIX way, any OS or even
sub-OS can do that: the UNIX way is linking them intelligently, say,
with pipes.

> These are indeed very good reasons, and are the right answer
> as to why you should avoid system calls.

Errrrm, avoid system() calls, but do not hesitate using system calls :-)

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 27 Mar 1998 05:57:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Flogging a Dead Horse Re: Primes via regexen
Message-Id: <6fff4d$sjv$1@client2.news.psi.net>

and I can prove it! (jefpin@bergen.org) wrote on MDCLXVIII September
MCMXCIII in <URL: news:Pine.SGI.3.95.980326110020.4369A-100000@vangogh.bergen.org>:
++ On 23 Oct 1997, John L. Allen wrote:
++ 
++ >time perl -le '$N = shift; while ($_.=1, $n++<$N) {
++ >  print $n if /^(?!(11+)\1+$)/ }' $N
++ >
++ >time perl -le '$N = shift; while ($_.=1, $n++<$N) {
++ >  print $n if !/^(11+?)\1+$/ }' $N
++ >
++ >time perl -le '$N = shift; while ($_.=1, $n++<$N) {
++ >  print $n if !/^(11{1,${\int sqrt length}}?)\1+$/ }' $N
++ >
++ >For N=3000, I got real times of
++ >
++ >	1m36.93s
++ >	0m43.57s
++ >	0m30.32s
++ 
++ Hmmm... obviously.  your regex there is a little incorrect.  Try this
++ regex.  Abigail, this is faster than your current one.

*boggle*

If I was concerned about speed I would never have choosen a regex
to determine primeness in the first place. It's the surprise you
can do that in such few characters with a regex that's what counts.

++ Abby's: /^(11+)\1+$/
           12 characters
++ Faster: /^(11{1,int sqrt})\1+$/
           23 characters

Mine has a much better ratio of coolness/character.


$ perl -wle 'print "Prime" if (1 x shift) !~ /^(11{1,int sqrt})\1+$/' 4  
Prime

That doesn't seem correct to me.


(Taking the sqrt of $_? That doesn't make much sense to me)

(Besides, the "int sqrt" you have there is just an 'i' followed by
 an 'n' followed by a 't', etc. Nothing says "int sqrt" is actually
 evaluated)



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'


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

Date: 27 Mar 1998 07:55:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flogging a Dead Horse Re: Primes via regexen
Message-Id: <6ffm1r$cpa$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, abigail@fnx.com writes:

[various things about primes]

And here's this:
 
    # factor
    for ($N = shift; (1 x $N) =~ /^(11+?)\1+$/; $N /= $factor) {
        print $factor = length($1), " ";
    }
    print "$N\n";
 
--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


If you can stick your finger in it, you can hang from it.  --Andrew Hume


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

Date: 27 Mar 1998 07:52:41 GMT
From: moetteli@citeu.unige.ch
Subject: Re: Forced log out after a defined total time, how?
Message-Id: <6ffls9$jm7@uni2f.unige.ch>

Thanks for all the propositions so far!

I think I have to give some more detail about what I)m looking for:

We have 10 computers here and _many_ users. So I need to limit the time one user can use those computers.
So if for example I set that limit to 2h a day. One user could log in on computer A for 1/2h then for 1h on Computer B and would be forced to log out after having spent another 1/2h on a computer.
It shouldn)t matter, on which computer he spent how much time.

So most of the propositions are good if all users use just one computer (clobberd, accounting).
clobberd seems to be a very good choice, if it would centralize its statistics in one file (which could then be NFS-mounted -> flock, etc.).
Unfortunately idle time mesuring (tcsh, idled) is of no use here too, because it doesn)t matter if the user is idle or not.


Regards
Phil



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

Date: Fri, 27 Mar 1998 00:37:11 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to generate a Cartesian product of a varying number of sets?
Message-Id: <comdog-ya02408000R2703980037110001@news.panix.com>
Keywords: from just another new york perl hacker

In article <351AE28A.4ACDEA62@fmr.com>, steve.tolkin@fmr.com posted:

>The following snippet of code is an extract from a larger program
>that must generate the Cartesian product of a list of sets.

[ just to check my memory being that my discrete math books aren't
handy - the Cartesian Product is the set of unique n-tuples formed
by taking an element from each set involved in the operation.  right?]

hmmm... i immediately think about a list of lists (also called LoL).
when i think of LoL i think of the Perl Data Structures Cookbook, or
perldsc. 

how you form these sets is up to you, but ask a more specific question
if you get stuck on this part:

   # Formation of the sets, and references to them
   my $set_1 = \@some_array;
   my $set_2 = [ 1, 2, 3 ];

   # an array holding all of the references to the sets
   my $sets = [ $set_1, $set_2, ... [;

this is a rather crude matrix in which all of the columns are not
the same length.

>The problem is that the number of sets is not known until runtime.

no problem.  now the number of sets is

   my $number_of_sets = scalar @$sets;

and the number of elements in a set is

   my $number_of_set_elements = scalar @{$$sets[$set_number]};

which looks pretty funny, but reading the first couple of chapters
of the Panther Book [1] should help you out.  you'll get used to 
references after awhile.

   [1] 
   Advanced Perl Programming
   Sriram Srinivasan
   ISBN 1-56592-220-4
   <URL:http://www.oreilly.com>
   
>Two levels are temporarily hard coded.

ughhh... hard coding.

now we need to make the Cartesian Product.  purge your mind of all
FORTRAN and relax.  ponder.  meditate.  Think Perl.

remember that loops are just a way of remembering where we are in
this process so we know which element to use next.  however, if we
come up with a way to do that without the loops, our life becomes
easier.

what if we use a hashes to remember all of this?

   #we have a hash that helps us remember what we are doing
   my %pointer = (   #this is which position
                     #in the n-tuple (zero-based)
                     current_set => 0,
                     
                     #this is the current position
                     #within each set (zero-based).
                     #the position in the list
                     #corresponds to the set position
                     #in @$sets
                     current_element_in_set => []
                 )

we want to initialize this hash:

   #we need to initialize this hash
   $pointer{'current_set'} = 0;
   foreach( @$sets ) { push 
                       @{$pointer{'current_element_in_set'}}, 0 }                   

now we need to figure out a couple more things:

where are we going to hold the n-tuples that we produce?

   #we'll push the results into this array
   my @n_tuples = ();

how do we make the n-tuple?  this requires a bit more thought, but
we've already purged our minds of FORTRAN and pondered and meditated.
we need to:

   * take an element from the next set
 
   * once we reach the last element of a set, we move to the
   next element of the previous set next time around.  remember
   that you have to apply this rule recursively.

to do all of that, we need to know which set (which is the same
thing as element position in the n-tuple) with which we are
working:

      my $set     = $pointer{'current_set'};

and which element with which we are working in that set:

      my $element = ${$pointer{'current_element_in_set'}}[$set];

now we have everything we need to do the task without a gaggle of
infested loops.

here's everything put together.  it's a bit rough in places, but
i'm sure someone will fix those up for me.  and now back to work... :)

   #!/usr/bin/perl -w
   use strict;
   
   # how you make your sets is up to you
   my $set_1 = [ 1, 2, 3 ];
   my $set_2 = [ qw(a b c) ];
   my $set_3 = [ qw(just another new york perl hacker) ];
   
   # again, how you get them into the anonymous array is up
   # to you
   my $sets = [ $set_1, $set_2, $set_3 ];
   
   # how many sets do we have?  we'll need this number later
   my $number_of_sets = scalar @$sets;
   print "There are [$number_of_sets] sets\n";
   
   #this sorta assumes a non-empty set.  the point is to show how
   #to play with the references, not to be strict in the math.  we'll
   #use this number to know when to stop, but it's not a good way to
   #do this.  the Good Way is left to the reader to figure out.
   my $elements_in_product = 1;
   foreach ( 0 .. scalar @$sets - 1)
      {
      print "Set $_ has [", scalar @{$$sets[$_]}, "] members\n";
      $elements_in_product *= scalar @{$$sets[$_]};
      }
   print "We expect [$elements_in_product] n-tuples\n\n";
      
   
   #we have a hash that helps us remember what we are doing.  
   #this is going to solve the concern about all sorts of
   #infested loops.  if you know about C pointers, think
   #pointer arithmetic.  if not, well, don't kill yourself
   #trying to figure it out if you have trouble.  personally,
   #i needed to draw a picture.
   my %pointer = (   #this is which position
                     #in the n-tuple (zero-based)
                     current_set => 0,
                     
                     #this is the current position
                     #within each set (zero-based).
                     #the position in the list
                     #corresponds to the set position
                     #in @$sets
                     current_element_in_set => []
                 );
   
   #we need to initialize this hash.  remember that the arrays
   #are zero based, and that's how we'll use them.  the first
   #set is Set 0 and the first element of each set is Set 0
   $pointer{'current_set'} = 0;
   foreach( @$sets ) 
      { 
      push @{$pointer{'current_element_in_set'}}, 0 
      }                   
   
   my @n_tuples;  #holds the references to finished n-tuples
   my @temp = (); #holds the budding n-tuple
   
   
   WHERE_THE_MAGIC_HAPPENS: while(1)
      {
      my $set     = $pointer{'current_set'};
      my $element = ${$pointer{'current_element_in_set'}}[$set];
         
      push @temp, ${ $$sets[ $set ] }[ $element ];
   
      #if we are using the last set, we increment the element
      #number.  this can be cleaned up, but that's left as an
      #exercise to the reader.  sorry that i didn't have time
      #to make this block nice...
      if( $pointer{'current_set'} == $#{$sets} )
         {
         #move on to the next element, automagically wrapping around
         #if we move past the last element of the current set.  a
         #nice thing would be an array that caches the number of
         #elements in each set so we avoid the call to scalar().
         $pointer{'current_element_in_set'}[$set] =
            ( $pointer{'current_element_in_set'}[$set] + 1 ) 
                                        % scalar @{$$sets[$set]};
         
      
         #however, when we wrap around the elements of a set, we need 
         #to use the next element of the previous set.  we
         #automagically wrap that around too - recursively.
         while( $pointer{'current_element_in_set'}[$set] == 0 
                          and $set > 0)
            {
            $set = $set - 1 < 0 ? 0 : $set - 1;    
      
            $pointer{'current_element_in_set'}[$set] =
               ( $pointer{'current_element_in_set'}[$set] + 1 ) 
                                       % scalar @{$$sets[$set]};
            
            }     
         }
         
      #and move on to the next position in the n-tuple.  simply
      #increment the current_set pointer, automagically wrapping
      #around to the first set when we move past the last one.
      $pointer{'current_set'} = ( $pointer{'current_set'} + 1 ) 
                                          % $number_of_sets;
      
   
      #know when we've finished an n-tuple.  if the current_set is
      #zero, that means we're back to the first position in the
      #n-tuple, so we must have just finished one.
      #
      #i really don't like what i do with @temp, but that's how
      #it was when i ran out of time.
      if( $pointer{'current_set'} == 0 )
         {
         push @n_tuples, [@temp];  #here's a LoL!
         @temp = ();
         }
   
      #know when to stop (last element of each set).  this can be MUCH
      #more intelligent, but that's an exercise for the reader
      last if scalar @n_tuples == $elements_in_product;
      
      }
   
   #now let's print the results  
   $" = ", "; #the interpolated array delimiter
   foreach( @n_tuples )
      {
      print "@{$_}\n";
      }
         
   __END__

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


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

Date: Thu, 26 Mar 1998 22:19:43 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: need regexp help
Message-Id: <351B1ACF.B9C784CC@negia.net>

I have a life, and I can prove it! wrote:
> 
> >benjamin j snyder (bens@chippewa.cis.ohio-state.edu) wrote:
> >
> >: I am having trouble with a few things, mainly regexps.
> >
> >: I have the following line:
> >: @id_info = split (/./,$value);
> >                    ^^^
> >
> >   if ($value =~ tr/.// > 1)
> >      {print "more than one dot in '$value'\n"}
> >   else
> >      {print "less than or equal to one dot in '$value'\n"}
> 
> best make that $value =~ tr/././ because he may need $value later, WITH

[snip]

i believe you're assuming the behavior of the 'd' modifier to be the
default. with a null replace list the search list is automatically
replicated. so in the above case things are fine for harmless counting.

-- 
dan


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

Date: 27 Mar 1998 06:00:52 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: need regexp help
Message-Id: <6fffak$sjv$2@client2.news.psi.net>

and I can prove it! (jefpin@bergen.org) wrote on MDCLXVIII September
MCMXCIII in <URL: news:Pine.SGI.3.95.980326202124.13606A-100000@vangogh.bergen.org>:
++
++ 	\w is [a-zA-Z0-9_]

Bzzzt! Thank you for playing. \w *MIGHT* be [a-zA-Z0-9_], but it
depends on your locale.



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


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

Date: Fri, 27 Mar 1998 07:45:22 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Odd-Numbered Array to Hash
Message-Id: <351b54f4.1517028@news.tornado.be>

Ronald J Kimball wrote:

>>         push @data,'' if @data & 1;

>Sure, it "works".  But I'd hate to think anyone would seriously consider doing
>it.  If you're trying to make a hash from an odd number of elements, the
>problem is in how you populate the array.  Arbitrarily adding a null string to
>the end of the array is like covering up a hole in the wall with duct tape.
>
>What if the array were populated like this?
>
>@lines = ('name:Art', 'phone:', 'email:art@vandelay.com')
>
>foreach (@lines) {
>  push (@data, split /:/);
>}
>
># @data = ('name', 'Art', 'phone', 'email', 'art@vandelay.com')
>
>push @data,'' if @data & 1;
>%data = @data;
>
># %data = ('name' => 'Art', 'phone' => 'email', 'art@vandelay.com' => '');
>
>Obviously *not* what was desired.

Obviously not the best approach in this case, either. This would be a
lot better:

	@lines = ('name:Art', 'phone:', 'email:art@vandelay.com')
	
	foreach (@lines) {
		my ($key,$value) = split /:/;
		$data{$key} = $value;
	}

But anyway, that was not the question. Here's a quote from the original
poster:

>  (The reason for this is that the user left the phone number blank and it
>   got written out to a data file as "name\tArt\tphone\t". When I later
>   split on tab characters I got the above array).

In this specific case, it would work perfectly. I can also imagine other
approaches, by making "split" work more appropriately:

	($\,$,) = ("\n","/");
	$_ = "name\tArt\tphone\t";
	@data = split(/\t/,$_,-1);
	%data = @data;
	print %data;

It prints

	name/Art/phone/

Apparently, this works too.

	Bart.


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

Date: 27 Mar 1998 09:16:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Libraries y2k compliance
Message-Id: <6ffqp9$gpv$1@csnews.cs.colorado.edu>


All mumbles about Year 2000 compliance are just someone looking for
a lawsuit.  So, whom are you trying to sue, or avoid being sued by,
and why do we want to participate in your litigational trials and
tribulations?  :-)

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    It won't be covered in the book.  The source code has to be useful for
    something, after all...  :-)
            --Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>


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

Date: Fri, 27 Mar 1998 00:20:48 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <comdog-ya02408000R2703980020480001@news.panix.com>
Keywords: from just another new york perl hacker

In article <351B1E62.666B08D@coos.dartmouth.edu>, rjk@coos.dartmouth.edu posted:

>Eli the Bearded wrote:


>> perl -we 's ssqqprint qq\0just another new york perl hacker\n\0see'
>> perl -we 's ssqq^Hprint qq\0just another new york perl hacker\n\0^Hsee'
>
>I'm curious if you have actually run this snippet of code, or if you were so
>amazed at your cleverness you just assumed it would work...  :-)

this is a standard Elijah hack.  i would have thought that he would have
become bored with that cleverness long ago.  i wonder how his Playstation
newsreader handles it though.

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


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

Date: 27 Mar 1998 00:42:57 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <x7btusk7tq.fsf@sysarch.com>


i have been collecting the perl definitions we have posted. would anyone
like to see them on perl.com and/or perl.org under the humor categories?

i should html them and put them on my site.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net  --------  http://www.northernlight.com


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

Date: Fri, 27 Mar 1998 02:59:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PROPOSAL: The Perl Dictionary
Message-Id: <comdog-ya02408000R2703980259500001@news.panix.com>
Keywords: from just another new york perl hacker

In article <x7btusk7tq.fsf@sysarch.com>, Uri Guttman <uri@sysarch.com> posted:

>i have been collecting the perl definitions we have posted. would anyone
>like to see them on perl.com and/or perl.org under the humor categories?
>
>i should html them and put them on my site.

you should get the authors' permission as well ;)

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


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

Date: Fri, 27 Mar 1998 00:02:43 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: proposal: while $line (<FILE>)
Message-Id: <351B32F3.19B4B6B8@negia.net>

lately i've seen more and more mention of how:

  while (<FILE>) # reads a solitary 0 from the last line
                 # (i.e., magic 'defined')

differs from:

  while ($line = <FILE>) # fails to read a solitary 0 from the last
                         # line (i.e., no magic 'defined')

and how upsetting it is to have to wrap a 'defined' around it:

  while (defined($line = <FILE>)) # reads a solitary 0 from the last
                                  # line (i.e., explicit 'defined')

when i first learned the:

  foreach $line (@file)

construct, i just assumed (wrongly no doubt) that this would work
similarly for 'while':

  while $line (<FILE>)

at the time i wasn't even aware of the magic going on in the
case of isolated <>'s within a 'while'. i was just looking for a
way to get my line reads into a scalar other than $_ (i was
big on being explicit at the time. i'm all better now :).

anyway, it seems to me that this syntax would be helpful in
resolving the current situation. that is, auto-performing the
'defined', while copying the value into a scalar other than $_.
it combines two well known bits of magic instead of adding
another. that is, it avoids making 'while ($line = <FILE>)' do
an auto 'defined'. it also keeps that construct available for
those rare cases where it might be handy.

i know in the case of 'foreach', $line is a reference. but it seems,
in the potential case of 'while', that a copy might be more
appropriate due to it's typical usage (darn, i hate inconsistencies
like that).

any ideas, criticism?

-- 
dan boorstein


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

Date: 27 Mar 1998 09:22:46 GMT
From: "Luis Framit" <vinfra@mad.servicom.es>
Subject: S.O.S Necesito Adobe Page Maker Versisn 3.0 para Windows
Message-Id: <01bd5961$46c11280$09056ac2@DIRECTOR>

S.O.S.


Necesito una versisn del Adobe Page Maker 3.0 para Windows. Si tienes
alguna noticia por favor ponte en contacto conmigo.



E_mail:  vinfra@mad.servicom.es




Gracias



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

Date: Thu, 26 Mar 1998 20:14:17 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <19980326.201417.2W4.rnr.w164w@locutus.ofB.ORG>

rritzman@mindspring.com (Ron Ritzman) writes:

> About a year ago there was some guy here named Neil who viewed munging
> as a personal affront against him so he bragged about how he demunged
> all the addresses from this group and sent them to spammers.

Tom Christiansen (co-author of Perl) also used to (still does?)
demunge and put them on a special web page (and posts them).
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Fri, 27 Mar 1998 09:55:00 GMT
From: stephenb@scribendum.win-uk.net (stephen benson)
Subject: Still a novice (getting older) still needing RegExpr help....
Message-Id: <351b67b9.2334877@nntp.ibmpcug.co.uk>

I've been reading and trying, but I'm still missing something here:


open(PNFILE, "testPN_n.html") or die "Can't open testfile: $!\n";
while (<PNFILE>) {
	local $/ = undef;
	print "line number: $.\n$_\n\<A HREF=\"$1\">$1\</A\>\n\n"
#	if /\<!--webbot bot=\"Include\" u-include=\"(\w+\.html*)\"
tag=\"BODY\" startspan\s*--\>\.*<!--webbot bot=\"Include\" endspan
i-checksum=\"(\d+)\"\s*--\>/s
#	if /<strong>(WW Notes* to)\.*(\d*.*\d+)<\/strong>/s
	if /\<!--webbot bot=\"Include\" u-include=\"(\w+\.html*)\"
tag=\"BODY\" startspan\s*--\>/
}

It works for anything on a single line, but not across line endings
(the bits commented out]. 

Trying to find stuff like this in HTML files:

><!--webbot bot="Include" u-include="ww_notes_to_5_1.html" tag="BODY" startspan -->

><blockquote>
>.
>.

>            <td valign="top"><a name="c920b3cd" target="bas"><font size="2" face="Arial, Helvetica, Verdana"><strong>WW Note to
>            5.1</strong></font></a><font size="2" face="Arial, Helvetica, Verdana"> </font></td>
>        </tr>
>    </table>
>    </div>
></blockquote>

><blockquote>
>.
>.
></blockquote>
><!--webbot bot="Include" endspan i-checksum="51828" -->

I want to extract the file name and title, and then delete the block,
leaving just the link.
-- stephen benson
stephenb@scribendum.win-uk.net || stephen_benson@watsonwyatt.co.uk
http://www.ibmpcug.co.uk/~2i/ || http://www.scribendum.win-uk.net/
__________________________________________________________________


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

Date: Fri, 27 Mar 1998 11:11:30 +0300
From: Bekman Stanislav <sbekman@iil.intel.com>
To: Howard Cohen <hoco@shell5.ba.best.com>
Subject: Re: trivial example reveals a taint problem?
Message-Id: <351B5F32.6231@iil.intel.com>

> This is a problem for the experts who may follow this newsgroup.
> 
> I am working with:
> 
>       perl, version 5.004_04 built for i586-linux
> 
> And this trivial example script fails!
> 
>       #!/usr/local/bin/perl -T
> 
>       $ENV{PATH}="/bin";
>       $host=`/bin/hostname`;
> 
>       print "host=$host\n";
> 
> I get this error message:
>       Insecure $ENV{ENV} while running with -T switch at testit line  

Weird, indeed never heard of $ENV{ENV}
But why do you need $ENV{PATH}="/bin"; if you call your hostname with 
full path? why not $ENV{PATH}=''; Did you try it?


______________________________________________________________________
Stas Bekman     mailto:sbekman@iil.intel.com [just another webmaster]
Home Page:      http://www.eprotect.com/stas
A must visit: 	http://www.eprotect.com/stas/TULARC (Java,CGI,PC,Linux)
Linux-il Home:  http://www.linux.org.il/		    
    
Linux receives a 'Product of the Year Award' for Best Technical Support
http://www.infoworld.com/cgi-bin/displayTC.pl?97poy.supp.htm


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

Date: Fri, 27 Mar 1998 07:57:04 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: What is a JAPH
Message-Id: <351b5a0a.25113805@news.xmission.com>

On 27 Mar 1998 06:38:36 GMT, csscook@mailbox.uq.edu.au (Steven John
Cook) wrote:

>I am trying to move from a User to Expert in the 'Seven Levels of Perl
>Mastery' and one of the only things left for me to do is write a JAPH. The
>only problem is I don't even know what JAPH stands for, so I can't write
>one. Can a current Perl expert or higher enlighten me.
>
>
It's one of those nifty little .signature lines that in very few
characters of Perl code, and in a well obfuscated method, the words
"Just Another Perl Hacker" are printed to stdout.  The one-liner
JAPH's were first seen (according to popular legend) on Randal
Schwartz's .sig lines.  Others how admire his ingenuity (and who
wouldn't?) caught on and produced their own one liners.  

For more information on the word 'hacker' check out the URL's pointed
to by Randal's .sig line.  The word has been misunderstood by the
non-computer literate world, and Randal is paying a high price for
that misunderstanding.




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

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

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