[19244] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1439 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 3 21:05:28 2001

Date: Fri, 3 Aug 2001 18:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996887106-v10-i1439@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 3 Aug 2001     Volume: 10 Number: 1439

Today's topics:
    Re: cgi cookie question (Nils-Eric Pettersson)
    Re: cgi cookie question (Nils-Eric Pettersson)
    Re: COmments appreciated <james@zephyr.org.uk>
    Re: Dominus at TPC5 stuff now online <perlgirl@cfl.rr.com>
    Re: dselect-like Perl package manager? <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Engineering vs. Hacking (was Re: How to supply modu <godzilla@stomp.stomp.tokyo>
        FAQ: How do I sort an array by (anything)? <faq@denver.pm.org>
    Re: Having some trouble with map (Abigail)
    Re: Having some trouble with map (Abigail)
        How to use IO::Handle to open a pipe thedoctor@space.net
        HTPASSWD <sebastianyoung@btinternet.com>
    Re: PERL system function and variables (Scott)
    Re: PERL system function and variables <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Regular Expression:  Remove Double Letters from a S (Abigail)
    Re: What's the  regular expression to check emails and  (Abigail)
    Re: What's the  regular expression to check emails and  (Abigail)
    Re: What's the  regular expression to check emails and  (Abigail)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 03 Aug 2001 23:56:10 GMT
From: nils-eric@telia.com (Nils-Eric Pettersson)
Subject: Re: cgi cookie question
Message-Id: <3b6b3819.365543964@news1.telia.com>

Hmmmm

I'm not shure but if you try to change to %the_cookie in the second
script... Then I suppose you find your value in $the_cookie{howdy}.

My self is not using the CGI module for this...

You can find the cookie yourself in the environment vaiable named
HTTP_COOKIE  i.e.

$the_cookie = $ENV{HTTP_COOKIE};

This is very easy (I think) but you get the whole cookie "howdy=12345"
and have to pick out the value of it...

/NEP


On Fri, 03 Aug 2001 21:03:15 GMT, "Hmmm..." <blahblahblah@blah.com>
wrote:

>Hi.
>
>I am running test scripts to understand how cookies work with cgi.  I am
>trying to create a cookie in one script, and retrieve it in another.  Each
>script creates an html page to display the results. Here is the first script
>and it's output (which indicates that the cookie is created successfully:
>
>#!/usr/bin/perl -w
>############## start of first script #############
>use CGI;
>$query = new CGI;
>
>print <<top_html;
>content-type: text/html
>
><HTML><HEAD><TITLE>
>Creating the cookie.
></TITLE></HEAD><BODY>
>top_html
>
>$the_cookie = $query->cookie(-name=>'howdy',
>value=>'12345',  -expires=>'+3d');
>if (defined $the_cookie)
>{
> print "<p>the_cookie is defined $the_cookie";
>}
>else
>{
> print "<p>the_cookie is not defined $the_cookie";
>}
>
>print <<bottom_html;
></BODY></HTML>
>bottom_html
>############## end of first script #############
>The first script produces the output:
>
>the_cookie is defined howdy=12345; path=/cgi-bin/; expires=Mon, 06-Aug-2001
>20:31:38 GMT
>############## end of first output ############
>Here is the second script and it's output:
>
>#!/usr/bin/perl -w
>############## start of second script #########
>use CGI;
>$query = new CGI;
>
>
>print <<top_html;
>content-type: text/html
>
><HTML><HEAD><TITLE>
>Did the cookie come back?
></TITLE></HEAD><BODY>
>top_html
>
>$the_cookie = $query->cookie('howdy');

%answers = $query->cookie('answers');
# $query->cookie(-name=>'answers') works too!
>if (defined $the_cookie)
>{
> print "<p>the_cookie is defined $the_cookie";
>}
>else
>{
> print "<p>the_cookie is not defined $the_cookie";
>}
>
>print <<bottom_html;
></BODY> </HTML>
>bottom_html
>############## end of second script #########
>This second script produces the output:
>
>the_cookie is not defined
>############## end of second output ########
>
>Why can't I get the cookie in the second script?  Thanks.
>
>



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

Date: Sat, 04 Aug 2001 00:08:23 GMT
From: nils-eric@telia.com (Nils-Eric Pettersson)
Subject: Re: cgi cookie question
Message-Id: <3b6b3d26.366837534@news1.telia.com>

HEY

check out this adress:

http://stein.cshl.org/WWW/software/CGI/

/NEP

On Fri, 03 Aug 2001 21:03:15 GMT, "Hmmm..." <blahblahblah@blah.com>
wrote:

>Hi.
>
>I am running test scripts to understand how cookies work with cgi.  I am
>trying to create a cookie in one script, and retrieve it in another.  Each
>script creates an html page to display the results. Here is the first script
>and it's output (which indicates that the cookie is created successfully:
>
>#!/usr/bin/perl -w
>############## start of first script #############
>use CGI;
>$query = new CGI;
>
>print <<top_html;
>content-type: text/html
>
><HTML><HEAD><TITLE>
>Creating the cookie.
></TITLE></HEAD><BODY>
>top_html
>
>$the_cookie = $query->cookie(-name=>'howdy',
>value=>'12345',  -expires=>'+3d');
>if (defined $the_cookie)
>{
> print "<p>the_cookie is defined $the_cookie";
>}
>else
>{
> print "<p>the_cookie is not defined $the_cookie";
>}
>
>print <<bottom_html;
></BODY></HTML>
>bottom_html
>############## end of first script #############
>The first script produces the output:
>
>the_cookie is defined howdy=12345; path=/cgi-bin/; expires=Mon, 06-Aug-2001
>20:31:38 GMT
>############## end of first output ############
>Here is the second script and it's output:
>
>#!/usr/bin/perl -w
>############## start of second script #########
>use CGI;
>$query = new CGI;
>
>
>print <<top_html;
>content-type: text/html
>
><HTML><HEAD><TITLE>
>Did the cookie come back?
></TITLE></HEAD><BODY>
>top_html
>
>$the_cookie = $query->cookie('howdy');
>if (defined $the_cookie)
>{
> print "<p>the_cookie is defined $the_cookie";
>}
>else
>{
> print "<p>the_cookie is not defined $the_cookie";
>}
>
>print <<bottom_html;
></BODY> </HTML>
>bottom_html
>############## end of second script #########
>This second script produces the output:
>
>the_cookie is not defined
>############## end of second output ########
>
>Why can't I get the cookie in the second script?  Thanks.
>
>



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

Date: Sat, 4 Aug 2001 00:50:05 +0100
From: James Coupe <james@zephyr.org.uk>
Subject: Re: COmments appreciated
Message-Id: <gdpoq9Otiza7Ewwo@gratiano.zephyr.org.uk>

In message <9ker0n$hj8$3@mamenchi.zrz.TU-Berlin.DE>, Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de> writes
>    substr( $orig_message, 20) = '...' if length $orig_message > 20;

Based on the OP, however, this will shorten any *message* that is longer
than 20 characters, since he was having to extract the words from
$orig_message

-- 
James Coupe                                                PGP Key: 0x5D623D5D
                                                                 EBD690ECD7A1F
HEY, MOM! I FOUND SOME OF THOSE PEOPLE ON THE INTERNET           B457CA213D7E6
YOU WERE TELLING ME TO NOT TALK TO!                             68C3695D623D5D


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

Date: Fri, 03 Aug 2001 23:27:08 GMT
From: tuxy <perlgirl@cfl.rr.com>
Subject: Re: Dominus at TPC5 stuff now online
Message-Id: <3B6AFC56.2B0067A6@cfl.rr.com>

Mark Jason Dominus wrote:
> 
> The following items may interest you, and are now available on my web site:
> 
> * Slides from my talk on "The Identity Function"
> 
>         The title backfired: Too many people didn't know what the
>         identity function was, and those who did assumed that I must
>         have been referring to something else. The identity function
>         is a function such as sub identity { return $_[0] } which
>         returns its argument unchanged. In this talk, I show four
>         unexpectedly useful uses for the identity function.
> 
>         http://perl.plover.com/yak/Identity/
> 
> * Slides from my talk "Dirty Stories About the Perl Regex Engine"
> 
> Here's the description of this talk from the brochure:
> 
>      This talk is too short to tell you all about how the Perl regex
>      engine works---that would take years, and cost millions of
>      lives. Instead, I'll do three very brief case studies of how it
>      handles certain specific features. You've probably always
>      suspected that the Perl regex engine was concealed filthy secrets
>      and nasty surprises; these three features are noteworthy for
>      being particularly disgusting.
> 
>      Barf bags will be provided.
> 
>      Mark-Jason Dominus wrote the back-end of ActiveState's regex
>      debugger. He is presently recuperating at the Miskatonic
>      University Hospital in Whately, Massachusetts.
> 
> Full details are available, including a picture of the barf bags (Yes,
> I really brought barf bags. Did you think I was joking? I never joke.)
> and the complete slides from the talk.
> 
>         http://perl.plover.com/yak/dirty/
> 
> * My paper "Rx: A Regex Debugger for Perl", plus the source code for
>   Rx itself.  Also some early demo applications
> 
>         http://perl.plover.com/Rx/
> --
> @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
> @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
> ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
> close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print

Well Done MJD! I saw the identity f() in person thanks, but the dirty
secrets is a nice bonus here :)

Now to be honest you were over my head a lot, but I sort of followed the
talk. Basically what I came away with is that the identity function was
used to instantiate an object which was ref'ed outside the f(). I've
sort of done that myself, maybe not quite to explicitly, as an occasion
arises from time-to-time in which I need "something to ref" that won't
get destroyed.

I'm probably vastly over-simplifying or missing the point entirely; as I
said you were over my head. I liked your hat though VERY cute. And I
came away with some nice tricks and tips. Not quite a wized yet though -
more like wizened!

-PG


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

Date: Sat, 04 Aug 2001 00:44:32 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: dselect-like Perl package manager?
Message-Id: <3B6B2950.6010604@post.rwth-aachen.de>

F. Xavier Noria wrote:

>Is there any Perl package manager that resembles Debian's dselect?
>That is, it would be able to display available modules, search by
>author, category, ... (un)install modules, check dependencies, suggest
>modules, etc.
>
>-- fxn
>
Yes, there is, well....sort of. Type 'perl -MCPAN -e shell' and you can 
handle almost all module management there. Typing 'h' inside the shell 
will give you some help, more can be found with 'perldoc CPAN'.

When running this first (should be done as root), a couple of questions 
are presented to you. This only happens once.

Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(ord(chr($h->{$_}))))};





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

Date: Fri, 03 Aug 2001 15:13:22 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Engineering vs. Hacking (was Re: How to supply modules with your      software.)
Message-Id: <3B6B2202.3EEC7ED@stomp.stomp.tokyo>

David H. Adler AKA The CLPM Troll
deliberately trolled using an article nearly a month old:

> Godzilla! wrote:
> > David Coppit wrote:
> >> Godzilla! wrote:
> >> > David Coppit wrote:

> > (snipped)

> >> <sigh> Not everyone is here to burn you at the stake. Let me reiterate
> >> that I'm trying to change your mind, not tell you how to think. And I'm
> >> providing an alternative view to your "just code up every module you
> >> need" view.

> > You are practicing deceit as usual. You clearly stated,

> > "...do not advocate this position."
 
> You have omitted the beginning of that statement.  It started with the
> word "please", which, in normal english parlance makes it a request,
> rather than a demand.

(snipped remaining troll)


Are you the loving mouthpiece for the originating author?


Clear to me as a long time English teacher and English professor,
your reading comprehension skills do not surpass those of typical
middle school students; eleven to thirteen year olds. Should I elect
to comment upon your displayed intellectual skills, my comments would
be less than complimentary.


"Please do exactly as I command you."

"Please stand still while I set your head on fire."

"Please do not think for yourself."

"Please do not express your opinion."

"Please shut up right now."


Use of "please" certainly changes insulting context
to one of sundry pleasantries.

Please enroll in a Bonehead English class immediately.


* thinks this troll is desperate for fresh troll bait articles *


Godzilla!
-- 
$_="478558535575555150";
tr/873514/975318642abcdef/;
s/([0-9A-Fa-f]{2})/sprintf("%c",hex($1))/ge;
tr// H-OV-ZP-UA-G/;
print$_=reverse$_;exit;


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

Date: Sat, 04 Aug 2001 00:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How do I sort an array by (anything)?
Message-Id: <1aHa7.16$T3.171035648@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How do I sort an array by (anything)?

    Supply a comparison function to sort() (described in the sort entry in
    the perlfunc manpage):

        @list = sort { $a <=> $b } @list;

    The default sort function is cmp, string comparison, which would sort
    "(1, 2, 10)" into "(1, 10, 2)". "<=>", used above, is the numerical
    comparison operator.

    If you have a complicated function needed to pull out the part you want
    to sort on, then don't do it inside the sort function. Pull it out
    first, because the sort BLOCK can be called many times for the same
    element. Here's an example of how to pull out the first word after the
    first number on each item, and then sort those words case-insensitively.

        @idx = ();
        for (@data) {
            ($item) = /\d+\s*(\S+)/;
            push @idx, uc($item);
        }
        @sorted = @data[ sort { $idx[$a] cmp $idx[$b] } 0 .. $#idx ];

    which could also be written this way, using a trick that's come to be
    known as the Schwartzian Transform:

        @sorted = map  { $_->[0] }
                  sort { $a->[1] cmp $b->[1] }
                  map  { [ $_, uc( (/\d+\s*(\S+)/)[0]) ] } @data;

    If you need to sort on several fields, the following paradigm is useful.

        @sorted = sort { field1($a) <=> field1($b) ||
                         field2($a) cmp field2($b) ||
                         field3($a) cmp field3($b)
                       }     @data;

    This can be conveniently combined with precalculation of keys as given
    above.

    See http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html for more about this
    approach.

    See also the question below on sorting hashes.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           04.50
-- 
    This space intentionally left blank


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

Date: 3 Aug 2001 22:54:58 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Having some trouble with map
Message-Id: <slrn9mmav3.iik.abigail@alexandra.xs4all.nl>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCCXCII September
MCMXCIII in <URL:news:6djfmto237acp2ofnuim46oshgsjp47p0q@4ax.com>:
$$ John Joseph Trammell wrote:
$$ 
$$ >What side effects are these?  I've re-read 'perldoc -f map'; no
$$ >clue was imparted.
$$ 
$$ LOL! There are none. map() doesn't have side effects by itself.
$$ 
$$ It's just that the pure school of functional programming prefers not to
$$ allow *your* code to have any side effects in the map code block. These
$$ can be (likely incomplete list):

Eh, the school of functional programming doesn't say anything about 
map code blocks.

Functional programming doesn't *HAVE* side effects.

Period.

No assignment. No modificiations.

Not in map, but also not in for, while or if (If there's a functional
language with such contructs in the first place).

$$  * changing a "global" variable, e.g. a counter
$$  * changing a data structure (array, hash)
$$  * modifying the original data
$$  * I/O (e.g. printing a line per item)
$$  * generally: depending on the execution order of the code block for
$$ different items
$$ 
$$ Abigail is known for being in favor of allowing, even promoting all of
$$ the above.


It's a *feature*. It's exactly the same as being able to modify elements
of an array using a foreach block, or a for(each) modifier. Or modifying
the elements of @_. It's the same principle. And it isn't some test of
some evil God saying "here is a garden full of wonderful programming
constructs thou can use them all, except for the aliasing of $_ in
map blocks. Touch that, and thou shall be ashamed and exspelled from
the garden".


Please, explain to me in simple words, why is:

    foreach (@list) {$sum += $} 

ok, and why isn't

    map {$sum += $_} @list;

? And I bet you find (and if not you, some people who don't like side
effects in map don't mind the following):

    $sum += $_ foreach @list;



Could you give me one sane reason my "KEYWORD LIST CODE" and "CODE
KEYWORD LIST" are ok, and "KEYWORD CODE LIST" is a sin?


Believe me, I can understand someone say "no side effects". But I
cannot understand the reasoning "side effects in for fine, side effects
in map bad". It's like saying adding numbers if fine, unless you are
adding even numbers.


Abigail
-- 
BEGIN {my $x = "Knuth heals rare project\n";
       $^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
       $y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;


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

Date: 3 Aug 2001 22:55:58 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Having some trouble with map
Message-Id: <slrn9mmb10.iik.abigail@alexandra.xs4all.nl>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCCXCIV September
MCMXCIII in <URL:news:h7tjmt44pl0kfo8gqu5qnfhtgpem3lhhe8@4ax.com>:
!! John Kramer wrote:
!! 
!! >I was using map rather than for because there are 10 instances of this
!! >check running in a row and quite frankly I don't want to type out that
!! >many for loops.
!! 
!! ???
!! 
!! A map() plus block in void context is equivalent to one for loop.
!! 
!! One.
!! 
!! I think you should have written:
!! 
!! 	foreach (@port) {
!! 	     ... # content of map block here
!! 	}


Except for personal preference, could you give a reason?



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


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

Date: Fri, 03 Aug 2001 22:11:20 GMT
From: thedoctor@space.net
Subject: How to use IO::Handle to open a pipe
Message-Id: <3b6b1f93$2$oeczf$mr2ice@news.earthlink.net>

I have read how to use open() to establish a pipe.  I would like to use
IO::Handle so I could test properties of the filehandle [e.g., opened or
closed].

How do you open a pipe with IO::Handle?

thanks,

Paul Schwartz

-- 
-----------------------------------------------------------
Reply to brpms at earthlink dot net
-----------------------------------------------------------



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

Date: Sat, 4 Aug 2001 00:25:05 +0100
From: "Sebastian Young" <sebastianyoung@btinternet.com>
Subject: HTPASSWD
Message-Id: <9kfbuu$olc$1@uranium.btinternet.com>

This is the script:

  @abc = (a..z, A..Z, 0..9);
  srand;
  s/(.*)=(.+?)$/$2/;
  $cryptpass = crypt($input{'password'}, $abc[rand(@abc)].$abc[rand(@abc)]);

  open (htpasswd, ">.htpasswd");
      print htpasswd "$acnum:$cryptpass\n";
    }
  close (htpasswd);

It's generating the correct password that can be read by .htaccess but I'm
getting those black squares, which are stopping the htaccess file from
reading the htpasswd file correctly.

Any further ideas? Thanks.





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

Date: 3 Aug 2001 16:00:16 -0700
From: swcmeng@yahoo.com (Scott)
Subject: Re: PERL system function and variables
Message-Id: <169bb2e3.0108031500.7a5e9077@posting.google.com>

I usually don't respond to such doltish nonsense, but--really--you
need to try and lift that chip off your shoulders.  It's only holding
you back my friend.

 

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9mj9b2.skr.tadmc@tadmc26.august.net>...
> Scott <swcmeng@yahoo.com> wrote:
> >
> >I am trying to assign the output of the below system function-based
> >command to a variable.
> >
> >system "ls -d /etc/lp/interface/* | grep $lprinter";
>  
> >Does anyone know how to accomplish this?  
> 
> 
> Anybody who could be troubled to read the documentation for the
> functions they are using would know how to accomplish that.
> 
> I suggest that you start reading the documentation for the
> functions that you are using:
> 
>    perldoc -f system
> 
> 
> >Any assistance would be
> >greatly appreciated.
> 
> 
> The description of the function that you are using tells you how
> to accomplish what you want to accomplish. Just do it that way.


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

Date: Sat, 04 Aug 2001 01:14:15 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: PERL system function and variables
Message-Id: <3B6B3047.7090602@post.rwth-aachen.de>

Scott wrote:

>I usually don't respond to such doltish nonsense, but--really--you
>need to try and lift that chip off your shoulders.  It's only holding
>you back my friend.
>

Ah, be careful, my friend: You just entered slippery ground.

Requesting help on something that could have indeed been solved by a 
mere look-up in the perldocs  is one thing. But throwing such words to 
one of the most competent clpm-regulars is something that a lot of 
people will neither excuse nor tolerate. Had you followed this group for 
a while, you would have quickly realized that there is a handful of 
people who account for about 70% of all useful replies. From what I have 
read so for, Tad is one of those.

If you piss off one of those, changes are good that you wont get any 
further help from other people either. In fact, rules here a simple: Be 
polite, be sure to have used all available documentations (perldoc -f, 
perlfaqs, google-searches) and, well.....that's it. Acting against one 
of either will get you a warning, violating both probably a cosy place 
in some people's killfiles.


>tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9mj9b2.skr.tadmc@tadmc26.august.net>...
>
>>Scott <swcmeng@yahoo.com> wrote:
>>
>>>I am trying to assign the output of the below system function-based
>>>command to a variable.
>>>
>>>system "ls -d /etc/lp/interface/* | grep $lprinter";
>>>
>> 
>>
>>>Does anyone know how to accomplish this?  
>>>
>>
>>Anybody who could be troubled to read the documentation for the
>>functions they are using would know how to accomplish that.
>>
>>I suggest that you start reading the documentation for the
>>functions that you are using:
>>
>>   perldoc -f system
>>
>>
>>>Any assistance would be
>>>greatly appreciated.
>>>
>>
>>The description of the function that you are using tells you how
>>to accomplish what you want to accomplish. Just do it that way.
>>


Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};





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

Date: 3 Aug 2001 22:59:53 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Regular Expression:  Remove Double Letters from a String?
Message-Id: <slrn9mmb8b.iik.abigail@alexandra.xs4all.nl>

Mark Jason Dominus (mjd@plover.com) wrote on MMDCCCXCII September
MCMXCIII in <URL:news:3b679956.18b6$21c@news.op.net>:
## In article <3b676f1c$1_1@binarykiller.newsgroups.com>,
## Sped Erstad <sped@mailandnews.com> wrote:
## >Letter --> Leter
## >Mississippi --> Misisipi
## >
## >I had a couple of ideas that I was going down:
## >
## >$word =~ s/^(\D)$1{1,}/$1/gi;
## 
## Try
## 
##         $word =~ tr/A-Za-z//s;
## 
## The 's' is for 'squeeze'.


And if you all you have is letters, or all duplicate characters may
be squeezed, you can write that as:

    $word =~ tr///cs

too.



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]+Addition/s) [0]'


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

Date: 3 Aug 2001 23:09:20 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What's the  regular expression to check emails and to remove html
Message-Id: <slrn9mmbq2.iik.abigail@alexandra.xs4all.nl>

Ilmari Karonen (iltzu@sci.invalid) wrote on MMDCCCXCII September MCMXCIII
in <URL:news:996689523.26104@itz.pp.sci.fi>:
%% In article <slrn9mee1h.d4m.abigail@alexandra.xs4all.nl>, Abigail wrote:
%% >Miriam Raphael-Roberts (miriamraphael@yahoo.com) wrote on MMDCCCLXXXII
%% >September MCMXCIII in <URL:news:748729f5.0107220938.385b2e0f@posting.google.com>:
%% >%% Hi,
%% >%% I know that you can remove HTML from text by using one regular expression.
%% >
%% >Really? I'd like to see it. Most attempts don't even get close.
%% 
%% Well, s%<(-?[^>"'-]|-?"[^"]*"|-?'[^']*'|--(-?[^-])*--)*(>|$)%%g should
%% handle any valid tags and comments.  Extending it to handle marked
%% sections, null-end-tags, and any other SGML oddities one could think of
%% is left as an exercise for the reader.
%% 
%% The main difficulty it has is with CDATA, where a stray <" sequence
%% might trick it into deleting more than it should.  In any case, the
%% remaining string will contain no less-than signs, and therefore no
%% HTML tags.
%% 
%% Alone, the regex admittedly has little practical value.  However, the
%% right side of the substitution may be changed to allow a limited set of
%% tags to pass, in which case it _can_ be useful
%% 
%% Point?  Well, nothing.  You asked to see a regex that can strip HTML
%% tags from a string, or at least get close.  I had one lying around.


First example I tried was the string "++ <# #> ++". You substitution
left "++  ++". Unfortunally, "++ <# #> ++" can appear in an HTML document
and doesn't contain any special characters. It's just 11 data chars.




Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: 3 Aug 2001 23:10:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What's the  regular expression to check emails and to remove html
Message-Id: <slrn9mmbrc.iik.abigail@alexandra.xs4all.nl>

Ren Maddox (ren@tivoli.com) wrote on MMDCCCXCII September MCMXCIII in
<URL:news:m3lml3ikwx.fsf@dhcp9-161.support.tivoli.com>:
`` On 1 Aug 2001, iltzu@sci.invalid wrote:
`` 
`` > Well, s%<(-?[^>"'-]|-?"[^"]*"|-?'[^']*'|--(-?[^-])*--)*(>|$)%%g
`` > should handle any valid tags and comments.  Extending it to handle
`` > marked sections, null-end-tags, and any other SGML oddities one
`` > could think of is left as an exercise for the reader.
`` 
`` Doesn't handle dashes embedded within comments:
`` 
``   <!-- like -- this -->
`` 
`` That is legal HTML, isn't it?

No, it's not.


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};                # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: 3 Aug 2001 23:14:07 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What's the  regular expression to check emails and to remove html
Message-Id: <slrn9mmc31.iik.abigail@alexandra.xs4all.nl>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMDCCCXCII September
MCMXCIII in <URL:news:m1puafpjpk.fsf@halfdome.holdit.com>:
,, >>>>> "Ren" == Ren Maddox <ren@tivoli.com> writes:
,, 
,, Ren> On 1 Aug 2001, iltzu@sci.invalid wrote:
,, >> Well, s%<(-?[^>"'-]|-?"[^"]*"|-?'[^']*'|--(-?[^-])*--)*(>|$)%%g
,, >> should handle any valid tags and comments.  Extending it to handle
,, >> marked sections, null-end-tags, and any other SGML oddities one
,, >> could think of is left as an exercise for the reader.
,, 
,, Ren> Doesn't handle dashes embedded within comments:
,, 
,, Ren>   <!-- like -- this -->
,, 
,, Ren> That is legal HTML, isn't it?
,, 
,, Yes, but you're still within a comment. :)
,, 
,, That is, 
,, 
,,    hello <!-- blah -- blah --> there <!-- blah -- blah --> world
              ^       ^  ^
              start  end ERROR: not whitespace, not >,
                                and not start of a comment.
,, 
,, should render as "hello  world" in a compliant browser.  If it
,, renders as "hello   there  world" in your browser, please complain
,, to your browser manufacturer for providing a substandard comment
,, parsing logic.

You cannot blame a browser for doing something with invalid HTML.

,, That's because "--"'s are always *paired*.  If > appears inside a
,, pair, it's supposed to be ignored.  So says the spec.

Your example should read:

      hello <!-- blah --      --> there <!--      -- blah --> world

and then a compliant browser will show 'hello world'.



Abigail
-- 
use   lib sub {($\) = split /\./ => pop; print $"};
eval "use Just" || eval "use another" || eval "use Perl" || eval "use Hacker";


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 1439
***************************************


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