[12214] in Perl-Users-Digest
Perl-Users Digest, Issue: 5814 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 28 08:07:25 1999
Date: Fri, 28 May 99 05:00:19 -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 Fri, 28 May 1999 Volume: 8 Number: 5814
Today's topics:
@INC and perl 4.6.2 jamby@my-deja.com
byteperl binary <alvar@agi.de>
Re: Can Perl do this? <tchrist@mox.perl.com>
conver TO url encoded <mark@artdigital.co.uk>
Re: Converting from ASCII to ANSI (and vice versa) <gellyfish@gellyfish.com>
Re: Converting from ASCII to ANSI (and vice versa) (Poul Kornmod)
Re: directory file list into html conversion <gellyfish@gellyfish.com>
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Sitaram Chamarty)
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Sitaram Chamarty)
HASH troubles? <Tobin@breathemail.net>
Re: killing exec()ed process - how? <B.A.McCauley@bham.ac.uk>
List lvalues and do - parser idiosyncrasy <B.A.McCauley@bham.ac.uk>
Re: perl script as an executable (Steve Vertigan)
perl_parse (perl embedding) question <dsc@tiac.net>
Re: scalar refs and m/(pat)/ <andre.pletschette@ltam.lu>
Re: Strip "http" from URL's <andre.pletschette@ltam.lu>
Re: Strip "http" from URL's (Bob Trieger)
Re: workarounds for prototypes <garethr@cre.canon.co.uk>
Re: Y2K infected Perl code (Lane Core Jr.)
Re: Y2K infected Perl code (Bob Trieger)
Re: Y2K infected Perl code (Lane Core Jr.)
Re: Y2K infected Perl code <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 May 1999 10:52:06 GMT
From: jamby@my-deja.com
Subject: @INC and perl 4.6.2
Message-Id: <7ilsgm$b04$1@nnrp1.deja.com>
Peeps,
I'm building a copy of sybperl from perl 4.6.2 and want to set
@INC to a predefined set of values at compile or configuration time. I
know that this is possible but I've searched through the files and can't
find how to do it. Can anyone help?
Thanks
Jamby
PS I know I should be using some flavour of perl 5 but legacy code
requires the older version
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 28 May 1999 13:08:05 +0200
From: "Alvar Freude" <alvar@agi.de>
Subject: byteperl binary
Message-Id: <7ilt66$4g4$1@newsreader.ipf.de>
Hi!
does anybody know about a downloadable byteperl executable for win32?
Or how i can compile it by myself with Cygwin?
bye
Alvar
------------------------------
Date: 28 May 1999 05:53:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can Perl do this?
Message-Id: <374e839e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Richard Lawrence <ralawrence@my-deja.com> writes:
:I would really be impressed if I can write a bit of perl that goes to a
:specific url, fills out some fields and then selects the submit button.
:Is this possible?
:
:(Note: I can't just go directly to the final url complete with
:&var=value - because the web page refuses to accept the request)
:
:Any help would be appreciated. I have the lwp library installed.
% man perlfaq9
....
How do I automate an HTML form submission?
If you're submitting values using the GET method, create a URL and
encode the form using the query_form method:
use LWP::Simple;
use URI::URL;
my $url = url('http://www.perl.com/cgi-bin/cpan_mod');
$url->query_form(module => 'DB_File', readme => 1);
$content = get($url);
If you're using the POST method, create your own user agent and encode
the content appropriately.
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
$ua = LWP::UserAgent->new();
my $req = POST 'http://www.perl.com/cgi-bin/cpan_mod',
[ module => 'DB_File', readme => 1 ];
$content = $ua->request($req)->as_string;
--tom
#!/usr/bin/perl -w
# amarank -- rank amazon books
# tchrist@perl.com
# version 1.1, Mon Aug 31 06:48:06 MDT 1998
use strict;
use Getopt::Std;
use Text::Wrap qw($columns &wrap);
use HTML::FormatText;
use HTML::Parse;
use HTML::TreeBuilder;
use HTTP::Request;
use HTTP::Request::Common qw(GET POST);
use HTTP::Response;
use LWP::UserAgent;
use URI::URL;
$columns = 75;
sub UNKNOWN { 999999999 }
sub usage {
print STDERR "$0: @_\n" if @_;
die <<EO_USAGE
usage: $0 [-s] [-t] [-a] [-v] [-r] [-w columns] [-n count] title
-s search on subject
-t search on title [DEFAULT]
-a search on author
-r raw output only, don't rand first (faster output)
-n num show only the first n books
-w cols wrap at this many columns (DEFAULT: $columns)
-v debugging
EO_USAGE
}
$| = 1;
my(
$browser, # the virtual browser we'll use as user agent
$curreq, # the current HTTP request object
$response, # the current HTTP response object
$content, # raw HTML of
$which_search, # subject, author, or title
$form,
$formatter,
$his_base,
$hitlist,
$bookcount,
$next_screen,
$search_string,
$url,
%opts,
%Desc,
%ISBN_Rank,
%ISBN_Title,
%Seen_ISBN,
);
sub fdie { die sprintf @_ }
sub dprint { print STDERR @_ if $opts{'v'} }
@opts{qw!s t a!} = (0,0,0);
getopts("rstavn:w:", \%opts) || usage("argument error");
if ($opts{"w"}) {
$columns = $opts{"w"};
}
if ( $opts{"s"} + $opts{"t"} + $opts{"a"} > 1 ) {
usage("only one of opts s, t, and s allowed.");
}
$which_search = $opts{"t"} ? 'title'
: $opts{"s"} ? 'subject'
: $opts{"a"} ? 'author'
: 'title';
$search_string = "@ARGV" || "perl";
$url = "http://www.amazon.com/";
$browser = LWP::UserAgent->new();
$browser->agent("amarank/1.0");
$curreq = GET($url);
$curreq->referer("http://wizard.yellowbrick.oz");
if (($response = $browser->request($curreq))->is_error()) {
fdie "Failed to lookup $url: %s\n", $response->status_line;
}
$his_base = $response->base;
dprint "His base is $his_base\n";
unless ($response->content =~ /Full search:\s*(?:<BR>\s*)?<a href\s*=\s*"([^"]*)">/i) {
die "couldn't find full search\n" . $response->content;
}
$url = url($1, $his_base);
dprint "New url is $url\n";
$curreq = GET($url);
$curreq->referer($his_base->as_string);
if (($response = $browser->request($curreq))->is_error()) {
fdie "Failed to lookup $url: %s\n", $response->status_line;
}
$his_base = $response->base;
dprint "base is $his_base";
die "no title search: $content" unless $response->content() =~
m#Enter\s*Author.*?Title.*?(<form[^>]*?action\s*=\s*"([^"]+)".*?)</form>#is;
$form = $1;
$url = url($2, $his_base);
dprint "Search is at $url\n";
$curreq = POST $url, [
"author" => $which_search eq 'author' && $search_string,
"author-mode" => "full",
"title" => $which_search eq 'title' && $search_string,
"title-mode" => "word",
"subject" => $which_search eq 'subject' && $search_string,
"subject-mode" => "word",
"submit" => "Search Now",
];
$curreq->referer($his_base->as_string);
if (($response = $browser->request($curreq))->is_error()) {
fdie "Failed to lookup $url: %s\n", $response->status_line;
}
$hitlist = $response->content();
dprint "base is $his_base";
while ($hitlist =~ m{
<b> \s*
<a \s+ href \s* = \s*
" (/exec/obidos/ASIN/(\d+))/[^"]+" \s* >
(.*?)
</a></b>(.*)
}xig )
{
my($bookurl, $isbn, $title, $text) = ($1,$2,$3,$4);
next if $Seen_ISBN{$isbn}++; # top few are dups
$bookcount++;
last if $opts{'n'} && $bookcount > $opts{'n'};
for ($title) {
s/&/&/g;
s/</</g;
s/>/>/g;
s/"/"/g;
}
$ISBN_Title{$isbn} = $title;
print STDERR "[ISBN $isbn: $title]\n" if $opts{'v'} || !$opts{'r'};
$url = url($bookurl, $his_base)->abs . "/t";
$curreq = GET $url;
$response = $browser->request($curreq);
if ($response->is_error()) {
printf "Failed to lookup $url: %s\n", $response->status_line;
exit(1);
}
my $data = $response->content;
$data =~ s/<\/?t[rhd].*?>//isg; # they have bad html in here
my $html = parse_html($data);
my $formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 500);
my $ascii = $formatter->format($html);
for ($ascii) {
my($rank) = /Amazon\.com\s+Sales\s+Rank:\s*([\d,]+)/;
($ISBN_Rank{$isbn} = $rank || UNKNOWN) =~ s/,//g;
s/.*\|\s*\n//s;
s/\[(TABLE|FORM) NOT SHOWN\]//gs;
s/Learn more about.*?ordering//si;
s/-----.*$//s;
s/\r//g;
s/^ +$//g;
s/^Our Price.*//m;
s/Our Price.*//m;
s/\s*;\s*Dimensions.*//;
s/Try express shopping with\s*//;
s/1-ClickSM and Gift Click\s*//;
s/^You Save.*//m;
s/(?=List Price)/\n/;
s/\n{2,}/\n/g;
unless ($opts{'r'}) {
$Desc{$isbn} = $_;
} else {
print map { wrap("", " ", $_) . "\n" } split /\n/;
print "\n";
}
}
}
exit if $opts{'r'};
for my $isbn ( sort { $ISBN_Rank{$a} <=> $ISBN_Rank{$b} } keys %ISBN_Rank ) {
$_ = $Desc{$isbn};
s/(Amazon\.com\s+Sales\s+Rank:.*\n)//;
print "Rank: ", ($ISBN_Rank{$isbn} == UNKNOWN)
? "Unknown"
: commify($ISBN_Rank{$isbn}),
"\n";
print map { wrap("", " ", $_) . "\n" } split /\n/;
print "\n";
}
sub commify {
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse $text;
}
--
Does the same as the system call of that name.
If you don't know what it does, don't worry about it.
--Larry Wall in the perl man page regarding chroot(2)
------------------------------
Date: Fri, 28 May 1999 12:39:39 +0100
From: "Mark Hamlin" <mark@artdigital.co.uk>
Subject: conver TO url encoded
Message-Id: <7ilv9s$9ni$1@pheidippides.axion.bt.co.uk>
Has anyone got a script to convert a string to the format of URL encoded
data, ie spaces to pluses, symbols to %<numeric>.
Saver me getting sick on regexp.
Your help is much appreciated,
Cheers
Mark Hamlin
Systems Integration
------------------------------
Date: 28 May 1999 11:04:53 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Converting from ASCII to ANSI (and vice versa)
Message-Id: <374e6a45@newsread3.dircon.co.uk>
Poul Kornmod <pbk@rdsas.com> wrote:
> Dear All,
>
> I have searched the FAQ for this problem - but didn't find any
> solutions.
>
> How to convert chars from ASCII to ANSI?
>
Unless I missed something you dont have to - ANSI being a superset of
the ASCII characters.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 28 May 1999 10:19:25 GMT
From: pbk@rdsas.com (Poul Kornmod)
Subject: Re: Converting from ASCII to ANSI (and vice versa)
Message-Id: <374e6ad3.13761875@news.dknet.dk>
Dear Eric,
I'm sorry that I didn't make myself clear.
You have of cause right - but what I need is be able to display,
danish, german, swedish etc. special characters eg. "xfeXFE|\iI....."
in Windows. The file that contains these characters is made in ASCII
format and can be view in a DOS box using EDIT.
Do you have any idea? Thanks in advance.
Brgds
Poul Kornmod - pbk@cphzt.rdsas.com
On Fri, 28 May 1999 09:51:42 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:
>Poul Kornmod <pbk@rdsas.com> wrote:
>: I have searched the FAQ for this problem - but didn't find any
>: solutions.
>
>: How to convert chars from ASCII to ANSI?
>
>What do you mean by "ANSI"? Do you mean MS-Windows CP-1250 (which does
>not correspond to any ANSI standard; it's ISO-8859-1 plus a bunch of
>mappings to characters in the 0-31 and 128-159 ranges)? ASCII is a
>subset of CP-1250, so no conversion is necessary.
>
------------------------------
Date: 28 May 1999 11:02:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: directory file list into html conversion
Message-Id: <374e69ca@newsread3.dircon.co.uk>
junsc@sysic.hei.co.kr wrote:
> Hi, All
>
> Our intranet web server administrator has forbidden plain directory
> browsing by the web browser.
>
> I have quite large directory hierarchy structure that are full of
> document and reference files and I want to avoid making index file in
> each directory manually. Is there any easy way to convert file structure
> in a directory into html index file?
>
I made :
<http://www.btinternet.com/~gellyfish/resources/dir2html.htm>
I did this a while ago and it probably needs some work.
Alternatively you could look at :
<http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=474480725&fmt=text>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 28 May 1999 10:38:17 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7kqs4q.vm.sitaram@diac.com>
On Thu, 27 May 1999 05:32:06 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>In article <slrn7klkcn.mq8.sitaram@diac.com>,
> sitaram@diac.com (Sitaram Chamarty) wrote:
>>
>> I think the lady means "that real world in which "consultants" can
>> make lots of moolah by spreading unnecessary FUD about Y2K, and
>> where they (as well as trial lawyers) are panicking at the thought
>> of NOTHING major happening, and trying their damnedest to make hay
>> before the sun starts shining again".
>>
>So, you work for nothing do you? When do you get your sainthood?
I dont make money by spreading FUD, anyway. The worst thing that
I anticipate with Y2K is a run on the bank's ATMs caused by fears
stoked by people like you. But that's not Perl-related.
>I have more important things to do than spending my time searching for
>the ultimate newsreader. Deja News works just fine for me and,
>obviously, for many others.
Using inefficient tools is bad enough. Justifying it is even
worse. When will you realise that a "workman is only as good as
his tools".
dejanews is a fine service - I have no complaints about it if it
is used by lay people. My wife - who doesnt do anything with
computers, or perhaps a lawyer, or a doctor, etc., etc - are ALL
eminent candidates for this fine service. Especially if used
sparingly. [All this applies to using dejanews as a "newsreader"
for regular news reading, not the occasional search.]
If *this* is your profession, however, you'd better have the right
tools. With automatic threading, scoring, (or at least killfiles
- I can see mine is going to be added to soon ;-), and so on, it's
just a far more *efficient* use of my time.
The couple of hours or so I spent configuring slrn have long since
been repaid. This is true with almost any tool that you use
frequently, laying waste to your silly "I have more important
things..." argument.
Going back to my carpenter - I havent met one that said "I dont
have the time to go finding the ultimate tool kit - I'll just use
this saw for everything I have to do".
I hope that was clearer, although I'm fast beginning to suspect it
won't be.
>Whether a method of instructing a computer can be deemed a programming
>language, scripting language, interface language, job control language
>or some other esoteric jargon you would care to name, is a grey area
>that I don't wish to debate. The fact is that CGI shares the same Y2K
>booby-trap problem as Perl. Fixing Y2K problems is more important than
CGI is a protocol. It does not define ANYTHING to do with dates.
Absolutely nothing. Even if, in a moment of insanity, I were to
accept that Perl has a problem, that still does not translate to
CGI. You can do CGI with ANY language. So - in your "real
world", pick a language that doesnt have Y2K "booby-traps", use it
for CGI, and see - in a flash of blinding insight - the stupidity
of what you just said.
>playing stupid semantics.
or drawing stupid conclusions.
>---Share what you know. Learn what you don't.---
Hey - I think dejanews is trying to tell you something :-)
------------------------------
Date: Fri, 28 May 1999 10:38:19 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7kqsao.vm.sitaram@diac.com>
On Thu, 27 May 1999 14:36:01 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>Tom, thought you may be interested to know that I'm not the only
>mis-guided soul using the term "programming language" to describe CGI
>for expedience.
You may have used it for "expedience" to start with - although I
doubt that. But you cannot hide behind that word now, after
arguing vociferously with everyone here that it *is* indeed a
language. A full paragraph is not "expedient" in any way.
Give it up, sister!
------------------------------
Date: Thu, 27 May 1999 12:43:11 +0100
From: "Tobin" <Tobin@breathemail.net>
Subject: HASH troubles?
Message-Id: <374e80b9@news1.vip.uk.com>
Hi,
Sorry if this email is repeated but it hasn't appeared on the list after 2
hours! So i'm re-sending....
Basically, my search script seen at http://www.freephonedirectory.com (panel
in right bottom corner of main page) is not outputting correctly. If you
have a look you will see that the search results are displaced by 1 to 3
characters.
The script works by loading in records from a DBF file and storing them in a
hash (for sorting etc). Is there a common problem with hashes getting
confused.
This script works fine when run locally from the command prompt.
Any help would be ace!
Thanks,
Tobin
------------------------------
Date: 28 May 1999 12:26:14 +0100
From: Brian McCauley <B.A.McCauley@bham.ac.uk>
Subject: Re: killing exec()ed process - how?
Message-Id: <u990a98mg9.fsf@wcl-l.bham.ac.uk>
Otis Gospodnetic <otis@my-deja.com> writes:
> I was wondering if it is possible to get the PID of a 'command' executed
> by exec()
Exec does not fork(). The PID of the command is the same as the PID
of the process that called the exec.
> so that the 'command' can be killed directly (killing the
> process that called the exec() doesn't kill the 'command' - the
> 'command' keeps running)
If the command is given as a single string with metacharacters rather
than a list then the string is passed to the shell. This can add an
extra process which could explain your problem.
> In particular, my script forks a few processes and each of those
> processes does exec("command")
> Later, I need to kill everything: my script, all forked processes, as
> well as all commands that were exec()ed.
>
> In code:
> unless ($childPID = fork)
> {
> exec ("sleep 30");
> }
> wait;
>
> While this code is running I need to be able to kill it, as well as the
> forked process and the 'sleep 30' command that the formed process
> called.
> Is this possible?
Yes, no problem.
> I have the PID of the main process as well as PIDs of the forked
> processes, but sending them the TERM signal doesn't reach the exec()ed
> command ('sleep 30' in this example)
I am unable to reproduce your problem. When posting a programming
question to Usenet it is almost always a very good idea to include
code to repoduce the problem you are experienceing.
--
\\ ( ) No male bovine | Email: B.A.McCauley@bham.ac.uk
. _\\__[oo faeces from | Phones: +44 121 471 3789 (home)
.__/ \\ /\@ /~) /~[ /\/[ | +44 121 627 2173 (voice) 2175 (fax)
. l___\\ /~~) /~~[ / [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
# ll l\\ ~~~~ ~ ~ ~ ~ | http://www.wcl.bham.ac.uk/~bam/
###LL LL\\ (Brian McCauley) |
------------------------------
Date: 28 May 1999 11:53:12 +0100
From: Brian McCauley <B.A.McCauley@bham.ac.uk>
Subject: List lvalues and do - parser idiosyncrasy
Message-Id: <u9btf58nzb.fsf@wcl-l.bham.ac.uk>
Is this bug or what?
( do { @a } ) = ("x","y");
Error: Can't modify array deref in scalar assignment
Why is this seen as a scalar assignment?
I could understand this if singleton lists of lvalues usually resulted
in scalar assignments - but they don't:
( $a ) = ("x","y"); # Sets $a to "x" not 2.
I can work arround this idiosyncrasy as follows:
( do { @a }, undef ) = ("x","y");
--
\\ ( ) No male bovine | Email: B.A.McCauley@bham.ac.uk
. _\\__[oo faeces from | Phones: +44 121 471 3789 (home)
.__/ \\ /\@ /~) /~[ /\/[ | +44 121 627 2173 (voice) 2175 (fax)
. l___\\ /~~) /~~[ / [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
# ll l\\ ~~~~ ~ ~ ~ ~ | http://www.wcl.bham.ac.uk/~bam/
###LL LL\\ (Brian McCauley) |
------------------------------
Date: Fri, 28 May 1999 10:51:56 GMT
From: vertigan@bigfoot.com (Steve Vertigan)
Subject: Re: perl script as an executable
Message-Id: <374e7224.109720840@news.aurum.net.au>
Uri Guttman <uri@sysarch.com> wrote thus:
>CGI.pm allows you to test the programs from a command line. it can make
>errors display cleanly in html. it can handle data persistance across
>forms.
>
>can any hand-rolled cgi package do all those useful things?
Err, yes. Mine does all that in fact.
>so why waste
>your time.
I really don't have a good answer for that. I guess I just like wasting my
time. :-)
--Steve
------------------------------
Date: Fri, 28 May 1999 06:37:03 -0400
From: Sandy Currier <dsc@tiac.net>
Subject: perl_parse (perl embedding) question
Message-Id: <374E71CE.FC524662@tiac.net>
(many apologies if this is the second posting -
the first one didn't appear to make it out - or
perhaps the gods are angry...)
I am trying to understand the acceptable (supported)
syntax to perl_parse. In particular, can it be passed
a char *?
Why? I may need to support embedding a perl script
directly in C code (as a char array, perhaps a rather
large char array), and was trying to figure out if perl_parse
can be passed the pointer instead, for example, a filename,
that contains the script to be parsed.
The perlembed docs seem to refer to the perlguts docs
and vice-versa. Any pointers to info would be most
appreciated. Better ideas would be appreciated as well.
Thank you very much in advance,
-sandy
------------------------------
Date: Sat, 29 May 1999 11:33:16 +0200
From: "Pletschette Andri" <andre.pletschette@ltam.lu>
Subject: Re: scalar refs and m/(pat)/
Message-Id: <7iloeq$gc5$1@calais.pt.lu>
Why not use s/// ?
______________
www.grosbous.lu
Eli the Bearded <*@qz.to> wrote in message ...
>Is there some way to get m/(pat)/ type things to return scalar
>refs instead of just read-only copies of what was matched?
>This would allow things like direct manipulation of matched
>blocks (eg chomp).
>
>Elijah
>------
>the obvious $foo = \$1 did not do the trick
------------------------------
Date: Sat, 29 May 1999 11:20:48 +0200
From: "Pletschette Andri" <andre.pletschette@ltam.lu>
Subject: Re: Strip "http" from URL's
Message-Id: <7ilnse$ga6$1@calais.pt.lu>
simply:
s%http://%%;
>Given any URL such as:
>http://www.whatever.com/whatever/ or
>http://www.whatever.com/whatever or
>http://whatever.com/whatever/ or
>http://www.whatever.com/whatever/whatever.xxx or
>http://www.whatever.com/
>
>Will strip away everything after the actual website, so the output of
>the above examples would be:
>
>/whatever/
>/whatever
>/whatever/
>/whatever/whatever.xxx
>/
________________
www.grosbous.lu
------------------------------
Date: Fri, 28 May 1999 11:11:30 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Strip "http" from URL's
Message-Id: <7ilrvq$ptu$1@ash.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
"Pletschette Andri" <andre.pletschette@ltam.lu> wrote:
>simply:
>
>s%http://%%;
Not!
That will just lose the "http://" and leave the rest of the string.
s#http://[^/]+##;
that will do what was asked and remove everything up to the first /.
------------------------------
Date: Fri, 28 May 1999 10:31:13 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: tchrist@mox.perl.com (Tom Christiansen)
Subject: Re: workarounds for prototypes
Message-Id: <siemk11o5q.fsf@cre.canon.co.uk>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> And at this stage, it may remain an open topic whether
> Class::Multimethods pertains more to the solution set than it does to
> the problem set. :-)
I'm intrigued as to what you mean by this. Do you mean that
Class::Multimethods is a poor implementation of generic functions
(lacking as it does any equivalents of the CLOS features
define-method-combination, :around, :most-specific-last or
call-next-method) or do you mean that generic functions cause more
problems than they solve? I'd be interested to see your thoughts on
this issue.
--
Gareth Rees
------------------------------
Date: Fri, 28 May 1999 10:39:57 GMT
From: elcore@sgi.net (Lane Core Jr.)
Subject: Re: Y2K infected Perl code
Message-Id: <374e71ff.33697651@news.sgi.net>
On 27 May 1999 22:47:28 -0400, Uri Guttman <uri@sysarch.com> wrote:
>so fucking what if cgi
>routines and perl routines can be infected with y2k. that is the
>programmers problem and not the language's.
same with cobol.
same with any language.
so it's still a problem.
so, like, what's your point?
---------------------------------------------------------------------------
Mr. Lane Core Jr. elcore@sgi.net http://users.sgi.net/~elcore/elc_y2k.htm
---------------------------------------------------------------------------
"More software projects have gone awry for lack of calendar time than for
all other causes combined". Frederick P. Brooks, _The Mythical Man-Month_
------------------------------
Date: Fri, 28 May 1999 11:15:33 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Y2K infected Perl code
Message-Id: <7ils7e$ptu$2@ash.prod.itd.earthlink.net>
[ courtesy cc sent by mail if address not munged ]
elcore@sgi.net (Lane Core Jr.) wrote:
>On 27 May 1999 22:47:28 -0400, Uri Guttman <uri@sysarch.com> wrote:
>
>>so fucking what if cgi
>>routines and perl routines can be infected with y2k. that is the
>>programmers problem and not the language's.
>
>same with cobol.
>same with any language.
>so it's still a problem.
>so, like, what's your point?
It's not still a problem if you don't have a retard writing your code
for you!
------------------------------
Date: Fri, 28 May 1999 11:16:26 GMT
From: elcore@sgi.net (Lane Core Jr.)
Subject: Re: Y2K infected Perl code
Message-Id: <37507ae8.35978771@news.sgi.net>
On Fri, 28 May 1999 11:15:33 GMT, sowmaster@juicepigs.com (Bob
Trieger) wrote:
>[ courtesy cc sent by mail if address not munged ]
>
>elcore@sgi.net (Lane Core Jr.) wrote:
>>On 27 May 1999 22:47:28 -0400, Uri Guttman <uri@sysarch.com> wrote:
>>
>>>so fucking what if cgi
>>>routines and perl routines can be infected with y2k. that is the
>>>programmers problem and not the language's.
>>
>>same with cobol.
>>same with any language.
>>so it's still a problem.
>>so, like, what's your point?
>
>It's not still a problem if you don't have a retard writing your code
>for you!
Important question, then: how big an "if" is that? :-)
---------------------------------------------------------------------------
Mr. Lane Core Jr. elcore@sgi.net http://users.sgi.net/~elcore/elc_y2k.htm
---------------------------------------------------------------------------
"More software projects have gone awry for lack of calendar time than for
all other causes combined". Frederick P. Brooks, _The Mythical Man-Month_
------------------------------
Date: 28 May 1999 12:04:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Y2K infected Perl code
Message-Id: <374e7842@newsread3.dircon.co.uk>
In comp.lang.perl.misc Lane Core Jr. <elcore@sgi.net> wrote:
> On 27 May 1999 22:47:28 -0400, Uri Guttman <uri@sysarch.com> wrote:
>
>>so fucking what if cgi
>>routines and perl routines can be infected with y2k. that is the
>>programmers problem and not the language's.
>
> same with cobol.
> same with any language.
Not entirely true - there are languages with a DATE type that is completely
transparent to the programmer:
database tdcusers
define day1 date,
day2 date,
diff integer
main
let day1 = arg_val(1)
let day2 = arg_val(2)
let diff = day2 - day1
display diff
end main
sys0001 [figment] $ ttest "25/12/1999" "10/01/2000"
16
For example.
> so it's still a problem.
> so, like, what's your point?
>
I love it when it when a crosspost goes bad ...
I think that uri's point is that basically if someone is too dumb to have
read and understood the documentation for the localtime function then its
basically tough shit - it is not a problem with Perl its a problem with
the meatware.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
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 5814
**************************************