[13441] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 851 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 19 22:07:26 1999

Date: Sun, 19 Sep 1999 19:05:08 -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: <937793107-v9-i851@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 19 Sep 1999     Volume: 9 Number: 851

Today's topics:
    Re: builtin.pm <elaine@chaos.wustl.edu>
    Re: CONTEST: Range Searching <peterm@zeta.org.au>
    Re: CONTEST: Range Searching (Yitzchak Scott-Thoennes)
    Re: cookbook: nonforker <SternSZ@gmx.de>
        correct references to module functions when using stric <cLive@direct2u.co.uk>
    Re: CRAP Software <gellyfish@gellyfish.com>
    Re: CRAP Software (Abigail)
        Creating a file <wied9@hotmail.com>
    Re: Creating a file <rick.delaney@home.com>
        future of (?{code}) <ltl@rgsun40.viasystems.com>
    Re: future of (?{code}) <rick.delaney@home.com>
    Re: future of (?{code}) <ltl@rgsun40.viasystems.com>
    Re: grab password protected web pages (Eric Bohlman)
    Re: Humour Impairment [Was: CRAP Software] <elaine@chaos.wustl.edu>
        Passing variables around in multi-screen cgi script (Jed Parsons)
    Re: PL extension <jeff@vpservices.com>
        Reading required files on a different server.  (Glen Saunders)
    Re: Reading required files on a different server. (Martien Verbruggen)
    Re: Unix and Perl script <Michael_Kraizman@excite.com>
    Re: Using a period as a delimiter in the split() functi <tchrist@mox.perl.com>
    Re: Using a period as a delimiter in the split() functi <ltl@rgsun40.viasystems.com>
    Re: Using a period as a delimiter in the split() functi <rick.delaney@home.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 19 Sep 1999 18:08:35 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: builtin.pm
Message-Id: <37E55E64.E227D2EA@chaos.wustl.edu>

John G Dobnick wrote:
> >> Does anyone have this module ? I've been searching it for a week on CPAN
> >
> > http://search.cpan.org/search?mode=module&query=builtin
> 
>  Yes, but not helpful, I'm afraid.   When I do this, I get the following:

My fault for not looking further down the tree.
 
> Perhaps CPAN needs some sort of "link" facility, so that an old
> obsoleted entry can contain a "pointer" to it's replacement"?
> Perhaps something like
> 
>      This has been replaced.
>      Please see List::Util and Scalar::Util.

I mailed the author and requested he do something such as this. I may
forward this idea on as well as it's something that I've thought about
for a while. Perhaps even a list of modules and what they have been
obsoleted by and when.

e.


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

Date: Mon, 20 Sep 1999 08:51:28 +1000
From: "Peter G. Martin" <peterm@zeta.org.au>
Subject: Re: CONTEST: Range Searching
Message-Id: <37E568F0.FEB16016@zeta.org.au>

Uri Guttman wrote:

> so sorry, try again. merging the overlap and non-overlap logic is not
> trivial. i am close to a very elegant solution. but i will test it to
> death before i publish it here.
> 
Hey, don't hold back too long :   last time someone said something
like that, it took about 300 years to find a margin big enough to
fit it into...   :=)


-- 
--peterm   Peter G. Martin  -- Tech. Writer
http://www.zeta.org.au/~peterm +61 2 9818 5094
Mobile: 0408 249 113 peterm@zeta.org.au


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

Date: Sun, 19 Sep 1999 17:38:51 GMT
From: sthoenna@efn.org (Yitzchak Scott-Thoennes)
Subject: Re: CONTEST: Range Searching
Message-Id: <r+R53gzkgCYS092yn@efn.org>

Posted and mailed.

In article <slrn7u2ped.1dm.ken@pulsar.halcyon.com>,
ken@halcyon.com (Ken Pizzini) wrote:
>>	    patfore [-B N] pattern [files ...]
>
>  push @lines, $_;
>  print splice(@lines, 0, $N) if /pattern/;
>  shift @lines if @lines >= $N;

You are only printing $N-1 lines before a pattern match.
Try:
   push @lines, $_;
   print splice(@lines,0) if /pattern/;
   shift @lines if @lines > $N;

In article <slrn7u3u6r.3g5.ken@pulsar.halcyon.com>,
ken@halcyon.com (Ken Pizzini) wrote:
>On 16 Sep 1999 21:59:57 GMT, Ken Pizzini <ken@halcyon.com> wrote:
>>  push @lines, $_;
>>  if (($matched = /pattern/) || $. <= $end) {
>>    print @lines;
>>    @lines = ();
>>    $end = $matched && $. + $X;
>>  } else {
>>    shift @lines if !$end && @lines >= $T;

Again, this should be @lines > $T, shoudn't it?
>
>Oops --- last minute edit broke this script; this line should read:
>     shift @lines if $. > $end && @lines >= $T;
>
>>  }

But in the else, '$. > $end' is always true.

You can also do away with $matched by setting $end in the if.
Combining this with options stuff shamelessly stolen from Kevin Reid, I get:

#!perl -wn
use strict;
use vars qw/$opt_A $opt_B $opt_C $end $pat @lines/;
use Getopt::Std;

BEGIN {
    getopts('C:B:A:') and $pat = shift or usage();
    foreach ($opt_A, $opt_B) {$_ ||= $opt_C || 0 unless defined $_; }
    $pat =~ s#^/(.*)/$#$1#;
    print $opt_A, $opt_B, "\n";
}

push @lines, $_;
if (/$pat/o and $end = $. + $opt_A or $end and $. <= $end) {
    print splice(@lines,0);
} else {
    shift @lines if @lines > $opt_B;
}

$end = @lines = () if eof;

sub usage {print <<"END" and exit 1}
$0 [-B lines] [-A lines] [-C lines] /pattern/ [files...]

  -B n  Print n lines before the match
  -A n  Print n lines after the match
  -C n  Print n lines before and after the match

  Slashes on the pattern are optional.
END


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

Date: 19 Sep 1999 16:32:58 +0200
From: Benjamin Schweizer <SternSZ@gmx.de>
Subject: Re: cookbook: nonforker
Message-Id: <m3n1ujeztx.fsf@anthrax.local.net>

+-->gabor@vmunix.com (Gabor):
| In comp.lang.perl.misc, Benjamin Schweizer <SternSZ@gmx.de> wrote :
| # +-->Rick Delaney <rick.delaney@home.com>:
| # | Benjamin Schweizer wrote:
| # | > 
| # | > I´ve got a non forking daemon which is pretty nice. If I mark the
| # | > following code as a comment it runs pretty nice, else Perl reports
| # | > that IO::Select has no method has_exception.
| # | 
| # | If you want that method then you should upgrade your version of
| # | IO::Select to the one that has that method.  Better yet, upgrade your
| # | perl since this is a standard module.
| # 
| # Are you sure? My distribution is only a few months old.
| # Perl is relase 5.005_2 from May 1999.
| # Which release do I need?
| 
| That release definitely has it since I am looking at it right now.

5.005_2 has "has_error", but "has_exception" seems to be missing.




cu

-- 
"Wie glücklich viele Menschen wären, wenn sie sich genausowenig um die
Angelegenheiten anderer kümmern würden wie um die eigenen"

                                                           -Lichtenberg


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

Date: Sun, 19 Sep 1999 16:25:44 -0700
From: cLive hoLLoway <cLive@direct2u.co.uk>
Subject: correct references to module functions when using strict?
Message-Id: <37E570F8.2A06FF08@direct2u.co.uk>

hi,

I'm madly trying to grow up as a programmer, and am a little lost on
'use strict' and wondered if some kind soul could point me in the right
direction...

So a couple of questions

I have a script that requires cgi.pm

(1)

when I added 'use strict' to the script, I got the following message
(after debugging everything else ;-):

Bare word "param" not allowed while "strict subs" in use.

I have changed the listing of 'param' to 'CGI::param' in the script, but
can't test it yet coz I've got a couple of other dependent scripts to
change first.

All I really want to know is:

Is this all I have to do? ie, Find out the package name of anything
required prepend it with :: to the affected function?

(2)

One script contains common sub-routines (package common) used by a group
of scripts. Is it better programming to declare variables created in
this common script within the common namespace (ie name them
$common::etc), or to declare them in the calling program and then to
create them in the common sub (ie name the $::etc)?

getting there, slowly...

cLive ;-)



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

Date: 19 Sep 1999 23:09:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CRAP Software
Message-Id: <7s3qep$1sg$1@gellyfish.btinternet.com>

On Sun, 19 Sep 1999 17:35:58 -0400 Elaine -HFB- Ashton wrote:
> Abigail wrote:
>> >Kibitzer?
>> 
>> No. You might want to try alt.religion.kibology.
> 
> Now, say kibo kibologises kibble 10 times fast...
> 

You dont want to say Reese-ology is all ...

Anyhow the only person I havent told to "fuck off" tonight will come
along and tell us off in a minute so we had better hide ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 19 Sep 1999 20:27:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: CRAP Software
Message-Id: <slrn7ub3gg.ab2.abigail@alexandra.delanet.com>

Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote on MMCCX September
MCMXCIII in <URL:news:37E556C0.CE27C019@chaos.wustl.edu>:
## 
## Now, say kibo kibologises kibble 10 times fast...


kibo kibologises kibble 10 times fast...



Did I win a prize?



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]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Sun, 19 Sep 1999 15:29:48 -0700
From: adoobiesystems <wied9@hotmail.com>
Subject: Creating a file
Message-Id: <37E563DB.F19AF9E8@hotmail.com>

Quick question:

I know how to open and write to an existing text file, but how do you
Create a New text file to write to?

Example:

Take the IP of the user and store their form results in a file called
IP.txt

Thanks!
CW



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

Date: Sun, 19 Sep 1999 23:17:44 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Creating a file
Message-Id: <37E56F16.A779542B@home.com>

[posted & mailed]

adoobiesystems wrote:
> 
> Quick question:
> 
> I know how to open and write to an existing text file, but how do you
> Create a New text file to write to?

Where on earth would you learn the first thing without learning the
second?

perldoc -f open
perldoc perlopentut

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 19 Sep 1999 23:03:04 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: future of (?{code})
Message-Id: <7s3q38$fjr$1@rguxd.viasystems.com>

The regular expression extension (?{some perl code}) is marked
as *experimental*.  I understand this to mean that it might have
bugs and is subject to change.  But is there much likelihood
that it will be abandoned?  I'm starting to like it (in a slightly
sick and somewhat ambivalent way).

Also, any chance of getting access to the current values of the
regular expression backreferences ($1, $&, etc..) within the
scope within which the code is evaluated? Ilya?

Just curious, but why don't lexical variables work in that scope?
Or more precisely, why are lexical variables declared in "file"
scope not visible in the code inside (?{some perl code}) ?

While I'm wishing...

Documentation says that you can use \G between multiple m//g type
expressions.  I could have used it handily if it had worked in a
construct like this:

while (/ something /g) {
	dosomething if (/\G(?=another thing)/);
}

where the second match was not a /g match.  At least, I could have if
it does what I think it does.  But I'll readily admit that my
understanding of what some of these regular expression extensions do
is still getting changed by trying something and seeing the results.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: Sun, 19 Sep 1999 23:37:26 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: future of (?{code})
Message-Id: <37E573B4.B2D745D7@home.com>

[posted & mailed]

lt lindley wrote:
> 
> Documentation says that you can use \G between multiple m//g type
> expressions.  I could have used it handily if it had worked in a
> construct like this:
> 
> while (/ something /g) {
>         dosomething if (/\G(?=another thing)/);
> }

Try it like this:

    while (/ something /g) {
        dosomething if (/\G(?=another thing)/gc);
    }

You need /c in case it doesn't match or pos will be reset and the while
loop will never terminate.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 20 Sep 1999 01:02:15 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: future of (?{code})
Message-Id: <7s412n$hc2$1@rguxd.viasystems.com>

Rick Delaney <rick.delaney@home.com> wrote:
:>Try it like this:

:>    while (/ something /g) {
:>        dosomething if (/\G(?=another thing)/gc);
:>    }

:>You need /c in case it doesn't match or pos will be reset and the while
:>loop will never terminate.

Light bulb goes off.  

I was thinking that I couldn't put a /g (/gc thank you) on    
	dosomething if /\G(?=another thing)/
because it would go wandering through my entire very long string
repeatedly matching, which was not what I wanted.   But it is in
scalar context so it is only iterated once and /g has no other affect
than to allow access to \G, and in combination with /c, prevent a
reset of pos().  Doh!

Not to mention that a 0 width assertion in conjunction with a repeat
modifier can only match once between non-zero width assertions.
Not to mention that even if the above 2 laws of nature didn't
exist, the zero width assertion doesn't advance pos() so
having it bound to start at \G means it could only match once...
I'm feeling triple clueless on that gaff.

I thought I was over being tripped by differences in behavior based
on context.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: 20 Sep 1999 00:53:57 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: grab password protected web pages
Message-Id: <7s40j5$q51@dfw-ixnews4.ix.netcom.com>

Kragen Sitaker (kragen@dnaco.net) wrote:
: In article <F4C8F68D0BE950E5.98C00D5D89D65048.5DB1D20046919AF0@lp.airnews.net>,
: chris mclean  <chris@optionsanalysis.com> wrote:
: >print MYSOCK "GET /US/9909/18/mayor.quits.ap/ HTTP/1.0\n\n";
: >Does anyone know how to modify this program to grab
: >password protected web pages?
: 
: Add the appropriate Authorization: line to the header of your request.
: See RFC 2617.
: 
: I think you can also use libwww-perl, aka LWP.

Not just can, but should.  His code won't work, for example, with pages 
stored on virtual hosts; LWP takes care of all those nitpicky details.



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

Date: Sun, 19 Sep 1999 18:45:10 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Humour Impairment [Was: CRAP Software]
Message-Id: <37E566F7.C9DC0424@chaos.wustl.edu>

Jonathan Stowe wrote:
> > /me *smacks* head. You guys are hopeless.
> 
> Thank you elaine I always knew you'd be a good straight person - if thats
> allowed ...

Well, if newsgroups were musicals, c.l.p.m. most certainly would be
"Anything Goes!"

I can even envision the cast, the cute little sailor suits,...mmmmwwwwhahaha...

e.


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

Date: 20 Sep 1999 01:35:17 GMT
From: jed@socrates.berkeley.edu (Jed Parsons)
Subject: Passing variables around in multi-screen cgi script
Message-Id: <7s430l$dkr$1@agate-ether.berkeley.edu>

Greetings -

I'm trying to write a multi-screen cgi script, and am having trouble
figuring out how to pass arrays and hashes around.  These are not
parameters to widgets, so it seems printing hidden won't work.  They are
also not unchanging global variables: they are created and assigned by
one of the parts of the script.  How can I make them accessible to other
parts?

Many thanks for any help,

Jed

-- 
Jed Parsons                        mailto:jed@socrates.berkeley.edu
                                 http://socrates.berkeley.edu/~jed/
 
"Okay! You know, super ideas do not grow on trees!" --- Supergrover 


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

Date: 19 Sep 1999 22:36:17 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: PL extension
Message-Id: <37E563AA.9E6A2B96@vpservices.com>

Michel Jacob wrote:
> 
> I know almost nothing on CGI and Perl programming.  I want to use a
> little CGI program that is freely distribute on the WEB to put a
> password access restriction on my WEB site.

Whoa, stop right there.  A CGI is not a good way to put a password
restriction on a site.  Use the web server's built in authentication
methods instead.

>  The host server of my site can read CGI
> extension but not PL extension.  Is someone know if in this situation,
> the CGI program will not work, or if the PL file doesn't have to be read
> by a host server?

That also is a question having to do with how the web server is
configured but is *probably* easily solved by just renaming the script
from .pl to .cgi.

-- 
Jeff


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

Date: Sun, 19 Sep 1999 23:32:12 GMT
From: glen1@ibm.net (Glen Saunders)
Subject: Reading required files on a different server. 
Message-Id: <37e572c8@news1.prserv.net>

In all the perl documentation I've read, it is assumed that the perl
program and all it's required files are on the same server. Is it
possible to have a perl program read from a file on a server different
from the one the program itself is on? (This stems from having to use
a secure server for one part of the process). If so, what is the
protocol (UNIX) for pointing perl to the absolute path? Thank you. 
Glen Saunders



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

Date: Mon, 20 Sep 1999 00:05:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Reading required files on a different server.
Message-Id: <3TeF3.215$rU2.4680@nsw.nnrp.telstra.net>

In article <37e572c8@news1.prserv.net>,
	glen1@ibm.net (Glen Saunders) writes:
> In all the perl documentation I've read, it is assumed that the perl
> program and all it's required files are on the same server. Is it
> possible to have a perl program read from a file on a server different
> from the one the program itself is on? (This stems from having to use
> a secure server for one part of the process). If so, what is the
> protocol (UNIX) for pointing perl to the absolute path? Thank you. 

You should, instead of just posting, also _read_ this newsgroup. This
exact question came up last week and was answered. In the future,
please first read the group, and use something like deja.com to find
out whether your question has already been answered.

The answer is : Use something like SMB or NFS for remote file systems.
Once you do, the remote file systems looks like a local one, and perl
has no problems.

Alternatively, you could use ftp or something like that to copy the
file locally, edit it, and copy it back.

I am not certain what you mean by 'secure server', but ssh may be able
to help there.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Sun, 19 Sep 1999 18:55:36 -0400
From: "Michael Kraizman" <Michael_Kraizman@excite.com>
Subject: Re: Unix and Perl script
Message-Id: <7s3pc2$lcm$1@news2.tor.accglobal.net>

Or, you could always use the find2pl script to generate the perl
equivalent of the find command and modify the result to do the rest of
your backup task.

Mike.

Jim Hutchison <jimhutchison@metronet.ca> wrote in message
news:37e16b46.2239749643@24.64.2.57...
> On Tue, 14 Sep 1999 23:59:52 GMT, fybar@junctionnet.com (Trevor
> Osatchuk) wrote:
>
> >I am trying to write a backup script for a Unix machine using Perl
as
> >I can only pass a finite number of filenames to a tar at a time.
The
> >Unix command that I want to use is:
> >
> >find ./usr -name "bin" -print > files.list
> >
> >The best I can come up with is this:
> >
> >open (FILES_LIST,"|find ./usr -name "bin" -print >files.list");
> >
> >I have used the same type of command with an ls, but I cannot get
the
> >syntax right for the find.
> >
> >trev
>
>
> Look up "xargs".  It's a Unix command that solves the "list too
long"
> problem.
>
>



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

Date: 19 Sep 1999 16:16:24 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using a period as a delimiter in the split() function
Message-Id: <37e560b8@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    lr@hpl.hp.com (Larry Rosler) writes:
:I assumed that at run-time the function would have enough information 
:about the first argument to determine if it is a string or a regex 
:(qr//); to accept the latter, to warn about the former.  But I don't 
:know enough perl internals to say whether that is reasonable.

I don't know that this is possible to do without incurring too much noise.
I agree that it's unfortunate, but we lived so long without qr//, I don't
see any reasonable way of wedging in a complaint that won't really piss
people off.

Think of all the functions people have that take regexes as arguments,
which they then use as the split separator.

% cd /usr/src/perl5.005_61
% tcgrep '\bsplit\s*\(?\s*["\044\042]' lib

lib/B/Deparse.pm:    $expr = "split(" . join(", ", @exprs) . ")";
lib/CGI/Cookie.pm:    my(@pairs) = split("; ",$raw_cookie);
lib/CGI/Cookie.pm:    my(@pairs) = split("; ",$raw_cookie);
lib/CGI/Cookie.pm:	my($key,$value) = split("=");
lib/CGI/Push.pm:    foreach (@other) { push(@o,split("=")); }
lib/CGI.pm:    my (@params) = split ("\0", $param);
lib/CGI.pm:    $_[0]->param($_[1],split("\0",$_[2]));
lib/CGI.pm:	(map { split "=", $_, 2 } @other),
lib/CGI.pm:	(map { split "=", $_, 2 } @other),
lib/CGI.pm:    foreach (@other) { tr/\"//d; push(@o,split("=",$_,2)); }
lib/CGI.pm:    @foo = split("\0",$params->{'foo'});
lib/CPAN.pm:			split("/","$sans.readme"),
lib/CPAN.pm:    @local = split("/",$self->{ID});
lib/CPAN.pm:    push @result, (split " ", $_, 2)[0];
lib/ExtUtils/Install.pm:my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
lib/ExtUtils/Liblist.pm:    my(@libpath) = split " ", $Config{'libpth'};
lib/ExtUtils/MM_Unix.pm:    my @path = split $path_sep, $path;
lib/ExtUtils/MakeMaker.pm:	$self->{DIR} = [grep $_, split ":", $self->{DIR}];
lib/File/Spec/Mac.pm:	  File::Spec->catdir(split(":",$path)) eq $path
lib/Pod/Functions.pm:    ($name, $type, $text) = split " ", $_, 3;
lib/Pod/Html.pm:    @podpath  = split(":", $opt_podpath) if defined $opt_podpath;
lib/Pod/Html.pm:    @libpods  = split(":", $opt_libpods) if defined $opt_libpods;
lib/Pod/Html.pm:    @words = split(" ", $text);
lib/Pod/Parser.pm:        ($cmd, $text) = split(" ", $_, 2);
lib/Pod/Usage.pm:        my @paths = (ref $pathspec) ? @$pathspec : split($pathsep, $pathspec);
lib/Text/Tabs.pm:		@lines = split("\n", $x, -1);

See what I mean?

--tom
-- 
Besides, it's good to force C programmers to use the toolbox occasionally.  :-)
        --Larry Wall in <1991May31.181659.28817@jpl-devvax.jpl.nasa.gov>


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

Date: 19 Sep 1999 22:17:29 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: Using a period as a delimiter in the split() function
Message-Id: <7s3ndp$f1g$1@rguxd.viasystems.com>

Larry Rosler <lr@hpl.hp.com> wrote:

:>I didn't say that the compiler should complain about that at compile-
:>time, as it is obviously acceptable.  I said at run-time.

:>I assumed that at run-time the function would have enough information 
:>about the first argument to determine if it is a string or a regex 
:>(qr//); to accept the latter, to warn about the former.  But I don't 
:>know enough perl internals to say whether that is reasonable.

But Larry, I know of at least 4 programs that I have in production
that would start producing warnings when they didn't before.  It
would have to be an optional new warning; not one you would get by
default.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: Sun, 19 Sep 1999 23:08:40 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Using a period as a delimiter in the split() function
Message-Id: <37E56CF4.BACF3E3F@home.com>

Larry Rosler wrote:
> 
> In article <37E53BFC.E2D74DBA@home.com> on Sun, 19 Sep 1999 19:39:45
> GMT, Rick Delaney <rick.delaney@home.com> says...
> >
> > I think this would be going too far.  There is nothing obscure about
> >
> >     split $pattern, $string, $limit;
> 
> I didn't say that the compiler should complain about that at compile-
> time, as it is obviously acceptable.  I said at run-time.

Yes, but that doesn't change anything.  The point here is that the code 
says what it means.  It shouldn't matter that $pattern is not some qr//
object.  It's hard to read that code and think that $pattern is anything
but a PATTERN.

People using code like

    $pattern = '\s+';

shouldn't be forced to change it to 

    $pattern = qr'\s+';

because they're getting a warning like

    First argument to split must be a PATTERN, not a string literal.

That would be more confusing than split '|' not splitting |-separated
fields.

-- 
Rick Delaney
rick.delaney@home.com


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 851
*************************************


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