[12303] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5903 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 6 06:07:15 1999

Date: Sun, 6 Jun 99 03:00:16 -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           Sun, 6 Jun 1999     Volume: 8 Number: 5903

Today's topics:
        A Perl RegEx Question  <dpodbori@email.msn.com>
    Re: A Perl RegEx Question  (Andrew Johnson)
        Bulk E-Mailing <mrdank@sprintmail.com>
    Re: Bulk E-Mailing <jbc@shell2.la.best.com>
    Re: Bulk E-Mailing (Lee)
    Re: How do I ensure that the regexp DOESN'T conatin a s (Fuzzy Warm Moogles)
    Re: How do I ensure that the regexp DOESN'T conatin a s (Andrew Johnson)
        How to diff two time vars <Allenz@qd.lucent.com>
    Re: I'm looking for some virgin men, send me a message  <jester@isdead.aha>
    Re: It don't work !  What are my mistakes ??? <bruno.baguette@francemel.com>
    Re: Need help with script <rx@rxlist.com>
        News::Article and sendmail zombies !! <aaa@cs.stanford.edu>
        PERL T SHIRT FOR SALE <brownjj@iserve.net>
    Re: problem clearing an array of array smnayeem@my-deja.com
        Problem with REX (again) (Ryan Ngi)
    Re: Problem with REX (again) (Hasanuddin Tamir)
    Re: The artistic license and perl: <rra@stanford.edu>
    Re: Very very short tutorial about modules <jbc@shell2.la.best.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 6 Jun 1999 01:40:30 -0400
From: "Dmitry P." <dpodbori@email.msn.com>
Subject: A Perl RegEx Question 
Message-Id: <#ssb559r#GA.297@cpmsnbbsa02>

    $_ = 'abbbbbc';

    my ( $b1 ) =~ /^a(b)+c$/;     # RegEx 1
    my ( $b2 ) =~ /^a(b+)c$/;     # RegEx 2
    my ( $b3 ) =~ /^a(b*)c$/;      # Regex 3
    my ( $b4 ) =~ /^a(b)*c$/;      # Regex 4

What is the difference between these regexes and which one is better
written?

Thanks in advance.





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

Date: Sun, 06 Jun 1999 06:21:05 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: A Perl RegEx Question 
Message-Id: <lro63.51334$tE.570266@news2.rdc1.on.home.com>

In article <#ssb559r#GA.297@cpmsnbbsa02>,
 Dmitry P. <dpodbori@email.msn.com> wrote:
!     $_ = 'abbbbbc';
! 
!     my ( $b1 ) =~ /^a(b)+c$/;     # RegEx 1
!     my ( $b2 ) =~ /^a(b+)c$/;     # RegEx 2
!     my ( $b3 ) =~ /^a(b*)c$/;      # Regex 3
!     my ( $b4 ) =~ /^a(b)*c$/;      # Regex 4
! 
! What is the difference between these regexes and which one is better
! written?

Before I discuss differences among the regexen, I'll point out
that one similarity in your 4 regex statements is that none of
them will compile :-)

Now, the major differences among the regexen can be discerned by
merely printing the results (after fixing the code):

$_ = 'abbbbbc';

my ( $b1 ) = /^a(b)+c$/;     # RegEx 1
my ( $b2 ) = /^a(b+)c$/;     # RegEx 2
my ( $b3 ) = /^a(b*)c$/;      # Regex 3
my ( $b4 ) = /^a(b)*c$/;      # Regex 4

print "b1:$b1\nb2:$b2\nb3:$b3\nb4:$b4\n";
__END__
which prints:
b1:b
b2:bbbbb
b3:bbbbb
b4:b

To put it in rough terms:
The difference between b1 and b2 is that the former captures a 'b'
and stores it in $1, then it tries to capture another 'b' and store
in $1 (overwriting the first one) and so on. That is, the 'b' stored
in $b1 is the last one matched by the repeated application of (b)+.
In the case of b2, the parentheses capture all the 'b' characters it
can (all at once) and stores them in $1. Also, b1 is less efficient
because it must continually capture and store each 'b' it hits.

Which one is "better" depends on what you "really" wanted it to do,
but you probably wanted the behavior of b2 or b3, and the difference
between these two is that b2 must match at least one 'b' while b3 can
match successfully when no 'b' intervenes between the 'a' and 'c'.

hope this helps.
regards
andrew


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

Date: Sun, 6 Jun 1999 01:13:54 -0400
From: "Dani Koesterich" <mrdank@sprintmail.com>
Subject: Bulk E-Mailing
Message-Id: <7jd09p$f5c$1@oak.prod.itd.earthlink.net>

Hello, if anyone can help me out I would appreciate it.

I wrote a script to send out my newsletter issues.  My
subscribers list exceeds 10,000 so it has to be good, and
no screw ups.  I wrote one, and tried it out with 300
people on my list, and it failed after 100 and when I
tried with the last 200 it worked.  Does anyone have
any ideas why it failed?

Here is the codes to it:

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

require "cgi-lib.pl";
&ReadParse;

&Display_Admin if ($in{'admin'} eq '1');

&No_Access if (!($in{'password'}));
&No_Access if (!($in{'database'}));
&No_Access if (!($in{'subject'}));
&No_Access if (!($in{'from'}));
&No_Access if (!($in{'message'}));
&No_Access if (!(&Check_Password));
&No_Database if (!(-e "$in{'database'}"));
&No_Message if (!(-e "$in{'message'}"));

#Set Variables
$pw = $in{'password'};
$database = $in{'database'};
$subject = $in{'subject'};
$from = $in{'from'};
$message = $in{'message'};
$mailprog = '/usr/sbin/sendmail';

print "Content-type: text/html\n\n";
open(DATABASE, $database);
@Addresses = <DATABASE>;
close(DATABASE);
$count = 0;

foreach $address(@Addresses){
 chomp $address;
 &Send_It_Out;
 $count++;
}
print <<HTML;
<html>
<head>
<title>Successful</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><Font face="Arial" size="4" color="#FF0000"><B>Mailout
Successful!</B></Font></p><BR>
<font face="Arial" size="3">Your $message has been sent to $count
people!</font>
</body>
</html>
HTML
exit;

sub No_Access{
 print "Content-type: text/html\n\n";
 print <<NoAccess;
<html>
<head>
<title>No Access</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><Font face="Arial" size="4" color="#FF0000"><B>You do not
have access to this file</b></font></p>
</body>
</html>
NoAccess
exit;
}

sub No_Database{
 print "Content-type: text/html\n\n";
 print <<NoDatabase;
<html>
<head>
<title>No Database Found!</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><Font face="Arial" size="4" color="#FF0000"><B>No Database
Found!</B></Font></p>
<BR><Font face="Arial" size="3" color="#000000">The file $database has not
been found.  Make sure it is in the same directory as this script.</font>
</body>
</html>
NoDatabase
exit;
}

sub No_Message{
 print "Content-type: text/html\n\n";
 print <<NoMessage;
<html>
<head>
<title>No Message Found!</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p align="center"><Font face="Arial" size="4" color="#FF0000"><B>No Message
Found!</B></Font></p>
<BR><Font face="Arial" size="3" color="#000000">The file $message has not
been found.  Make sure it is in the same directory as this script.</font>
</body>
</html>
NoMessage
exit;
}

sub Check_Password{
 return '1' if ((lc $in{'password'}) eq 'avigayil');
}

sub Send_It_Out{
 open(MAIL,"|$mailprog -t");
 print MAIL "To: $address\n";
 print MAIL "From: $from\n";
 print MAIL "Subject: $subject\n\n";
 open (MESSAGE, $message);
 while ($line = <MESSAGE>){
  chomp $line;
  print MAIL "$line\n";
 }
 close (MESSAGE);
 close (MAIL);
}

sub Display_Admin{
print "Content-type: text/html\n\n";
print <<Admin;
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Send Out Bulk E-Mail</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<p align="center"><font color="#FF0000" face="Arial" size="4"><b>Send Out
Bulk E-Mail</b></font></p>

<form method="post">
  <div align="center"><center><table border="0" cellpadding="2" width="80%">
    <tr>
      <td width="56%" align="left" valign="top"><font face="Verdana"
size="2" color="#0000FF"><b>E-Mail
      Database Filename:</b></font><br>
      <font face="Verdana" size="2" color="#000000"><small>Note: must be in
same directory as
      this script and must be in following format:<br>
      Email1\@Host1.com<br>
      Email2\@Host2.com<br>
      etc.</small></font></td>
      <td width="44%" align="left" valign="top"><input type="text"
name="database"
      value="database.lst" size="30"></td>
    </tr>
    <tr>
      <td width="56%" align="left" valign="top"><font face="Verdana"
size="2" color="#0000FF"><b>From:</b></font><br>
      <font face="Verdana" size="2" color="#000000"><small>Note: if you want
your name
      displayed, use:<br>
      &quot;Name Name&quot; &lt;email\@host.com&gt;</small></font></td>
      <td width="44%" align="left" valign="top"><input type="text"
name="from"
      value="&quot;Name Name&quot; &lt;email\@host.com&gt;" size="30"></td>
    </tr>
    <tr>
      <td width="56%" align="left" valign="top"><font face="Verdana"
size="2" color="#0000FF"><b>Subject:</b></font></td>
      <td width="44%" align="left" valign="top"><input type="text"
name="subject" size="30"></td>
    </tr>
    <tr>
      <td width="56%" align="left" valign="top"><font face="Verdana"
size="2" color="#0000FF"><b>Ascii
      Message File</b></font><br>
      <font face="Verdana" size="2" color="#000000"><small>Note: file must
be in same directory
      as this script.</small></font></td>
      <td width="44%" align="left" valign="top"><input type="text"
name="message"
      value="message.txt" size="30"></td>
    </tr>
    <tr>
      <td width="56%" align="left" valign="top"><font face="Verdana"
size="2" color="#0000FF"><b>Password:</b></font></td>
      <td width="44%" align="left" valign="top"><input type="password"
name="password" size="30"></td>
    </tr>
    <tr>
      <td width="100%" colspan="2" align="center" valign="top"><input
type="submit"
      value="Send Out Mail"></td>
    </tr>
  </table>
  </center></div>
</form>
</body>
</html>
Admin
exit;
}





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

Date: 06 Jun 1999 06:27:46 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: Bulk E-Mailing
Message-Id: <375a14e2$0$201@nntp1.ba.best.com>

Dani Koesterich <mrdank@sprintmail.com> wrote:
> Hello, if anyone can help me out I would appreciate it.

> I wrote a script to send out my newsletter issues.  My
> subscribers list exceeds 10,000 so it has to be good, and
> no screw ups.  I wrote one, and tried it out with 300
> people on my list, and it failed after 100 and when I
> tried with the last 200 it worked.  Does anyone have
> any ideas why it failed?

I don't notice any load-checking code in your script; it appears that
it opens a pipe to your mailer program for each address, with no
pausing to let things settle down when the number of mailer processes
gets too high. Is it possible there's some kind of memory or CPU
limitation that's kicking in to shut your script down at some point?

When I started using a script like this to mail to a mailing list, I
pretty quickly realized it needed to check the machine's load, and stop
sending messages for a bit when the load got too high. Here's an
extract from the script I'm using:

# How much load is too much?
$highload = .8 ;

# later, in the loop that sends the messages:
    while (($currload = &Load) > $highload) {
        print "5-minute load average is $currload; sleeping...\n" ;
        sleep 10 ;
    }

# later still, the definition of the &Load subroutine:
sub Load {
    # Test system load and wait if it's too high
    @uptime = split /,/ , `uptime` ;
    $fraction = $uptime[3] ;
    $load = (split /:/ , $fraction)[1] ;
    return $load ;
}

Obviously, this is sensitive to the output format of the uptime
command. I'm sure there's a much more elegant way of doing this, but
this has worked well for me so far.

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Sun, 06 Jun 1999 04:41:48 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: Bulk E-Mailing
Message-Id: <B37FAC8C966871513@204.112.166.88>

In article <7jd09p$f5c$1@oak.prod.itd.earthlink.net>,
"Dani Koesterich" <mrdank@sprintmail.com> wrote:

>I wrote a script to send out my newsletter issues.  My
>subscribers list exceeds 10,000 so it has to be good, and
>no screw ups.  I wrote one, and tried it out with 300
>people on my list, and it failed after 100 and when I
>tried with the last 200 it worked.  Does anyone have
>any ideas why it failed?

Nope. But...

1) You don't check that your opens and closes succeed, so I assume you
don't check the mail pipe either. If sendmail gacks, it will tell you why.

2) You could send all that mail with a single call to sendmail by sending
it to the list administrator and bcc-ing it to the recipients. It may be
prudent to break the recipients into groups of 100 or so, though. Find a
newsgroup that knows and cares about sendmail, and ask them.

Lee




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

Date: Sun, 06 Jun 1999 07:41:43 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: How do I ensure that the regexp DOESN'T conatin a string?
Message-Id: <375a1dc7.6009752@news.oz.net>

On Sun, 06 Jun 1999 00:14:30 -0400, CY <k1001@netzero.net> wrote:

>What to do if you want to match 
>
>/$stringA.*?(no $stringB).*?$staringC/
>
>in one line of regexp?  (In English, that's a string with stringA,
>stringC in the beginning and the end without $stringB inbetween. 
>Thanks.

This works for some values of $A, $B and $C:

  /$A(?:.(?!$B))*?$C/;

-- 
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


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

Date: Sun, 06 Jun 1999 08:26:44 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: How do I ensure that the regexp DOESN'T conatin a string?
Message-Id: <8hq63.51391$tE.574853@news2.rdc1.on.home.com>

In article <375a1dc7.6009752@news.oz.net>,
 Fuzzy Warm Moogles <tgy@chocobo.org> wrote:
! On Sun, 06 Jun 1999 00:14:30 -0400, CY <k1001@netzero.net> wrote:
! 
! >What to do if you want to match 
! >
! >/$stringA.*?(no $stringB).*?$staringC/
[snip]
 
! This works for some values of $A, $B and $C:
! 
!   /$A(?:.(?!$B))*?$C/;

but not when $B immediately follows $A in the
string ... which would require an additional
negative look-ahead check right after the $A.

(and not, of course, when $C starts with $B which
is what I assume you meant by 'some values of...').

regards
andrew 


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

Date: Sun, 6 Jun 1999 16:43:58 +0800
From: "Allen zhao" <Allenz@qd.lucent.com>
Subject: How to diff two time vars
Message-Id: <7jdc85$hls@nntpb.cb.lucent.com>

Hi,u

There is  a problem. I don't know how to diff two time variables.For
example:

$tm1="May 5 12:0:0";
$tm2="May 6 13:1:1";

How can I get the difference between the two time points? I want to get a
result such as "1 day 1 hour 1 min 1 sec".

Thank you for your help in advance.

Allen




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

Date: Sun, 6 Jun 1999 17:16:31 +0930
From: "Jester" <jester@isdead.aha>
Subject: Re: I'm looking for some virgin men, send me a message and what you're in to.
Message-Id: <VRo63.1927$H21.9480@ozemail.com.au>

At least you posted to the right NG :-)

LOL.......

(or am I just speaking for myself)

Jen Balcmon wrote in message <7jbpva$nea$6@newsfeed.smartt.com>...
>I'm looking for some virgin men, send me a message and what you're in to.
>




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

Date: Sun, 6 Jun 1999 10:31:44 +0200
From: "Bruno Baguette" <bruno.baguette@francemel.com>
Subject: Re: It don't work !  What are my mistakes ???
Message-Id: <7jdc9u$o93$5@xenon.inbe.net>

>If that's really the full source, then the ReadParse function was never
>defined.
>
>I expect you meant to require 'cgi-lib.pl'.  Better than that, though,
>would be to use CGI.

You are the "PERL GOD" !

My CGI is working now !

Thanks a lot !!!

----------------------------------------------------------------------------
--
Bruno Baguette  (bruno.baguette@francemel.com)




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

Date: Sun, 06 Jun 1999 00:38:15 -0700
From: "Neil Sandow, Pharm.D." <rx@rxlist.com>
Subject: Re: Need help with script
Message-Id: <375A2566.9DCB19CC@rxlist.com>

Tom,
I appreciate your reply but this approach doesn't seem to get me any more
results than the first one.
I have a text file which has >900 lower case words (1 per line) which is set
as my $wordsfile.
Some, but not all, of these words are contained in my html file being used to
test this script (also lower case).

I realize that it's possible to get some unwanted results should one word be
found as part of another.
What concerns me more right now, however, is that neither the original script
or the script with the
modifications you suggested replaces any of the words with the tagged words.
There must be something
basic which is wrong with the one of the statements but it certainly is
alluding me.

Adding the -w to > #!/usr/bin/perl  gives the following output:
Name "main::wordkount" used only once: possible typo at parse2.pl line 19.
Name "main::linekount" used only once: possible typo at parse2.pl line 30.
1 Processing zolpid_ad.htm...

no further errors are reported and the resulting file is no different than the
source except for the insertion of
the javascript at the very top.  I tried changing wordkount to linekount which
gets rid of the error output
but has no effect on the final results.

Any other thoughts?


Thanks! -Neil


Tom Phoenix wrote:

> On Sat, 5 Jun 1999, Neil Sandow, Pharm.D. wrote:
>
> > Subject: Need help with script
>
> Please check out this helpful information on choosing good subject
> lines. It will be a big help to you in making it more likely that your
> requests will be answered.
>
>     http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
>
> > #!/usr/bin/perl
>
> It's generally advisable to use -w and 'use strict' so that Perl will try
> to let you know what's going wrong with your code.
>
> > open(W,"$wordsfile");
>
> Those quote marks are merely misleading.
>
> Even when your script is "just an example" (and perhaps especially in that
> case!) you should _always_ check the return value after opening a file.
>
> > $SAVEBACKUP && $VERBOSE && print "Saving Backups while processing.\n";
>
> This use of those operators as control structures is mostly more confusing
> than it's worth. The exception is when checking return values and using
> "or die"-type constructs. I'd write that line like this, perhaps:
>
>     print "Saving Backups while processing.\n"
>         if $SAVEBACKUP and $VERBOSE;
>
> But consider making those two variables true constants (with or without
> the 'use constant' pragma), since then Perl can optimize away some
> unneeded code.
>
> > opendir DIR, ".";
>
> This is another case where you should be checking the return value. It may
> seem surprising - how could it be that you can't open the current
> directory? But the permissions could be set to disallow reading.
>
> > while ($thisfile = readdir(DIR)) {
>
> Of course, despite the name, it may be a directory or some other non-file.
>
> >    if ($thisfile =~ /\.htm[l]?$/) {
> >       $kount++;
> >       $VERBOSE && print "$kount Processing $thisfile...\n";
> >       open (H,"$thisfile");
> >       $linekount = @lines = <H>;
> >       close H;
> >
> >       open (NEWH,">$thisfile");
>
> This just wiped out the file, right? (But you've still got the data in
> @lines.)
>
> >       $SAVEBACKUP && open (BCK,">$thisfile.bak");
>
> Why not do this, instead? First, open the file for reading. Then, if you
> want a backup, rename it to the backup file name; if you don't, simply
> unlink it. (This is Unix-dependent, however.) Now open the original name
> for output. You can copy lines of input (still coming from the original
> file) to the output (the new file with the original name), and if your
> program crashes halfway, you'll still have the backup file (if you wanted
> it). In fact, perl makes this easy to do with the $^I variable.
>
> >       &printJavaScript();
> >       foreach $line (@lines) {
> >       $SAVEBACKUP && print BCK "$line";
> >        foreach $word (@wordlist) {
> >          $line =~ s/[\n ]$word[\n., ]/ <a
> > href=javascript:defwindow('$word')>$word<\/a> /;
>
> You're recompiling the pattern many _many_ times (number of words x number
> of lines x number of files). And since some words may be hidden within
> larger words, or may appear more than once per line, I'm not sure that
> that's doing what you want, anyway. For example, if 'window' is one of the
> words, you could replace 'defwindow' with something you didn't intend.
> Maybe this is better?
>
>     my $pattern = join '|', @wordlist;  # Near top of progam
>
>     $line =~ s{\b($pattern)\b}
>         { <a href=javascript:defwindow('$1')>$1</a> }go;
>
> Well, that should get you started. Good luck with it!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 05 Jun 1999 22:08:02 -0700
From: "Amr A. Awadallah" <aaa@cs.stanford.edu>
Subject: News::Article and sendmail zombies !!
Message-Id: <375A0232.2CE1BC61@cs.stanford.edu>


Hi,

  I am using Andrew Gierth's News::Article module to read some newsgroups
postings and send them to me by e-mail. The problem that I am facing is 
that it leaves a lot of sendmail zombies around (one for each mail it sends).

  Did any body encounter this before? Do you know the solution for this?
  (the hack solution I use now is to kill my program, which kills all 
   zombie children, then start it again).

  Do you know a better mail-module to use? even though I like News::Article
  a lot.

Thanx,

-- Amr


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

Date: Sun, 6 Jun 1999 02:32:35 -0500
From: "Jamie Brown" <brownjj@iserve.net>
Subject: PERL T SHIRT FOR SALE
Message-Id: <7jd7go$lmb$1@news.inc.net>

http://www.gware.net






<img src=http://www.spamm.net/images/geek_banner_sm.gif border=0 width=460
height=60 alt="check out GeekWare for all your GEEK needs!">
<P>
<img src=http://fp.iserve.net/brice/perl_shirt.gif><p>
PERL Coder's Shirt<br>
You're a hard-coding, perl hacking, script writing machine!<br>
 You won't break a sweat on your next project with our PERL shirt!
<p>(back reads: "We code more before 9am than most people code all day")


100% Cotton in GI Green

L, XL, XXL (stock: 10-PERL)


$4.50 shipping and handling.



See the other cool stuff at the web site!!!
<img src=http://www.spamm.net/images/geek_banner_sm.gif border=0 width=460
height=60 alt="check out GeekWare for all your GEEK needs!">





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

Date: Sun, 06 Jun 1999 06:14:05 GMT
From: smnayeem@my-deja.com
Subject: Re: problem clearing an array of array
Message-Id: <7jd3ja$nnj$1@nnrp1.deja.com>

In article <2mpaj7.dvk.ln@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
> smnayeem@my-deja.com wrote:
>
> :   for ($i = 0, $i <= $#$MyArray, $i++) {
>
>    s/,/;/g;   # you should give 3 statements to for()
>
oops, sorry, actually in my real program i used the ; instead of , but
my problem remains, as soon as i access an array/hash again, the
previous values gets retained and the new ones are appended :(

smnayeem
smnayeem@agni.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sun, 06 Jun 1999 07:02:33 GMT
From: ryanngi@hotmail.com (Ryan Ngi)
Subject: Problem with REX (again)
Message-Id: <375a1c2c.15301876@news.inet.co.th>

i found this in webreview

<\s*a\b[^>]+\bhref\s*=\s*(?:["\']?)([^>\s"\']+)

he said

[^>]+             <---- means at least one character that is not a ">"

why it's not mean "the first charector must be >"...

when will the "^" means the beginning of sentence?
when will the "^" means 'not' a charector?

confusing so much....


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

Date: 6 Jun 1999 23:14:38 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Problem with REX (again)
Message-Id: <slrn7lkebb.nci.hasant@borg.intern.trabas.co.id>

On Sun, 06 Jun 1999 07:02:33 GMT, Ryan Ngi <ryanngi@hotmail.com> wrote:
> i found this in webreview
> 
> <\s*a\b[^>]+\bhref\s*=\s*(?:["\']?)([^>\s"\']+)
> 
> he said
> 
> [^>]+             <---- means at least one character that is not a ">"
> 
> why it's not mean "the first charector must be >"...

Because it's in the character class as enclosed by
`[]' (square bracket).

> when will the "^" means the beginning of sentence?

It's default behaviour unless /m modifier is in effect.

> when will the "^" means 'not' a charector?

When there's a backslash in front of it, or,
like I said above, it's in character class.

> confusing so much....

   unless $do_ perldoc_perlre && $do_perldoc_perlop;


HTH,
-hasan-
uhm, no more sig(h)


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

Date: 05 Jun 1999 22:45:10 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: The artistic license and perl:
Message-Id: <ylyahxyja1.fsf@windlord.stanford.edu>

Russ Allbery <rra@stanford.edu> writes:
> Kai Henningsen <kaih=7IIwMjk1w-B@khms.westfalen.de> writes:
>> rra@stanford.edu (Russ Allbery) wrote:

>>> And note that the Open Source Definition does *not* talk about the use
>>> of the item, and in private e-mail with Eric Raymond that's apparently
>>> *intentional* and it's *expected* that someone can change a licensing
>>> fee per use.

I've gone back to this e-mail conversation, and I should clarify this.  My
understanding is that Eric doesn't feel there's a problem with charging
money for software in general, that the purpose of the open source
definition is to make sure the source is available, not to prevent that,
and that *provided that the usage fee doesn't propagate to derivative
works* he doesn't seen a problem with it.

The board doesn't have a position; this is just Eric's personal position.

>> Interesting claim, given that Eric was, IIRC, not even involved in
>> drafting that definition in the first place.

> My understanding is that it is, at this point, intentional.  Eric didn't
> know whether it was originally intention in the Debian guidelines.  I
> need to follow up on that e-mail conversation, since some of the
> implications are rather interesting.

This is stronger than I think Eric's position warrants.  My apologies.
The above is a more accurate statement.

> My reading of the Open Source definition is that one can charge a fee
> per use of the software and provided you supply the source code and
> allow redistribution of the source code, you're still compliant.  In
> other words, an Open Source license that requires everyone *using* the
> software or any work derivative of it to pay you money per use, but
> gives them free access to the source code, would comply with the
> definition.

This still stands.

> I wrote Eric privately and presented this interpretation, and his
> response seemed to indicate to me that he agreed with my interpretation
> and had no problems with that implication of the OSD.

The exception being that he feels the usage fee should not propagate to
derivative works.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 06 Jun 1999 05:31:30 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: Very very short tutorial about modules
Message-Id: <375a07b2$0$201@nntp1.ba.best.com>

In comp.lang.perl.misc Mark-Jason Dominus <mjd@plover.com> wrote:

> I have written a very very short tutorial about modules.  It has two
> parts.  Each part has one extremely simple sample module file, an
> extremely simple sample program that uses it, and seven exercises.
> That is all.

> Here I am trying to cover the most important 20% in
> 1% of the space.  The strategy I took was to not explain anything at
> all, but to try to provide examples that explained themselves.

> It is now available at 

> 	http://www.plover.com/~mjd/perl/Hello/

I think it would have been very helpful for me, as an accidental
programmer, to have had this available when I first started writing
modules. As it turns out, I was able to figure things out from the
previously existing documentation, but I had to do a fair amount of
mental filtering of detail that I wasn't really ready for.

In general, I think it would be a really wonderful thing if more gurus
occasionally took the time to create documentation like this. I
especially like how you never once felt compelled to refer to your
reader as an "idiot". Good for you.

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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