[9157] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2775 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 31 23:07:17 1998

Date: Sun, 31 May 98 20:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 31 May 1998     Volume: 8 Number: 2775

Today's topics:
    Re: Advanced Perl Programming Book <stuartc@ind.tansu.com.au>
    Re: Any kind of help is hard to find. <mike.schleif@aquila.com>
    Re: Building 5.004 on BSDi ?? <jdkemp@airmail.NOSPAM.net>
    Re: Don't Know how to decrypt using PERL (Gary M. Greenberg)
    Re: Email address checking <metcher@spider.herston.uq.edu.au>
        file output and modules (Chris Schafer)
    Re: Internet Relay Chat (Tad McClellan)
    Re: lockf question <tchrist@mox.perl.com>
    Re: Random permutations in Perl (Mark-Jason Dominus)
    Re: Random permutations in Perl <bowlin@sirius.com>
    Re: read and write (Martien Verbruggen)
        reading variable lists <info@pornoinferno.com>
    Re: Sockets and E-mail (Robert Webb)
    Re: split behavious (Mike Heins)
    Re: split behavious (Craig Berry)
    Re: whois <REPLY_TO_damonbrent@earthlink.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 01 Jun 1998 10:41:47 +1000
From: Stuart Cooper <stuartc@ind.tansu.com.au>
Subject: Re: Advanced Perl Programming Book
Message-Id: <yeoemxac5ro.fsf@kudu.ind.tansu.com.au>

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


> In comp.lang.perl.misc, 
>     "Christopher R. Redinger" <redinger@usm.maine.edu> writes:
> :what the heck is on the cover of
> :Advanced Perl Programming by O'Reilly?? We've been calling it the "Puma
> :Book." But, I'm not too sure about the accuracy of that one. Any ideas?

> It's actually a black leopard, and we all call it the ``Panther Book''.
> The word panther denotes any large cat, usually in its darker color morph.
> A mountain lion, a leopard, or a jaguar could all be black panthers.

>     http://work.ucsd.edu:5141/cgi-bin/http_webster?panther
> 
> --tom

I'm reminded of this poem by Ogden Nash:

The Panther
===========

The Panther is like a leopard
Except it hasn't been peppered
Should you behold a panther crouch
Prepare to say "Ouch"
Better still, if called by a panther
Don't anther.

Hope this amuses,

Stuart Cooper.
stuartc@ind.tansu.com.au


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

Date: Sun, 31 May 1998 23:33:59 GMT
From: "Michael D. Schleif" <mike.schleif@aquila.com>
Subject: Re: Any kind of help is hard to find.
Message-Id: <3571E803.74579A59@aquila.com>

Without intending to contribute to another thread regarding
applicability of certain postings to this or other newsgroups, I feel
inclined to comment here.

First, I agree that a newsgroup has value inasmuch as it has purpose,
and focuses primarily on that end.  That way, those of us who might
require a forum of varying degrees of expertise, can avail ourselves of
various search facilities and find a newsgroup with particular focus
matching our needs.  That is, each newsgroup follows a particular
subject that gives it scope, context and content.  If the scope, context
and content of a particular newsgroup does NOT lend itself to my
particular needs, then I can either find a more appropriate newsgroup or
establish one myself.

That being said, it stands to reason that some users DO violate said
scope, and others DO overextend their welcome in this and other groups
-- whereupon, regular users who stay within the lines are also within
their rights to chastise such errant behavior, and possibly even direct
them elsewhere.

I DO NOT, however, find that a mere instance of the words "web," "cgi"
or "html" contained within a posting necessarily, in and of itself,
disqualifies that posting from being relevant to this, or any other,
newsgroup.

Specifically, I believe that "algorith" [sic] is a legitimate and
germane topic, even coupled with the concept of search engine.  In fact,
I believe that most Perlies, with any substantive experience at all,
must find it amazing how any "WEB/CGI/HTML" programming can be effective
if the author(s) DO NOT understand algorithms fundamental to the tasks
underlying all "WEB/CGI/HTML" programming.  A "discussion," if you will,
about search engine algorithms in this newsgroup may precipitate the
dissemination of useful information to many thousands of Perl
programmers, both gods and novitiates.

Nevertheless, I also agree that, when it comes time for a participant to
seek help in integrating that search engine algorithm into a website, at
that time there are far more appropriate forums for these specific
questions.

As always, I welcome comments and opinions regarding my banter . . .

Nathan V. Patwardhan wrote:
> Michael Dori (michaeldore@hotmail.com) wrote:
> : re: help on an algorith for a search engine for my site, but i hope
> 
> comp.lang.perl.misc is a WEB/CGI/HTML free zone if I'm correct, or at
> least it tries to be.

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


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

Date: Sun, 31 May 1998 18:28:30 -0500
From: jerry Kemp <jdkemp@airmail.NOSPAM.net>
Subject: Re: Building 5.004 on BSDi ??
Message-Id: <B3912FBB59413E02.E9232923B32CF45F.94F076FE7F3CA018@library-proxy.airnews.net>

What version of BSDi are you using???  I am running into the same
problem trying to get it compiled under BSDi 3.1.

please post if you find the answer.

good luck,

jkemp



Jeffrey W. Kehoe wrote:
> 
> Has anyone built perl 5.004 on BSDi??  When I run make, I get the
> following error:
> 
> doio.c: In function Perl_do_ipcctl:
> doio.c:1381: argument #4: incompatible types in argument passing
> doio.c:1432: argument #4: incompatible types in argument passing
> *** Error code 1
> 
> Stop.
> 
> Thanks in advance for the help,
> Jeff


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

Date: Mon, 01 Jun 1998 00:50:49 GMT
From: garyg@gator.net (Gary M. Greenberg)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <JVmc1.22$we5.48178@news.randori.com>

Michael M Rubenstein wrote:

[snip]
Isn't that why ijits like me use
        xman &
        
<read in the same tone as your post ;p>
Cheers,

gary         -=-  The C Programmers' Reference  -=-
              http://www.gator.net/~garyg/C/c.html
        -=-  Avenue Programmers' Classes' Requests  -=-
             http://www.gator.net/~garyg/class.htm


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

Date: Mon, 01 Jun 1998 11:40:04 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Email address checking
Message-Id: <35720673.35EA537D@spider.herston.uq.edu.au>

Craig Berry wrote:
> 

snip extremely rational analysis

> I believe that if everyone keeps these parameters straight, the long
> debate over whether email addresses can or should be validated may begin
> to shed more light than heat.  Of course, I may be a raving optimist. :)
> 

The only really wild assumption would be that Those That Come After Us
will find and read this post after it has expired.

P.S. Lest we forget, TomC himself has written quite a nice little email
address checker.  So we should read "You can't do it" as "You can't do
it, but here's how *I* did it" ;-)  See CPAN for details.

-- 
Jaime Metcher


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

Date: 31 May 1998 03:31:48 GMT
From: schaferc@stu.beloit.edu (Chris Schafer)
Subject: file output and modules
Message-Id: <6kqiv4$bg5@scooby.beloit.edu>

Two questions....

What is the search path for modules and libs in perl on a unix box.  I am using the
perl distribution which IBM distributes with AIX on the SP and cannot load
modules correctly.  Is this searching a env variable?  Do I have to tell it
where they are located?  

also

I have been attempting to do output to a file.  I do the output close the
file and then want to `cat $filename | mail $username`  this appears to work
but the file is empty.  Then the program ends and I check the file and the
data is there?  I have also tried to simply read the file after I close it
and it comes up blank as well.  I have tried making the program wait several
minutes and still no data.  It appears the writes are not occuring till the
program ends.  But I am not even getting the data that was in the file
before the program ran.  I want to try and use the FILEHANDLE->autoflush(1);
but due to the first problem I am stuck.  Any advice would be most
appreciated.  

Thanks
Chris


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

Date: Sun, 31 May 1998 09:34:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Internet Relay Chat
Message-Id: <qpprk6.h26.ln@localhost>

Adam (trickett@pacbell.net.revome_this_for_valid_email) wrote:

: (PS Sorry about the anti-spam measures)

: ---

[ Your "cutline" isn't one. 
  Should be "-- \n".
  ...or is that for anti-spam too?
]


:  Adam  <adam_trickett at bigfoot dot com>

: ANTI-SPAM | UNsolicited e-mail will be charged a $10 proof-reading
                                                   ^^^

   I suppose that means United States currency?

   Usenet is international.


:           | fee - by replying to this posting you are agreeing to
: STATEMENT | these terms and conditions.


   Is posting to Usenet soliciting email?

   Best to be explicit about it if you don't want to limit
   the answers you might get.

   Just wondering if it costs ten bucks to email you the answer
   to your question...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 1 Jun 1998 00:26:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: lockf question
Message-Id: <6kssg1$5rv$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    phil@ackltd.demon.co.uk (Phil Taylor) writes:
:Is lockf a platform independant perl function? I don't want to use
:flock because although the application will run on a unix server I'm
:developing on NT where flock doesn't work.

*flock* is the platform independent function.

>From /usr/src/perl/pod/perlfunc.c pod:

    =item flock FILEHANDLE,OPERATION

    Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns TRUE
    for success, FALSE on failure.  Produces a fatal error if used
    on a machine that doesn't implement flock(2), fcntl(2) locking,
    or lockf(3).  flock() is Perl's portable file locking interface,
    although it locks only entire files, not records.

    On many platforms (including most versions or clones of Unix), locks
    established by flock() are B<merely advisory>.  This means that files
    locked with flock() may be modified by programs which do not also use
    flock().  Windows NT and OS/2, however, are among the platforms which
    supply mandatory locking.  See your local documentation for details.

>From /usr/src/perl/win32/win32.c:

    /* simulate flock by locking a range on the file */

    #define LK_ERR(f,i)	((f) ? (i = 0) : (errno = GetLastError()))
    #define LK_LEN		0xffff0000

    DllExport int
    win32_flock(int fd, int oper)
    {
	OVERLAPPED o;
	int i = -1;
	HANDLE fh;

	if (!IsWinNT()) {
	    croak("flock() unimplemented on this platform");
	    return -1;
	}
	fh = (HANDLE)_get_osfhandle(fd);
	memset(&o, 0, sizeof(o));

	switch(oper) {
	case LOCK_SH:		/* shared lock */
	    LK_ERR(LockFileEx(fh, 0, 0, LK_LEN, 0, &o),i);
	    break;
	case LOCK_EX:		/* exclusive lock */
	    LK_ERR(LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, LK_LEN, 0, &o),i);
	    break;
	case LOCK_SH|LOCK_NB:	/* non-blocking shared lock */
	    LK_ERR(LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY, 0, LK_LEN, 0, &o),i);
	    break;
	case LOCK_EX|LOCK_NB:	/* non-blocking exclusive lock */
	    LK_ERR(LockFileEx(fh,
			   LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY,
			   0, LK_LEN, 0, &o),i);
	    break;
	case LOCK_UN:		/* unlock lock */
	    LK_ERR(UnlockFileEx(fh, 0, LK_LEN, 0, &o),i);
	    break;
	default:			/* unknown */
	    errno = EINVAL;
	    break;
	}
	return i;
    }

Now, if what you really want is something that isn't particularly
portable, here you go.  Of course, it won't work on systems with weak
multitasking like Windows, but that's just the testing part.  The locking
is still relevant.

--tom

    #!/usr/bin/perl -w
    # lktest -- test region locking
    use strict;

    my $FORKS = shift || 1;
    my $SLEEP = shift || 1;

    use Fcntl;
    use POSIX qw(:unistd_h :errno_h);

    my $COLS = 80;
    my $ROWS = 23;

    open(FH, "+> /tmp/lkscreen")            or  die $!;

    select(FH);
    $| = 1;
    select STDOUT;

    for (1..$ROWS) {
	print FH " " x $COLS, "\n";
    } 

    my $progenitor = $$;
    fork while --$FORKS > 0;

    print "hello from $$\n";

    if ($progenitor == $$) {
	$SIG{INT} = \&genocide;
    } else {
	$SIG{INT} = sub { die "goodbye from $$" };
    } 

    while (1) {
	my $line_num = int rand($ROWS);
	my $line;
	my $n;
	seek(FH, $n = $line_num * ($COLS+1), SEEK_SET)              or next;
	my $place = tell(FH);
	my $him;
	next unless defined($him = lock(*FH, $place, $COLS));
	read(FH, $line, $COLS) == $COLS                             or next;
	my $count = ($line =~ /(\d+)/) ? $1 : 0;
	$count++;
	seek(FH, $place, 0)                                         or die $!;
	my $update = sprintf($him 
			    ? "%6d: %d ZAPPED %d" 
			    : "%6d: %d was just here", 
			$count, $$, $him);
	my $start = int(rand($COLS - length($update)));
	die "XXX" if $start + length($update) > $COLS;
	printf FH "%*.*s\n", -$COLS, $COLS, " " x $start . $update; 
	unlock(*FH, $place, $COLS);
	sleep $SLEEP if $SLEEP;
    } 
    die "NOT REACHED";

    sub lock {
	my ($fh, $start, $till) = @_;
	##print "$$: Locking $start, $till\n";
	my $lock = struct_flock(F_WRLCK, SEEK_SET, $start, $till, 0);
	my $blocker = 0;
	unless (fcntl($fh, F_SETLK, $lock)) {
	    die "F_SETLK $$ @_: $!" unless $! == EAGAIN || $! == EDEADLK;
	    fcntl($fh, F_GETLK, $lock)          or die "F_GETLK $$ @_: $!";
	    $blocker = (struct_flock($lock))[-1];
	    ##print "lock $$ @_: waiting for $blocker\n";
	    $lock = struct_flock(F_WRLCK, SEEK_SET, $start, $till, 0);
	    unless (fcntl($fh, F_SETLKW, $lock)) {
		warn "F_SETLKW $$ @_: $!\n";
		return;  # undef
	    }
	} 
	return $blocker;
    } 

    sub unlock {
	my ($fh, $start, $till) = @_;
	##print "$$: Unlocking $start, $till\n";
	my $lock = struct_flock(F_UNLCK, SEEK_SET, $start, $till, 0);
	fcntl($fh, F_SETLK, $lock) or die "F_UNLCK $$ @_: $!";
    }

    BEGIN {
	my $FLOCK_STRUCT = 'S s L L I';
	sub linux_flock {
	    if (wantarray) {
		my ($type, $whence, $start, $len, $pid) =
		    unpack($FLOCK_STRUCT, $_[0]);
		return ($type, $whence, $start, $len, $pid);
	    } else {
		my ($type, $whence, $start, $len, $pid) = @_;
		return pack($FLOCK_STRUCT, 
			$type, $whence, $start, $len, $pid);
	    } 
	} 
    } 

    BEGIN {
	# XXX: should be Q not LL
	my $FLOCK_STRUCT = 'LL LL L l s';

	sub bsd_flock {
	    if (wantarray) {
		my ($xxstart, $start, $xxlen, $len, $pid, $type, $whence) =
		    unpack($FLOCK_STRUCT, $_[0]);
		return ($type, $whence, $start, $len, $pid);
	    } else {
		my ($type, $whence, $start, $len, $pid) = @_;
		my ($xxstart, $xxlen) = (0,0);
		return pack($FLOCK_STRUCT, 
		    $xxstart, $start, $xxlen, $len, $pid, $type, $whence);
	    } 
	} 
    } 

    BEGIN { 
	for ($^O) {
	    if    (/bsd/)   { *struct_flock = \&bsd_flock       } 
	    elsif (/linux/) { *struct_flock = \&linux_flock    } 
	    else {
		die "unknown operating system: $!";
	    } 
	} 
    }

    BEGIN { 
	my $called = 0;

	sub genocide {
	    exit if $called++;
	    print "$$: Time to die, kiddies.\n" if $$ == $progenitor;
	    my $job = getpgrp();
	    $SIG{INT} = 'IGNORE';
	    kill -2, $job if $job;  # killpg(SIGINT, job)
	    1 while wait > 0;
	    print "$$: My turn\n" if $$ == $progenitor;
	    exit;
	} 

    }

    END { &genocide } 
-- 
    I'm sure that that could be indented more readably, but I'm scared of
    the awk parser.             --Larry Wall in <6849@jpl-devvax.JPL.NASA.GOV>


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

Date: 31 May 1998 19:37:59 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Random permutations in Perl
Message-Id: <6kspkn$809$1@monet.op.net>
Keywords: Ashland Cominform cruddy shone


In article <6ksbt4$kmt@mozo.cc.purdue.edu>,
Hisao Nakanishi <hisao@physics.purdue.edu> wrote:
>Is there a simple way to generate permutations of n numbers
>(say, 1,2, thru n) randomly (keyed by some seed number) in
>Perl?  Is there a module that does this already available?

The function `n2perm' below accepts two numbers, N and S.  It then
generates the Nth permutations of the integers 0 ... S-1 in the
lexicographic ordering.  If you select N at random from [0 .. S!-1],
you get a random permutation.

You should note that for large S, you cannot select N equiprobably
from the range [0 .. S!-1], because S! is bigger than the largest
possible int number.  `Large' here typically means `bigger than 12'.
You may want to use `Math::BigInt' if S is bigger than this.



sub n2pat {
  my $i = 1;
  my $N = shift;
  my $len = shift;
  my @pat;
  while ($i <= $len + 1) {   # Should really be just ``while ($N) { ...''
    push @pat, $N % $i;
    $N = int($N/$i);
    $i++;
  }
  @pat;
}

# There may be more efficient ways to write this, but I haven't found them.
# (Algorithmically more efficient, I mean; micro-optimizing is easy here.)
sub pat2perm {
  my @pat = @_;
  my @source = (0 .. $#pat);
  my @perm;
  push @perm, splice(@source, (pop @pat), 1) while @pat;
  @perm;
}

# Arguments: (N, S)
# generate the Nth permutation of S objects, 0 <= N < S!
sub n2perm {
  pat2perm(n2pat(@_));
}

# Utility function: Factorial with memoizing
{ my @fact = (1);
  sub factorial {
    my $n = shift;
    return $fact[$n] if defined $fact[$n];
    $fact[$n] = $n * factorial($n - 1);
  }
}


################################################################



Now, how do you use this?

1. Rapidly generate a random permutation of $n things:

	my @permutation = n2perm(int(rand()*factorial($n)), $n);
	
2. Randomly shuffle a list of $n things.

	my @permutation = n2perm(int(rand()*factorial($n)), $n);
	my @shuffle = @list[@permutation];

3. Iterate over all permutations of @list, stopping when a predicate
   function is true for the permuted list:

	my $fact = factorial(scalar(@list));
	for ($i = 0; $i < $fact; $i++) {
	  my @permutation = n2perm($i, $n);
	  my @shuffle = @list[@permutation];
	  last if predicate(@shuffle);
	}


################################################################



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

Date: Sun, 31 May 1998 19:47:06 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Hisao Nakanishi <hisao@physics.purdue.edu>
Subject: Re: Random permutations in Perl
Message-Id: <3572162A.39531D76@sirius.com>

Hisao Nakanishi wrote:
> 
> Is there a simple way to generate permutations of n numbers
> (say, 1,2, thru n) randomly (keyed by some seed number) in
> Perl?  Is there a module that does this already available?
> 
> H. Nakanishi

@list = (0 .. 9); 
$key = 17; 
srand($key);
while (@list) {
    push @permute, splice(@list, rand@list, 1);
}
print @permute;

HTH -- Jim Bowlin


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

Date: 31 May 1998 23:57:27 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: read and write
Message-Id: <6ksqp7$nql$1@comdyn.comdyn.com.au>

In article <896401213.4044@thrush.omix.com>,
	Zenin <zenin@bawdycaste.org> writes:
> 
> 	Send in a perlbug, and/or your system is broken.  Your output
> 	should be:
> 		$ perl foo.pl
> 		1 has 1 lines
> 		2 has 1 lines
> 		3 has 0 lines
> 		4 has 1 lines

[snip]

>: It does indeed seem a bit inconsistent that 3 should return a
>: different result from 1.
> 
> 	It doensn't, unless your perl or system are broken.

They still do, but for a different reason.

Obviously, the 'line' is taken to be anything up to and including the
next newline character, unless there is nothing before eof. That makes
sense, and does produce the results.

>: The byte sizes of the files, as reported by ls are:
>: -rw-r--r--   1 mgjv     staff          5 May 29 08:50 1
>: -rw-r--r--   1 mgjv     staff          6 May 29 08:50 2
>: -rw-r--r--   1 mgjv     staff          0 May 29 08:56 3
>: -rw-r--r--   1 mgjv     staff          2 May 29 08:50 4
> 
> 	Odd way of storing data.  What system are you using?  Here
> 	is FreeBSD:

My fault. vi adding a 0a, for who knows what reason.

I should have never participated in this thread. Two big booboos in one thread. *sigh*

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: Sun, 31 May 1998 23:43:41 GMT
From: Aaron <info@pornoinferno.com>
Subject: reading variable lists
Message-Id: <3571EB4F.4C98@pornoinferno.com>

Dear knowledgable and 'glad to help' programmer,

I have the following:
------------------------------------------------
#!/usr/local/bin/perl

$url='http://www.tyc.net/test.html';

     print "Content-type: text/html\n\n";

if ($ENV{'HTTP_REFERER'} eq "$url") {
     print "<h1>You have succeeded</h1>";
}
else {
     print "<h4><center>Sorry, you can not access this ";
     print "page from $ENV{'HTTP_REFERER'}</center></h4>";
}
------------------------------------------------

I now want to check $url against a list of urls in a seperate file
rather than simply state a static variable such as
$url='http://www.tyc.net/test.html'; .

This would allow all sites listed in the url text file to get the 'You
have succeeded' message.  The idea of the script is to restrict what URL
can successfully link to the page.  The URL text file will look like
this:
------------------------------------------------
http://www.url.com/index.html
http://www.another-url.com/specialpage.html
http://www.urls4me.com/html/neato.html
------------------------------------------------


This is the first thing I've ever made anything in perl.  I learned what
I have out of 'CGI programming with PERL 5' by sams.net.  If you're
interested, the ISBN is 1-57521-196-3 (http://www.amazon.com).


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

Date: Sun, 31 May 1998 13:50:37 GMT
From: Robert.Webb@yeg.dot.co.dot.uk (Robert Webb)
Subject: Re: Sockets and E-mail
Message-Id: <35715f91.1908854@gate.itt.yeg.co.uk>

On Sat, 30 May 1998 11:31:13 GMT, Gellyfish@btinternet.com (Jonathan
Stowe) wrote:

>Have a look at perlfaq9 for an example.
>
>You can also use Net::SMTP to do much the same thing with slightly
>more programmer overhead.

Thanks for that. However, I can't extract the lib file from the CPAN
archive.  WinZip fails miserably and complains that it's an 'invalid
archive'   Can anyone mail me the net::smtp module ?

>You might however want to take note of the weapons grade disputation
>that occurred on this subject here not so long ago.

Ahh... sounds like a good time-waster to me :-)  What was the thread
title?

Rob W


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

Date: 31 May 1998 19:28:08 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: split behavious
Message-Id: <3571e788.0@news.one.net>

Vincent W. Yin <q14988@hkimd.mot.com> wrote:
> Can someone please explain to me the following:

> In the camel book (2nd ed.), it says that:

> "if PATTERN is also omitted, the function splits on whitespace, /\s+/, after
> skipping any leading whitespace." - p. 220

> I assume this means that if I explicitly split on whitespace, the same behaviour
> is exhibited (leading whitespace is skipped).  I tried the following code
> fragment:

> #!/usr/bin/perl

> open (SOURCE, "testinput.txt");

> while ($line = <SOURCE>) {
> 	chop ($line);
> 	($col1, $col2) = split (/\s+/, $line);
                                ^^^^^ 
                                      Replace with " "

Somewhere else it will tell you that 'split " "', is special. That
is what you want if you wish to skip leading whitespace.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Just because something is           131 Willow Lane, Floor 2  | ||  _ \
obviously happening doesn't         Oxford, OH  45056         | || |_) |
mean something obvious is           <mikeh@minivend.com>     |___|  _ <
happening. --Larry Wall             513.523.7621 FAX 7501        |_| \_\


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

Date: 1 Jun 1998 01:51:15 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: split behavious
Message-Id: <6kt1ej$slh$1@marina.cinenet.net>

Vincent W. Yin (q14988@hkimd.mot.com) wrote:
: In the camel book (2nd ed.), it says that:
: 
: "if PATTERN is also omitted, the function splits on whitespace, /\s+/, after
: skipping any leading whitespace." - p. 220
: 
: I assume this means that if I explicitly split on whitespace, the same behaviour
: is exhibited (leading whitespace is skipped).  I tried the following code
: fragment:
[snip of split using /\s+/]

That's not how to explicitly get the whitespace magic; for that, use the
non-regex argument ' ' -- just one literal space.  See perldoc split, or
near your citation in the Camel.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Sun, 31 May 1998 19:22:47 -0400
From: "brent verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: whois
Message-Id: <6ksoj2$b31$1@argentina.it.earthlink.net>

i've got a whois that i wrote a while back, you can download it from
http://home.earthlink.net/~damonbrent/stuff/whois.zip

you can see an implementation of it at
 http://r-go.net/infayetteville/rgo/services/biz/whois.shtml

the script is actually pretty good, though not perfect.  its output is
very configurable.  it will, by default return the results for each
 .com .net .org, though this can be disabled.  download it.  it's very easy
to
setup.

brent


Andy Chantrill wrote in message <3571AD94.FD5501C2@derby-county.com>...
>where can i get a whois script to either tell me if a domain name is in
>use or available?
>would prefer freeware is poss.
>




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

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

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