[11298] in Perl-Users-Digest
Perl-Users Digest, Issue: 4898 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 15 15:07:25 1999
Date: Mon, 15 Feb 99 12:00:25 -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 Mon, 15 Feb 1999 Volume: 8 Number: 4898
Today's topics:
Re: #!/usr/bin/perl AND #!/usr/local/bin/perl both pos (David Efflandt)
ActivePerl vs. Standard Perl for Win32 <jalilf@home.com>
Re: Can 2 "submit" buttons in 1 form do different thing (David Efflandt)
Re: cron (Effie Rover)
Re: DBF format (Honza Pazdziora)
Re: File creation problem !!Someone has to know this!! (David Efflandt)
formats for publishing in perl (Eric Smith)
Re: Hash of hash will not print value <uri@home.sysarch.com>
Interleaving two lists? <hjones@vossnet.co.uk>
Re: Is there a perl script for finding out who fingered (David Efflandt)
Passing imput variable from one script to another <iandi@gate.net>
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: PERL for Personal Web Server <duronagroup@earthlink.net>
Perl questions... <Tram.Pham@usa.alcatel.com>
Re: Perl questions... (brian d foy)
perl script <abukar@insidewire.com>
Re: perl script (brian d foy)
Re: Perl Xbase Module. (Honza Pazdziora)
Re: PFR: read_file, write_file (Jari Aalto+mail.perl)
Re: PFR: read_file, write_file <uri@sysarch.com>
Re: Python vs. Perl vs. tcl ? <james.b.crigler@lmco.com>
REGEX $1, $2 ... array? <asquith@macconnect.com>
regexps (Peter Palfrader)
String Compare <psala@btv.ibm.com>
timetable update script jocke1s@earthling.net
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Feb 1999 19:01:29 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: #!/usr/bin/perl AND #!/usr/local/bin/perl both posible?
Message-Id: <slrn7cgrmh.ei.efflandt@efflandt.xnet.com>
On Mon, 15 Feb 1999 16:16:47 +0100, Joel Wijngaarde <vasquez@zap.a2000.nl>
wrote:
>Well, the problem is that I'm not the administrator on both systems...
>And I thought that because you don't know where somebody installs his
>Perl distribution there would be an option to search multiple paths.
To make it even more confusing, I have seen some systems that have perl4
in one path and perl5 in another. I symlink my Linux box to match my ISP.
If you have 2 different websites did you ever think of writing a perl
script to check and correct all perl scripts you have on that system? As
long as that one script on each system has the right path, it could
correct any others either from a list or searching a list of directories
for all executable text files that have perl in the first line.
>Taomi wrote:
>>
>> How about creating a symbolic link (using: ln) on one system so you can
>> use the same path on both.
>> kikeboe,
>> r
>>
>> Joel Wijngaarde wrote:
>> >
>> > Hi,
>> >
>> > Is it possible to give to search paths. I run my Perl script son two
>> > machines and both have Perl in different directories. One has Perl in
>> > /usr/bin/perl and the other in /usr/local/bin/perl.
>> >
>> > Now i'm always changing the first line...
>
>--
>Joel Wijngaarde (Physics student)
>vasquez@zap.a2000.nl
>
>Quote:
> "The final solution is possibly a little extreme - create a new
> country - and then export all lawyers there. The Brit's tried
> this with Australia, but somehow something went awry
> somewhere along the line."
>
> "Hrm. The whole of Europe did that with America and it seems to
> have been moderately successful."
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 15 Feb 1999 19:43:51 GMT
From: "Jalil Feghhi" <jalilf@home.com>
Subject: ActivePerl vs. Standard Perl for Win32
Message-Id: <XN_x2.6730$yv3.1442@news.rdc1.sfba.home.com>
What is the difference b/w ActivePerl (5.005) and Standard Perl (5.004) for
Win32? I am new to Perl and would like to know which one I should go for. Is
one a superset of the other, etc?
Thanks,
-Jalil
------------------------------
Date: 15 Feb 1999 19:13:47 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Can 2 "submit" buttons in 1 form do different things?
Message-Id: <slrn7cgsdk.ei.efflandt@efflandt.xnet.com>
On Sun, 14 Feb 1999 20:27:52 -0800, Pamela Schultz <vikette@earthlink.net>
wrote:
>I have a polling script being executed as a result of a form submit. See
>http://www.lineoffire.com/vote.html. Right now my "vote" button is in 1 form
>and my "view results" button is in another form -- therefore they are on
>separate lines in my html page since I can't put 2 forms on the same line.
>My perl script looks for values in hidden fields in order to determine what
>to do. Like this:
>
>if ($fields{'action'} eq "VIEW")
> {
> &do_stuff;
> exit;
> }
>
> if ($fields{'action'} eq "VOTE")
> {
> &do_other_stuff;
> exit;
You don't even need hidden fields for this. Just give each submit button
a different name. I have an example of this in my guestbook script which
uses the same CGI to handle Preview and Post buttons on the same form. I
don't even look for the value (which is the button label). I just check
whether the value for each name is true (a button not pressed has no
value).
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 15 Feb 1999 19:19:46 GMT
From: null@effierover.com (Effie Rover)
Subject: Re: cron
Message-Id: <36c971cd.4106670@news.iinc.com>
On Thu, 11 Feb 1999 22:12:57 GMT, "JJ" <webdude@mcminn.net> wrote:
>Does anyone know of a way to do a type of cron with cgi? I cant get my isp
>to set up anything for me in cron..
>what I want to do is update a page automatically every 3 days
I've done this with forms. Visitors enter values into a cgi form - I
want these values updated on the web page, but not every single time
someone enters something. So each time someone submits an entry, the
cgi script checks to see when the page was last updated, and if it's
more than a week, updates the web pages with all accumulated entries
at that time.
It's not exact - if no one enters the form in two weeks, it won't get
done during that two weeks. But the next person to come along _will_
trigger an update, so I look at it as a kind of "as needed" thing.
It's a nice cross between burdening the system with a cron task,
updating every single time someone enters something, and doing it
manually. If you're not depending on form input, you can make a form
yourself on a hidden page and hit the button periodically... just keep
an eye to the load you're placing on the server. I work for my ISP,
and I know they bump users who hog system resources - especially for
non-commercial uses.
-- Loy
Loy Ellen Gross AKA Effie Rover
The email address above goes straight to /dev/null :-)
effie -at- effierover -dot- com * http://www -dot- effierover -dot- com
Effie Rover's Fantasy Role Playing Gamer's Library
------------------------------
Date: Mon, 15 Feb 1999 18:50:49 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: DBF format
Message-Id: <F77Lop.5GC@news.muni.cz>
On Mon, 15 Feb 1999 05:02:42 GMT, Eric Bohlman <ebohlman@netcom.com> wrote:
> bababozorg@aol.com wrote:
>
> Use Text::CSV to read the data in and DBI with DBD::Xbase to write the
Beware the capitalization -- it's XBase and DBD::XBase.
Yours,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
make vmlinux.exe -- SGI Visual Workstation Howto
------------------------------------------------------------------------
------------------------------
Date: 15 Feb 1999 19:22:25 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: File creation problem !!Someone has to know this!!
Message-Id: <slrn7cgstq.ei.efflandt@efflandt.xnet.com>
On Mon, 15 Feb 1999 09:56:57 +1100, Patrick Fong
<patfong@yoyo.cc.monash.edu.au> wrote:
>My problem is that I want to create a file and write data to it using
>Perl. Or any other languages.
>
>The file name is supplied by the client in the Web browser and the data is
>written to it upon form submission...
The webserver likely runs as nobody, so either the file has to already
exist with 666 permission, to create a file the directory needs 777
permission and you better chmod 666 any created files so you can edit or
delete them from the shell, instead of just from CGI.
Another alternative is running your script suid as you so it can do
anything you can do. However, this usually requires a C wrapper.
Forturnately my ISP is running the apache suexec option so all my CGI runs
as me.
>pfon2@student.monash.edu.au
>lielar@hotmail.com
>lesdabetter@geocities.com.au
>patfong@yoyo.cc.monash.edu.au
>patfong@eisa.net.au
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: 15 Feb 1999 19:14:07 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: formats for publishing in perl
Message-Id: <slrn7cgtde.612.eric@plum.fruitcom.com>
Hiya perl
I am developing end-user win32 applications that publish many reports. These
reports are then (mailed | faxed | printed) by the end user. I see
the requirements for the document file format as follows:
1. Capable of reasonably rich formatting with font sizes and alignment
settable.
2. Present consistently to the end-recipient of the
document with respect to layout, fonts and _page breaks_.
3. Most importantly 99 out of 100 'the users' should be able to view the
document with what is currently installed on their machine - I operate on
the hypothesis that these 99 have both msoffice and a java browser installed.
4. The following are not essential but are recommendations:
a. include graphics (like a logo); b. "web ready" format.
If all the world ran *nix boxes, I would publish in postscript, until then
;) what are developers using?
<mindump>
o rtf - standard,good formatting
o html - standard,cannot determine exactly how document will present on
client (font size, page breaks), is webbable.
o msword doc (via OLE)
o javascipt document - I better shut up caus I don't know nything
0 XML - can this be viewed by standard browsers?
</mindump>
ciao and thanx for your ideas
Eric Smith
amateur oyster raider
------------------------------
Date: 15 Feb 1999 13:45:10 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Hash of hash will not print value
Message-Id: <x790dzo6a1.fsf@home.sysarch.com>
>>>>> "JY" == Jason Yarrington <jyarri@yahoo.com> writes:
JY> Content-Type: text/plain; charset=us-ascii
don't post mime. usenet is a text only medium.
JY> foreach $field ( keys %{ $hoh{$user} } ) {
^^^
JY> print "$field = $HoH{$user}{$field}";
^^^
to paraphrase a famous song: what about those two thing is not like the
other? what about them is not quite the same?
if you can answer that, your problem will be solved.
JY> Content-Type: text/html; charset=us-ascii
even worse than mime is html. that isn't text either.
hth,
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 15 Feb 1999 19:18:34 -0000
From: "Howard Jones" <hjones@vossnet.co.uk>
Subject: Interleaving two lists?
Message-Id: <7a9s13$3jr$1@news1.cableinet.co.uk>
Hi,
I have a problem that comes up every now and then and each time it bugs me:
Given a Tab-delimited text file, I want to read line 1, to get the Field
names, then each line afterwards into a hash where the keys are the field
names.
chomp($first_line = <STDIN>);
@fieldnames=split(/\t/,$firstline);
chomp($nextline = <STDIN>);
@values=split(/\t/,$nextline);
# the hard bit
%data = {magic code} @fieldnames, @values;
- How do I get @fieldnames and @values into a hash? I am sure there is some
way of using map() to do this in one line... The first way I saw is just to
use shift on each list in turn, but that'll mangle my list of field names.
*is* there a clever way, or just the obvious ways?
Thanks for any illumination,
Howard.
------------------------------
Date: 15 Feb 1999 19:38:19 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Is there a perl script for finding out who fingered me???
Message-Id: <slrn7cgtri.ei.efflandt@efflandt.xnet.com>
On Mon, 15 Feb 1999 03:37:51 -0600, seong joon bae
<seongbae@students.uiuc.edu> wrote:
>Hello, everyone.
>I was just wondering...you know that in Unix, you can finger someone and
>find out his/her information, such as when they were logged on, or logged
>out.
>I have been trying to figure out a perl script that shows me who have
>fingered me.
>Is that possible?
>If so, can someone tell me how...?
>you can email me at seongbae@uiuc.edu
It is easy if you are root because you can set the system up to finger
whoever fingers through hosts.allow or hosts.deny. Or you can check
system messages.
But as a user I think there is something in 'man perlipc' or one of
those about setting up a FIFO that appears to be a file, but is handled
by a background process. If you had something like this on your .plan,
there may be some way to figure out who is reading it, and they will not
be any the wiser, as long as you pass some data to them.
--
David Efflandt efflandt@xnet.com
http://www.xnet.com/~efflandt/
------------------------------
Date: Mon, 15 Feb 1999 13:28:01 -0500
From: "Ariel" <iandi@gate.net>
Subject: Passing imput variable from one script to another
Message-Id: <7a9p64$21au$1@news.gate.net>
I would appreciate any assistance in resolving the following situation:
1. A variable is read from an html form in the following way:
<FORM METHOD="POST" ACTION="../cgi-bin/search.pl">
<INPUT name="folder" type="text" value="" size="20">
2. The variable value is then read by search.pl in the following way:
$folder=$MYDATA{"FOLDER"}; - all functions properly - search.pl displays an
output html with various links for the user to click on (all is ok):
3. The problem is that in the output html generated by search.pl, the links
are to another script such as --- ../cgi-bin/disp.pl?NUMBER=1053636" --- and
at that point I would like to pass the same variable value (for "folder")
that was read by the first script.
Ariel
------------------------------
Date: Mon, 15 Feb 1999 18:42:31 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a9pql$td6$1@nnrp1.dejanews.com>
In article <36c6ec4e.2037381@news.cis.dfn.de>,
richardc@tw2.com (Richard Clamp) wrote:
> On Fri, 12 Feb 1999 19:52:52 GMT, topmind@technologist.com wrote:
>
> >In article <36c40680.5586888@news.cis.dfn.de>,
> > richardc@tw2.com (Richard Clamp) wrote:
> >> On Fri, 12 Feb 1999 04:10:47 GMT, topmind@technologist.com wrote:
> >>
> >> >
> >> >Correction: If population Y tends to abuse X, then X
> >> >should not be used by population Y.
> >> >
> >>
> >> I dunno, my (Y) car wouldn't go half as well if you took it's gearbox
> >> (X) away, or stopped me using it.
>
> >They forced seatbelts (Calif.), child carseats, internal rollbars,
> >helmets (mc's), etc. on us. The reason free-for-all does not quite work
> >is because the rest of society ends up paying the huge medical bills
> >when beltless Cowboy Joe turns himself into drewelling Vegetable Man.
>
> And yet there are members of the population who would happily carry
> DNR orders if it allowed them to ride their motorcycles without
> helmets.
>
> >Similarly, business will want to protect themselves somewhat
> >from syntax abuse that they and the maintenance programmer
> >pay for in the longer run.
>
> Well, if I take my car to a private road, thrash it to pieces, ruin
> the gearbox, the engine, the tires and my nerves in the name of my
> personal entertainment then where is the problem?
> The only party affected to the detriment is the owner of the car (me),
> who'll have to shell out and fix the car. Someone should stop this
> practice immediately and save Paul Newman and Karl Haas all the
> expense in hiring mechanics, wouldn't you agree?
>
> Buisnesses have a reasons for going with Perl, such as productivity.
Perhaps short-term productivity, until they have to pay
the huge decyphering bill when the "maintenance guy" comes.
After being burned a few times via quick but unmaintenable
code, a business will eventually pick something that
does not require and encourage so much funcativity to
get things done.
> Racing teams have with going for big name drivers, such as
> sponsorship.
>
> And thought police should stay out of my way.
>
> Richard
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 15 Feb 1999 19:36:39 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn7cgtq7.877.dformosa@godzilla.zeta.org.au>
In article <7a9pql$td6$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <36c6ec4e.2037381@news.cis.dfn.de>,
[...]
>Perhaps short-term productivity, until they have to pay
>the huge decyphering bill when the "maintenance guy" comes.
>
>After being burned a few times via quick but unmaintenable
>code, a business will eventually pick something that
>does not require and encourage so much funcativity to
>get things done.
Or they will will shift internal policy so that it supports a system of code
review.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
? The platypus' furry art and lititure
compertision http://www.zeta.org.au/~dformosa/rules.html
------------------------------
Date: Mon, 15 Feb 1999 11:11:31 -0500
From: "Joe Chambers" <duronagroup@earthlink.net>
Subject: Re: PERL for Personal Web Server
Message-Id: <7a9kqn$n0t$1@oak.prod.itd.earthlink.net>
Michael Taylor wrote in message <7a5e68$4nu@bgtnsc03.worldnet.att.net>...
>Wow...I really can't help you with the Microsoft Personal Web server, but
>since I think it sucks I'll throw you a curve. There currently is a port
of
>Apache that runs on WIN32 machines. I have successfully installed it on
>both NT4.0+ and WIN95/98 boxes. With Apache, you can edit the .conf files
>to specify that it understands certain file extensions, like .cgi.
> ...
Michael, I realize that you probably already know this, but I just thought
I'd add my voice to yours.
I spent two days trying to get MS IIS and PWS to work with PERL. At the end
of day two I went to a bookstore, because it was obviously something that
hadn't been documented, but might be in a book. There I saw a book about
running Apache on Windows NT. I latched on to that idea. When I got home I
downloaded Apache and Perl to my personal machine. Including download time,
it was only twenty minutes until I was working on CGI in a real HTTP server
environment. The rest of the configuration was fairly easy.
Joseph Chambers
joec@duronagroup.com
------------------------------
Date: Mon, 15 Feb 1999 11:15:17 -0600
From: Tram Pham <Tram.Pham@usa.alcatel.com>
Subject: Perl questions...
Message-Id: <36C85625.8C800AD8@usa.alcatel.com>
My assignment is to "remotely" read webpage, then copy the content of
the page, and send it back... My question: is it possible to write a
Perl program to do this? and how should I start? I'm really appreciate
any help!!
--
vnguyen vand@cs.utexas.edu
------------------------------
Date: Mon, 15 Feb 1999 12:39:24 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl questions...
Message-Id: <comdog-ya02408000R1502991239240001@news.panix.com>
In article <36C85625.8C800AD8@usa.alcatel.com>, Tram Pham <Tram.Pham@usa.alcatel.com> posted:
> My assignment is to "remotely" read webpage, then copy the content of
> the page, and send it back... My question: is it possible to write a
> Perl program to do this?
yes.
> and how should I start?
use LWP::Simple;
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Feb 1999 13:49:58 -0500
From: "Abukar Mohamed" <abukar@insidewire.com>
Subject: perl script
Message-Id: <36c86b7c.0@diana.idirect.com>
Hi
I am developing a scripts that writes a cookie . I wonder if there is a way
to tell the users if their browser does not support cookie or even not
enabled.
Thanks and I appreciate any help.
Abukar
------------------------------
Date: Mon, 15 Feb 1999 14:26:28 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl script
Message-Id: <comdog-ya02408000R1502991426280001@news.panix.com>
In article <36c86b7c.0@diana.idirect.com>, "Abukar Mohamed" <abukar@insidewire.com> posted:
> I am developing a scripts that writes a cookie . I wonder if there is a way
> to tell the users if their browser does not support cookie or even not
> enabled.
perhaps you wanted comp.infosystems.www.authoring.cgi.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 15 Feb 1999 18:52:49 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Perl Xbase Module.
Message-Id: <F77Ls1.7B1@news.muni.cz>
On 15 Feb 1999 11:25:23 -0500, Clay Irving <clay@panix.com> wrote:
> In <36c83c01.18453387@news.wxs.nl> pvdkamer@inter.NL.net writes:
>
> >Does anyone know a good Perl-Xbase lib. One that can create and
> >maintain dbf's and indexes ?
>
> Like DBD:XBase?
Well, DBD::XBase doesn't maintain indexes. Having said that, I do not
know about any other Perl solution that would maintain the indexes for
you.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
make vmlinux.exe -- SGI Visual Workstation Howto
------------------------------------------------------------------------
------------------------------
Date: 15 Feb 1999 19:19:24 +0200
From: jari.aalto@poboxes.com (Jari Aalto+mail.perl)
Subject: Re: PFR: read_file, write_file
Message-Id: <ptrlnhzlh43.fsf@olkikukka.i-have-a-misconfigured-system-so-shoot-me>
Marko Schulz <4mschulz@informatik.uni-hamburg.de> writes:
>
> In comp.lang.perl.moderated Uri Guttman <uri@sysarch.com> wrote:
> >
> > here are 2 little favorites of mine which seem to get asked for by all
> > newbies. read a file as a list or a single string and write a file from
> > a list or string.
>
> Ack
>
> > # utility sub to read a file in.
> > # it can return a single string or a list of lines
>
> I would rather write it like this:
>
> use Carp;
> sub read_file {
> my($file_name) = shift;
> my($text, @lines);
> local(*FH);
>
> open(FH, $file_name) or croak "can't open '$file_name' $!";
> @lines = <FH>;
> close(FH);
>
> wantarray() ? @lines : join '',@lines;
> }
I'd write this like this.
jari
# ****************************************************************************
#
# DESCRIPTION
#
# Read all lines from file.
#
# INPUT PARAMETERS
#
# $file File to read
#
# RETURN VALUES
#
# $ or @ Depends on context if return whole file content
# in one string or as separate lines.
#
# ****************************************************************************
# Optimise for latest perl
autouse Carp => qw( croak confess );
sub read_file ($)
{
my $file = shift;
local *FH;
open FH, $file or croak "can't open '$file' $!";
my @lines = <FH>;
close FH;
wantarray() ? @lines : join '', @lines;
}
------------------------------
Date: 15 Feb 1999 11:51:58 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: PFR: read_file, write_file
Message-Id: <x7emnrobip.fsf@home.sysarch.com>
>>>>> "MS" == Marko Schulz <4mschulz@informatik.uni-hamburg.de> writes:
MS> I would rather write it like this:
MS> use Carp;
MS> sub read_file {
MS> my($file_name) = shift;
MS> my($text, @lines);
MS> local(*FH);
MS> open(FH, $file_name) or croak "can't open '$file_name' $!";
MS> @lines = <FH>;
MS> close(FH);
MS> wantarray() ? @lines : join '',@lines;
MS> }
i have had this that way and i think my way is faster for the whole file
slurp. it doesn't need to do a join then. both are legitimate but it is
a style (and maybe speed) preference.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Mon, 15 Feb 1999 14:44:31 -0500
From: James B Crigler <james.b.crigler@lmco.com>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <36C8791F.A8A45849@lmco.com>
Lars Marius Garshol wrote:
>
> * Lars Marius Garshol
> |
> | People in these two newsgroups are mostly fed up with language wars
> | and so I think it's better if we just agree to differ on this.
>
> * aqumsieh@matrox.com
> |
> | I agree too.
>
> Cool! A low-temperature flamewar! :-)
redundant ;-)
--
Jim Crigler
------------------------------
Date: Mon, 15 Feb 1999 11:42:24 -0600
From: "William H. Asquith" <asquith@macconnect.com>
Subject: REGEX $1, $2 ... array?
Message-Id: <7a9mkp$12c@enews2.newsguy.com>
Why isn't there a special array that contains
$1, $2, $3, etc . . . from application of a regex.
This would really make things easier.
------------------------------
Date: Mon, 15 Feb 1999 19:17:39 GMT
From: palfrader@usa.net (Peter Palfrader)
Subject: regexps
Message-Id: <36c871f3.7663869@news.uibk.ac.at>
I hope someone can help me with perl and regexprs..
If I do a regexp search in a string ($str =~ m/regex/gms), I can
determine where the matched string was with the perlfunction
pos($str),
which returns, where the last m//g left off and with $& which is the
matched string, so I have
$startpos = pos($str) - length($&)
If the regex has pairs of parentheses (), I can have the matched
substrings in \1, \2, \3... or $1, $2, $3...
Now my questions:
Is there a way to find out, where these substrings start/end in
the
"big" string ($src)?
How can I found out how many of them actually contain correct
data?
PS: The regex is entered by the user, so I cannot assert its a
string
of the form (...)(...)(...)(...) :(
TIA
--
Weasel mailto:palfrader@writeme.com
Member of the Coder's Guild - http://www.netalive.org/codersguild
Admin at the Coder's Knowledge Base - http://www.netalive.org/ckb
-----------------------------------------------------------------
"With a rubber duck, one's never alone"
-- The Hitchhiker's Guide to the Galaxy
--
Weasel mailto:palfrader@writeme.com
Peter http://www.holidayinfo.com/weasel
Member of the Coder's Guild - http://www.netalive.org/codersguild
Admin at the Coder's Knowledge Base - http://www.netalive.org/ckb
-----------------------------------------------------------------
It is a simple task to make things complex,
but a complex task to make them simple.
------------------------------
Date: Mon, 15 Feb 1999 14:41:44 -0500
From: "Paul J. Sala" <psala@btv.ibm.com>
Subject: String Compare
Message-Id: <36C87877.B0F54B60@btv.ibm.com>
I'm trying to construct a REGX that will determine if
a string contains a character other than
these: a-z A-Z 0-9 @ . _ -
I tried:
if ($MyStr =~
/[\W\@\._-]+/)
{ dosomething; }
else
{ dosomethingelse; }
But it didn't work. Any suggestions.
------------------------------
Date: Mon, 15 Feb 1999 17:49:21 GMT
From: jocke1s@earthling.net
Subject: timetable update script
Message-Id: <7a9mmu$qon$1@nnrp1.dejanews.com>
Hi all,
Anyone know of a script (perl?) that can use the internal clock
to print a text string in a window. Or rather search for a time
(time table for busses,trains etc) and print the ones that are
closest to the current time.
for example: (from a text file with text below)
.
.
.
bus 13 15:38
bus 57 16.34
bus 13 17:12
.
.
.
This should display "Next bus: bus 57 16.34 in 12 min" when the time is
16:22.
Anyone did this? (or something similar?)
(I am pretty new to perl so there might be enough to point me in
the right direction)
ps This should work with X11 on HP-UX unix system
Thanks
JS
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4898
**************************************