[10930] in Perl-Users-Digest
Perl-Users Digest, Issue: 4531 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 2 09:07:32 1999
Date: Sat, 2 Jan 99 06:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 2 Jan 1999 Volume: 8 Number: 4531
Today's topics:
@INC, doesn't seem to work <jjpark@home.com>
Bug in Modulo Operator? <skilchen@swissonline.ch>
Re: COM port and Perl <gellyfish@btinternet.com>
DB_File.pm ()
Re: Difference between Perl version 5.003 and 5.00402?? (Martin Vorlaender)
Re: FLY <ebohlman@netcom.com>
Re: Have any suggestion? <nospam_staffan@ngb.se>
Help on Chess.pl...Help with mailer <tspencer@exconet.co.uk>
Re: How does scope play in require? (Bart Lateur)
Never seen this error before? <support@counter.w-dt.com>
Re: New posters to comp.lang.perl.misc (Bart Lateur)
Re: New to perl (Bart Lateur)
Re: numbers in base 36 (Smith and cat)
Re: numbers in base 36 (Smith and cat)
Re: numbers in base 36 (Smith and cat)
Re: Path under windows (Ethan H. Poole)
Perl needs a dyadic list laminate builtin function <nospam.eam@starfire.mlb.semi.harris.com>
Re: Perl needs a dyadic list laminate builtin function (Sean McAfee)
perl on NT <jewell@OnlineRAGE.com>
Re: perl on NT imchat@ionet.net
Re: perl on NT <jewell@OnlineRAGE.com>
Perl OO question <marvela@marvela.com>
Re: perltoot use of $#_ (Steven Barbash)
Re: regexp (Bart Lateur)
Re: regexp (Tad McClellan)
Re: Retrospective on comp.lang.perl.moderated? (Leslie Mikesell)
Re: Splitting Input File W/$INPUT_RECORD_SELECTOR (Bart Lateur)
Re: STUPID PERL QUESTION... maybe <gellyfish@btinternet.com>
Re: Syntactical weirdness? Or is it just me? (Tad McClellan)
Re: tutorial websites <gpeake@wt.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 02 Jan 1999 07:00:37 GMT
From: Justin <jjpark@home.com>
Subject: @INC, doesn't seem to work
Message-Id: <368DC468.939E91E2@home.com>
this is what i tried
use lib '/data1/hypermart.net/mydir/lib';
use GD;
of course, GD.pm is in lib dir
and the error log says
Can't locate loadable object for module GD in @INC (@INC contains:
/data1/hypermart.net/mydir/lib ....)
can someone help me?
------------------------------
Date: Sat, 2 Jan 1999 14:51:00 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Bug in Modulo Operator?
Message-Id: <76l8cu$l5k3@news-sol.swissonline.ch>
Can somebody please check, what he/she gets as the result of the following:
$a = 32_730_968_896_115;
print $a % 36, "\n";
print $a - int($a / 36) * 36, "\n";
On my ActivePerl Build 507 on a W95 notebook it prints:
35
23
but it should print:
23
23
If this is "normal" Perl behavior: where can i find a
description/specification of the differences in the precision limits
between the modulo operator and "normal" arithmetic operations?
thanks for any help,
--
Samuel Kilchenmann
skilchen@swissonline.ch
------------------------------
Date: 1 Jan 1999 14:19:01 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: COM port and Perl
Message-Id: <76ilgl$91$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Bill Palmer <Bill.Palmer@online.disney.com> wrote:
> Slava wrote:
>>
>> Can you answer me what perl module I must use for the work with com port
>> (cua0/COM1/ttyS0, etc) ???
>
>
> What ever it is you're doing, you'll need to do it with sockets.
>
No.
This is touched upon in perlfaq8:
How do I read and write the serial port ?
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 2 Jan 1999 10:15:09 GMT
From: poke@oly.silverlink.net ()
Subject: DB_File.pm
Message-Id: <76krjd$i77$1@remarQ.com>
Was doing some work with dmbopen and came across some odd behaviour.
First of all, I tried a "use DBM_File;" and I keep getting the following:
Can't locate loadable object for module DB_File in @INC (@INC contains:
/usr/local/lib/perl5/5.00502/i386-bsdos /usr/local/lib/perl5/5.00502
/usr/local/lib/perl5/site_perl/5.005/i386-bsdos /usr/local/lib/perl5/site_perl/5.005 .) i
at ./test.pl line 3
BEGIN failed--compilation aborted at ./test.pl line 3.
Ok, so I look in DB_File.pm and I see the line:
require 5.003 ;
Can someone explain what that is all about...
Ok so then I copy an example out of the book to ensure that I am using the
commands correctly:
#! /usr/bin/perl -w
dbmopen %ALIASES, "/etc/aliases", 0666
or die "Can't open aliases: $!\n";
while (($key, $val) = each %ALIASES) {
print $key, ' = ', $val, "\n";
}
dbmclose %ALIASES;
And I get the following:
% ./test.pl
Use of uninitialized value at /usr/local/lib/perl5/5.00502/i386-bsdos/DB_File.pm line 248.
Deep recursion on subroutine "DB_File::AUTOLOAD" at /usr/local/lib/perl5/5.00502/i386-bsdos/DB_File.pm line 197.
Out of memory!
Segmentation fault (core dumped)
Any ideas?
Please respond directly and then I will post a summary of the results.
Thank You,
chuckw___REMOVE_THE_CAPITOL_LETTERS___AND_THE_UNDERSCORES@___NOSPAM___.silverlink.net
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: WWW: http://www.silverlink.net/poke :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Sat, 02 Jan 1999 05:09:32 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Difference between Perl version 5.003 and 5.00402???
Message-Id: <368d9bfc.524144494f47414741@radiogaga.harz.de>
[as this hasn't anything to do with modules, and I don't have 'local.help'
as a newsgroup here, f'ups narrowed to clpm]
Jules (julius@clara.net) wrote:
: Dear all, I wrote a perl program that works on my PC running the CPAN perl
: compiler 5.00402 and then tried running the same code on UNIX using
: perl5.003 but it doesn't work as expected. Is there anything major between
: the 2 version such as handling of OOP stuff?
"Doesn't work as expected" doesn't qualify as a valid error message.
You'll have to look it up yourself: read the 5.004_02's perldelta.pod.
Anyway: upgrading the 5.003 version is a Good Idea(TM).
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
VMS is today what | work: mv@pdv-systeme.de
Microsoft wants | http://www.pdv-systeme.de/users/martinv/
Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
------------------------------
Date: Sat, 2 Jan 1999 13:05:52 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: FLY
Message-Id: <ebohlmanF4xoDs.3KF@netcom.com>
Frank de Bot <debot@xs4all.nl> wrote:
: Can anyone tell me how I can detect where the FLY on my machine is?
: (With a cgi-script or whatever)
#!/usr/bin/perl -w
# WARNING: UNTESTED CODE
use File::Find;
print "Likely places where the FLY might be located:\n\n";
my $found=0;
find (\&wanted,'/');
if (!$found) {
print "Your FLY is either missing or unzipped\n";
}
sub wanted {
if (/\.z(?:ip)?$/) {
print "$File::Find::name\n";
++$found;
}
}
------------------------------
Date: Sat, 02 Jan 1999 11:48:20 +0100
From: Staffan Liljas <nospam_staffan@ngb.se>
Subject: Re: Have any suggestion?
Message-Id: <368DF974.5D0E28A8@ngb.se>
> Can anyone recommand me a good index search engine, or MySQL database
> for an Unix server?
You can go for PostgreSQL. But try looking at
http://www.hex.net/~cbbrowne/rdbms.html
There are a lot of free database programs out there. If you want to
index webpages, I't suggest free-WAIS-sf.
Both Postgres and WAIS has modules for perl to make scripts that
searches the databases / indexes (PG.pm and WAIS.pm, respectively), both
of which are, to my knowledge, free.
You can look at http://www.ngb.se/Databases/Taxon.html to see WAIS in
action (my script)
Good luck!
Staffan
------------------------------
Date: Sat, 2 Jan 1999 10:09:00 -0000
From: "Tony" <tspencer@exconet.co.uk>
Subject: Help on Chess.pl...Help with mailer
Message-Id: <368df1aa.0@glitch.nildram.co.uk>
I am using the Chess.pl program from Watson Consulting availible at
http://www.watson-net.com/download/chess.zip
I have it working apart from the mailer program.
The original script uses a Windows based mail program to send mail to notify
the next person of their go.
I want to use either Sendmail or Mail on my Unix machine but cannot get the
code correct.
Has anyone used this script and managed to get the mail option working on a
Unix machine.
If so could you provide me with the replacement code I need.
Thanks
Tony
------------------------------
Date: Sat, 02 Jan 1999 09:36:38 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How does scope play in require?
Message-Id: <368fe86b.485976@news.skynet.be>
Charles R. Thompson wrote:
>does the library get unloaded within each block?
I wouldn't think so. "require" is pretty much global.
But "required" files are loaded only once.
Bart.
------------------------------
Date: Sat, 02 Jan 1999 02:42:13 -0600
From: Mike <support@counter.w-dt.com>
Subject: Never seen this error before?
Message-Id: <368DDBE4.1CBCBEDF@counter.w-dt.com>
What does this error mean? I've never seen it before. It only occurs
when I use use strict. Otherwise the program runs fine. What does it
mean and how would I go about resolving it?
Variable "$ads_dir" is not imported at /cgi-bin/admin.cgi line 310.
Global symbol "ads_dir" requires explicit package name at
/cgi-bin/admin.cgi line 310.
------------------------------
Date: Sat, 02 Jan 1999 09:29:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: New posters to comp.lang.perl.misc
Message-Id: <368dd5e1.8176135@news.skynet.be>
Matthew Bafford wrote:
>And rating high in the top 10 by OCR is good! Only feel bad if you are
>in the bottom 10... Oh you are. :) Not enough new posters for anyone
>other than the top 10 to be in the bottom 10... Oh well.
It depends.
If you only ask questions, you'll have a high OCR. If you only do
follow-ups, and answer questions in a concise way (answers as short as
the question), you'll have a rather low OCR.
Bart.
------------------------------
Date: Sat, 02 Jan 1999 09:33:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: New to perl
Message-Id: <368ee71e.153405@news.skynet.be>
Daniel Grisinger wrote:
>> What are the top 10 (or more) features of perl?
>Regular expressions
>Portability
>Regular expressions
>Rapid development
>Regular expressions
>CPAN
>Regular expressions
>Excellent documentation
>Regular expressions
>Open source
>Regular expressions
>TMTOWTDI
>Regular expressions
Where are the hashes?
My top 2:
hashes AKA associative arrays
regular expressions
Also very nice: the possibility to pass any number of arguments to a
function.
Example:
sub min {
my $min = shift;
foreach (@_) {
$min = $_ if $_ < $min;
}
}
$minimum = &min(2,5,-1,3.14159);
Bart.
------------------------------
Date: 2 Jan 1999 01:06:08 -0800
From: inwap@best.com (Smith and cat)
Subject: Re: numbers in base 36
Message-Id: <76kni0$rvt$1@shell3.ba.best.com>
In article <Pine.GSO.3.96.981218092552.25649B-100000@pdxue150.cadence.com>,
Colin Kuskie <ckuskie@cadence.com> wrote:
> ##Use split and iterate over the characters
> foreach (split //, $b36num) {
> $decnum += $lh{$_};
> }
Nope. All of the methods produce bad results. You need to change
$decnum += $lh{$_};
to
$decnum = $decnum * 36 + $lh{$_};
in each case.
-Joe
--
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
(The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"
------------------------------
Date: 2 Jan 1999 01:17:13 -0800
From: inwap@best.com (Smith and cat)
Subject: Re: numbers in base 36
Message-Id: <76ko6p$l7$1@shell3.ba.best.com>
In article <75oq7s$7ne$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Here's a one liner, with no need for Perl:
>$ echo "obase = 789; 123 ^ 456" | bc
OK, which version of Unix have BC_BASE_MAX greater than 99?
The POSIX standard won't allow obase to be three digits.
The above command fails with "output base is too large" even on
the 64-bit Solaris-7.
-Joe
--
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
(The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"
------------------------------
Date: 2 Jan 1999 01:35:49 -0800
From: inwap@best.com (Smith and cat)
Subject: Re: numbers in base 36
Message-Id: <76kp9l$3cm$1@shell3.ba.best.com>
In article <x7iuf8mye3.fsf@sysarch.com>, Uri Guttman <uri@sysarch.com> wrote:
>no it doesn't!
Sorry, Uri, your solution does not work either.
And whose idea is it to process the number right to left? That's crazy.
The proper way to it is left to right.
-Joe
sub uri_base2dec {
my %chars;
@chars{(0..9, 'A'..'Z')} = (0..35);
my $base = shift;
my $number = shift;
my $ret;
my $multi = 1;
while( $c = chop $number, length( $c ) ) {
$ret += $chars{ uc $c} * $multi;
$multi *= $multi ;
}
return $ret;
}
sub joe_base2dec {
my %chars;
@chars{(0..9, 'A'..'Z')} = (0..35);
my $base = shift;
my $number = shift;
my $ret = 0;
foreach $c (split(//,$number)) { # Do this in forward order
$ret = $ret * $base + $chars{ uc $c};
}
return $ret;
}
print "123 = ",joe_base2dec(10,"123")," != ",uri_base2dec(10,"123"),"\n";
print "1ff = ",joe_base2dec(16,"1ff")," != ",uri_base2dec(16,"1ff"),"\n";
--
INWAP.COM is Joe Smith, Sally Smith and our cat Murdock.
(The O'Hallorans and their cats moved to http://www.tyedye.org/ Nov-98.)
See http://www.inwap.com/ for PDP-10, "ReBoot", "Shadow Raiders"/"War Planets"
------------------------------
Date: Sat, 02 Jan 1999 08:13:30 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Path under windows
Message-Id: <Kykj2.5146$Dy5.22911@news3.ispnews.com>
[Posted and Emailed] In article <368D9121.7FA01CF1@dial.pipex.com>,
makr44@dial.pipex.com says...
>
>Hi,
>
>I'm having difficulty with the path under windows 95.
>
>I have perl installed at c:/perl/bin/perl. I can run scripts okay from
>the Dos prompt. Now, I managed to get the following little script
>running correctly, but when I came back an hour later, it was asking if
>I wanted to save the file, rather than just running it, or it runs it at
>the dos prompt. I've tried altering the path, which fixed it before, but
>to no effect, and I can't think why it'd have changed anyway.
>
>Could anyone tell me what is wrong?
>
>#! c:\perl\bin\perl
^^^^
Should be no space here (you could also use the -w option to generate some
warnings which might have been helpful)
FWIW, under Windows, Perl would be perfectly happy if your first line read
more unix-like: "#!/usr/bin/perl"
>($fieldname, $comment) = split (/=/, $ENV {'QUERY_STRING'});
A bit dangerous to assume there will never be a case (even maliciously) where
more than one value might be present.
>$comment =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg;
>$comment =~ s/\+/" "/eg;
You need to expand the '+' symbol *before* you convert the escaped
hexadecimal values. Otherwise a real '+' symbol in the data stream will be
converted to a space as well.
You also seem to be discarding the field name, not a good practice in general
(why even set the fieldname if you are going to discard it?).
Also, note that the current mechanism will only work for GET requests and
will totally fail for POST type requests.
My suggestion: write a thorough and universal parsing function and use it in
all your projects. The use of a consistent and well proven function will
save you a lot of development and debugging time down the road. In the
meantime, use the CGI.pm module available until you learn how to write these
functions for yourself.
>print "Content-type: text/html\n\n";
>print "<html><body> your comments: $comment <br>\n";
>print "</body>\n</html>";
--
Ethan H. Poole | Website Design and Hosting,
| CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day--
| http://www.interact2day.com/
------------------------------
Date: Tue, 29 Dec 1998 13:38:40 -0500
From: Software Sciences <nospam.eam@starfire.mlb.semi.harris.com>
Subject: Perl needs a dyadic list laminate builtin function
Message-Id: <368921B0.A9A75437@starfire.mlb.semi.harris.com>
Perl seems to want to interact with hashes elementally- it wants "a key
then its value". However, many problems present themselves as "a list of
keys" and another "list of values".
If there is a nice way to work with that in Perl, I can't find it. Perl
provides "keys" and "values" builtins to delaminate a hash, but from
what I can see no corresponding function to laminate two lists into a
hash such as this function I wrote that takes two list refs and returns
a ref to a hash:
sub laminate #laminate 2 lists into a hash, return mt hash if too many
keys
# discard extra values if present
{my %h;
my $i=0;
my @l0=@{$_[0]};
my @l1=@{$_[1]};
if ((@l1)>=@l0)
{foreach {@l0)
{$h{$_}=$l1[$i++];}
}
return \%h;
}
This should be a very common thing to want to do- Larry give us the
builtin, & make it faster, better than this foreach thingie.
Pax.
------------------------------
Date: Sat, 02 Jan 1999 06:43:32 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Perl needs a dyadic list laminate builtin function
Message-Id: <oejj2.318$Ge3.1841646@news.itd.umich.edu>
In article <368921B0.A9A75437@starfire.mlb.semi.harris.com>,
Software Sciences <nospam.eam@starfire.mlb.semi.harris.com> wrote:
>Perl seems to want to interact with hashes elementally- it wants "a key
>then its value". However, many problems present themselves as "a list of
>keys" and another "list of values".
Indeed.
>If there is a nice way to work with that in Perl, I can't find it. Perl
>provides "keys" and "values" builtins to delaminate a hash, but from
>what I can see no corresponding function to laminate two lists into a
>hash such as this function I wrote that takes two list refs and returns
>a ref to a hash:
[snip]
>This should be a very common thing to want to do- Larry give us the
>builtin, & make it faster, better than this foreach thingie.
We don't need another builtin, as the syntax already exists to do what you
need and a lot more besides:
@keys = qw(key1 key2 key3);
@values = qw(val1 val2 val3);
@hash{ @keys } = @values;
See the perldata manpage.
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Sat, 02 Jan 1999 00:23:46 -0500
From: "Ronnie D. Jewell" <jewell@OnlineRAGE.com>
Subject: perl on NT
Message-Id: <368DAD62.90CB6C6D@OnlineRAGE.com>
Hi all,
I am trying to get a script to run on NT.. the script works fine on
unix...
seems like this line is causing all the problems
use CGI qw(:standard);
Any suggestions??
--
RAGE Enterprises
Ronnie D. Jewell jewell@onlinerage.com
voice: 304-525-1898
http://www.onlinerage.com
------------------------------
Date: Sat, 02 Jan 1999 05:23:36 GMT
From: imchat@ionet.net
Subject: Re: perl on NT
Message-Id: <368dabd6.40378761@news.ionet.net>
This sript requires the cgi.pm module be installed. If you're
using the activestate package you can use the package installer to add
this. If you have trouble with ppm.pl, you can just get the perl
binary from http://www.perl.com/CPAN-local/ports/index.html#win32
I think this binary is much better than the activestate
package.
On Fri, 01 Jan 1999 23:40:17 -0500, "Ronnie D. Jewell"
<jewell@OnlineRAGE.com> wrote:
>Hi all,
>
>I am trying to get a script to run on NT.. the script works fine on
>unix...
>seems like this line is causing all the problems
>
>use CGI qw(:standard);
>
>Any suggestions??
>
>
>
>--
> RAGE Enterprises
>Ronnie D. Jewell jewell@onlinerage.com
>voice: 304-525-1898
>http://www.onlinerage.com
>
>
------------------------------
Date: Sat, 02 Jan 1999 00:28:35 -0500
From: "Ronnie D. Jewell" <jewell@OnlineRAGE.com>
Subject: Re: perl on NT
Message-Id: <368DAE82.359DFC2@OnlineRAGE.com>
sorry about all the posts... my darn email client was saying it could not
find the mail.server and I didnt know they were going through...... thanks
for the answer though
Matthew Bafford wrote:
> In article <368D9CA3.4D4FA099@OnlineRAGE.com>, jewell@OnlineRAGE.com
> says...
> => Hi all,
> =>
> => I am trying to get a script to run on NT.. the script works fine on
> => unix...
> => seems like this line is causing all the problems
> =>
> => use CGI qw(:standard);
> =>
> => Any suggestions??
>
> 1) Post only 1 time.
> 2) Post the error messages you are getting, the version of Perl you are
> using, the output you get, the output you expect, what you've tried,
> and what you think is wrong.
> 3) Have a Happy New Year!
>
> HTH!
>
> --Matthew
--
RAGE Enterprises
Ronnie D. Jewell jewell@onlinerage.com
voice: 304-525-1898
http://www.onlinerage.com
------------------------------
Date: Sat, 02 Jan 1999 09:09:47 GMT
From: "marvela.com" <marvela@marvela.com>
Subject: Perl OO question
Message-Id: <368DE281.CC8FA341@marvela.com>
Hi All,
I have a question about object oriented programming in perl. I
want to do some polymorphism in perl like virtual function in C++. Can
someone help me with any resources?
Your help is greatly appreciated.
Thanks.
Gene
------------------------------
Date: Sat, 2 Jan 1999 00:56:53 -0500
From: stevenba@ccpl.carr.org (Steven Barbash)
Subject: Re: perltoot use of $#_
Message-Id: <MPG.10f77f346e2c6a3698968a@www.siast.sk.ca>
Randal,
>Notice the last line there. So $#_ is the last index of array @_.
>I presume you have seen @_. :)
Ah hah! Yup. And thanks :-)
Steve
------------------------------
Date: Sat, 02 Jan 1999 09:40:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regexp
Message-Id: <3690e90c.647236@news.skynet.be>
imchat@ionet.net wrote:
> I'm really new to regexps and even though I've been studying
>them, I can't seem to formulate one that will turn something like
>this;
>c:\whatever\whatever\whatever\image.gif
>TO
>image.gif
Dead easy. The next will delete everything up to (including) the last
backslash, forward slash (the alternative) or colon (the protocol or
drive prefix):
s/.*[\\\/:]//;
HTH,
Bart.
------------------------------
Date: Sat, 2 Jan 1999 07:03:43 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regexp
Message-Id: <ff5l67.3nd.ln@magna.metronet.com>
Staffan Liljas (nospam_staffan@ngb.se) wrote:
:
: If you have
: $path = "c:\whatever\whatever\whatever\image.gif";
What do you get when you do
print "$path\n";
???
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 2 Jan 1999 01:17:19 -0600
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76kh5v$1vir$1@Venus.mcs.net>
In article <76g65t$s2s$1@nnrp1.dejanews.com>, <dturley@pobox.com> wrote:
>
>I made my first post to clp.mod last week. I received the mail, hit reply and
>that was it. Didn't even take 2 seconds.
Wow, a whole 2 seconds to review the advice in the emailed response and
determine that the question was not answered in any of the resources
listed.
>If people don't like the rules
>established for the group, DON'T POST TO IT! and quit wasting bandwidth
>bitching about it. ____________________________________ David Turley
I don't - this thread was started to discuss the effect of those
rules.
Les Mikesell
les@mcs.com
------------------------------
Date: Sat, 02 Jan 1999 11:26:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Splitting Input File W/$INPUT_RECORD_SELECTOR
Message-Id: <368f011b.2426696@news.skynet.be>
UMD Vikram wrote:
>Notice how three database txt files are merged together. Now I just want to
>split them at the ***** and then I can split then further from there.
Your English name for the variable is wrong. The short name is $/ .
So:
open(FILE,"db.txt");
$/ = "*****\n";
while(<FILE>) {
# now $_ contains the first record, including the terminator
chomp;
# now it's gone
...
}
If you really want to use split itself, you must be aware of the fact
that "*" has a special meaning for regexes.
{
local $/; #undef
$wholefile = <FILE>;
}
@records = split /\*\*\*\*\*\n/, $wholefile;
HTH,
Bart.
------------------------------
Date: 1 Jan 1999 14:21:24 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: STUPID PERL QUESTION... maybe
Message-Id: <76ill4$94$1@gellyfish.btinternet.com>
On Wed, 30 Dec 1998 01:53:25 GMT Jeff wrote:
>
> I am trying to write a program that needs user input, and,
> I would like the abiltiy to paste windows clipboard data as
> that input. Unfortunately, this is not easy/possible with the
> standard "dos window" interface.
>
I think that the module Win43::Clipboard will allow you to do this ..
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 2 Jan 1999 06:52:00 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Syntactical weirdness? Or is it just me?
Message-Id: <gp4l67.3nd.ln@magna.metronet.com>
Matthew O. Persico (mpersico@erols.com) wrote:
: try print(reverse($string))
_You_ try that, and see that it changes nothing... ;-)
: AJ wrote:
: >
: > I think this line
: > print reverse($string);
: > doen't perform the reverse function before it prints, but:
: > $bstring=reverse($string);
: > uses the reverse function as it was intended. A good lesson for all of us
: > (and I include myself, for sure), don't try to print a function, just the
: > the variable.
That is not the lesson to be learned here.
The lesson is to understand the difference between
scalar and list context.
print scalar reverse($string);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 02 Jan 99 02:06:26 -0600
From: "Gary Peake" <gpeake@wt.net>
Subject: Re: tutorial websites
Message-Id: <979.671T1331T1263923gpeake@wt.net>
nospam_gwynne@utkux.utk.edu scribed to us about Re: tutorial websites
in comp.lang.perl.misc
We are trying to set up something just like this for many Open Systems
languages. If any of you Perl guys (gals) want a free web home to post
some decent tutorials or Perl info, please email me immediately.
gpeake@wt.net
The site will be at http://owlnet.net
>Try http://www.digitaled.com/preview/oreilly/home.html
>Bob Gwynne
><uunews@hotmail.com> wrote in message
>news:76dint$si9$1@nnrp1.dejanews.com...
>>Hi Folks,
>> I am looking for useful websites and mail servers on PERL. Any
>> help is
>>appreciated.
>>
>>Sincerely,
>>Ali
>>
>>-----------== Posted via Deja News, The Discussion Network
>>==---------- http://www.dejanews.com/ Search, Read, Discuss,
>>or Start Your Own
--
Gary Peake PLEASE NOTE NEW EMAIL ADDRESS!!
Team AMIGA - OwlNet Net
gary@owlnet.net
http://www.owlnet.net (coming soon)
------------------------------
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 4531
**************************************