[9878] in Perl-Users-Digest
Perl-Users Digest, Issue: 3471 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 18 00:07:36 1998
Date: Mon, 17 Aug 98 21:00:20 -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 Mon, 17 Aug 1998 Volume: 8 Number: 3471
Today's topics:
Re: Anyone ever successfully register some perl code as <mpersico@erols.com>
Re: Automated script execution (EkimicraD)
Re: can "foreach ..." and "while ..." share loop contro (Abigail)
Easy one for you. <cajun@expert.cc.purdue.edu>
Re: Easy one for you. (Kelly Hirano)
Re: Easy one for you. (Bob Trieger)
Re: Easy one for you. (Alastair)
Re: Easy one for you. (Abigail)
Re: Easy one for you. (Abigail)
Re: Easy one for you. (Kelly Hirano)
Re: Easy one for you. (Andre L.)
Re: Enhance Warning meaning, possibly? (Martien Verbruggen)
exception handling (GEMINI)
Re: here's an implementation of diff in perl <mds-resource@mediaone.net>
Re: Outputting Images & Links in HTML (Martien Verbruggen)
Re: pattern matching with uc and lc (Larry Rosler)
Pics from the 1998 Perl Conference josephryan@yahoo.com
Re: problem with activate perl 5.,003_07 PERL_VERSION (Tye McQueen)
Re: problem with Win32::Registry (Tye McQueen)
Re: Problems with file opening (Bob Trieger)
programmer wanted romac9464@my-dejanews.com
Re: Q: How to read all the file name in a directory <upsetter@ziplink.net>
Question: How do I test Perl? richsark@pcav.com
regex word boundary question <paul@partitura.com>
Re: regex word boundary question <jdf@pobox.com>
split Ruined my Life! (was Re: X-file (?=...), case pos (Patrick Timmins)
Re: Splitting numbers? <dean2@mail.biol.sc.edu>
Re: Splitting numbers? <rick.delaney@shaw.wave.ca>
Re: Splitting numbers? (Andre L.)
Re: Strange behavior with 'use' (Martien Verbruggen)
Re: X-file (?=...), case postponed. (Patrick Timmins)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 17 Aug 1998 23:56:03 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Anyone ever successfully register some perl code as an NT service?
Message-Id: <35D8FB53.42121F7B@erols.com>
Hmm. How do we add THIS to the FAQ?
kingm1706@my-dejanews.com wrote:
>
> Use the instsrv.exe and srvany.exe that come with the Windows NT Resource kit
> to install any program (including a PERL app) as a service.
>
> It goes something like this -- go into the directory where your perl code is:
>
> c:\path to file\instsrv YOURPERLCODENAME c:\path to file\srvany.exe
>
> Then, start Registry Editor and look for:
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\YOURPERLCODENAME
>
> Select Edit, New, Key and create a "Parameters" key.
> Select Edit,New,String Value and create the following keys:
>
> Application c:\perl\bin\perl.exe
> AppParameters c:\path to file\yourperlcode.pl
> AppDirectory c:\path to file
>
> Then go to the Control Panel, Services. Find YOURPERLCODENAME, select it, and
> click on Startup.
> Make the Startup type AUTOMATIC and make Log On As: administrator (or another
> user with comparable
> access).
>
> That's the way to do it!
>
> --Michael King
> --VM Online
> --Temecula, CA USA
>
> In article <6r21kd$9k1$1@nnrp1.dejanews.com>,
> malloc@my-dejanews.com wrote:
> > I've got a perl daemon that I would *love* to add as an NT service. I have
> > toyed with the sc.exe utility and the program registered itself as a service,
> > but it will not start. I'm not that keen on programming in the NT environment
> > - it's just not my background - but it looks like it's got to be native win
> > code to run. Is that true? It might be the way I've structured the parameters
> > to sc.exe, but I doubt it b/c I tried ever option and loophole I can think of
> > (including creating a batch file to call my perl daemon). Maybe if I prepare
> > a snippet of C code to just call the perl program? Might that would do it?
> > Anyone ever do anything like this? I would sell my soul for a NT version of
> > "nohup &" right now!!
> >
> > Any input is appreciated,
> > scott
> >
> > -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> > http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
> >
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
--
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're
## supporting the program at 2AM
------------------------------
Date: Tue, 18 Aug 1998 01:19:40 GMT
From: EkimicraD@xxx.xxx (EkimicraD)
Subject: Re: Automated script execution
Message-Id: <35d8d9f3.0@news.wgn.net>
>I can do this via a server-side include, but this requires a rename to
>index.shtml and a dummy index.html to act as a redirector. Is there a way
>of achieving this without resorting to server-side includes?
I have index.shtml on my server, I just erase the index.html file and
the server gets index.shtml on start up instead.
But everyone sets their server up different. Try it see what happens.
------------------------------
Date: 18 Aug 1998 01:39:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: can "foreach ..." and "while ..." share loop control?
Message-Id: <6ram0l$rig$1@client3.news.psi.net>
Robert Lopez (Robert.Lopez@abq.sc.philips.com) wrote on MDCCCXII
September MCMXCIII in <URL: news:jc6zpd3kwl6.fsf@abqn07.ato.sca.philips.com>:
++
++ It worked fine for a while but now the source file has to have some
++ lists added to it that have hundreds of names and are organized like:
++
++ department_2315: evan.adams,bill.anthony,carol.armenta,frank.armstrong,
++ anna.baker,carol.balder,frank.carter,duane.caston.linda.david,
++ ...
++ cindy.williams,ted.vromans
++
++ I was reading the source file into an array and then processing with
++ foreach $line (@my_array) {
++ ...
++ }
++
++ My question is:
++ Inside of the foreach block is there a way to have a sub-block that
++ shares the function of grabbing the next line so it can grab the
++ entire list off of multiple lines?
Yes, but not if you have 'foreach $line (my_array)'.
What would work are:
while (defined ($line = <FILE>)) {
while ($line =~ /,$/) {
$line .= <FILE>; # Assumes no trailing , on last line.
}
....
}
or
while (@my_array) {
$line = shift @my_array;
while ($line =~ /,$/ && @my_array) {
$line .= shift @my_array;
}
...
}
or
foreach (my $i = 0; $i < @my_array; $i ++) {
$line = $my_array [$i];
while ($line =~ /,$/ && $i < @my_array) {
$line .= $my_array [++ $i];
}
...
or you split the file differently:
undef $/;
my $text = <FILE>;
@my_array = split /(?<!,)\n/, $text;
foreach $line (@my_array) {
....
or if the line ending with a comma is followed by a line starting with
white space, and you don't have perl 5.005:
undef $/;
my $text = <FILE>;
@my_array = split /\n(?!\s)/, $text;
foreach $line (@my_array) {
....
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: Mon, 17 Aug 1998 20:11:51 -0500
From: "Jonathan M. Hartman" <cajun@expert.cc.purdue.edu>
Subject: Easy one for you.
Message-Id: <Pine.GSO.3.96.980817200902.291D-100000@expert.cc.purdue.edu>
OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
that has pipes seperating the values. I'd like to just load them into an
array, but I can't figure out the proper syntax for the split function...
The string I am trying to parse looks like the following:
2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd
How can I do this? I have several of these that I am reading from a file,
and want to use a foreach loop to deal with each of them in turn.
-Jon
==============================================================================
||||||||"If you can't take the heat, STAY OUT OF THE FIREWALL!" -Me ||||||||||
==============================================================================
||Out the Token Ring, through the router, down the fiber, off another router,|
||||||||||| down the T1, past the firewall...nothing but Net.|||||||||||||||||
==============================================================================
------------------------------
Date: 17 Aug 1998 18:14:54 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: Easy one for you.
Message-Id: <6rakie$prs@Xenon.Stanford.EDU>
In article <Pine.GSO.3.96.980817200902.291D-100000@expert.cc.purdue.edu>,
Jonathan M. Hartman <cajun@cyberspace.org> wrote:
>OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
>that has pipes seperating the values. I'd like to just load them into an
>array, but I can't figure out the proper syntax for the split function...
>The string I am trying to parse looks like the following:
>
>2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd
>
>How can I do this? I have several of these that I am reading from a file,
>and want to use a foreach loop to deal with each of them in turn.
>
geez, there was just another thread about how to split a comma-delimited
string...
man perl
perldoc -f split
my $line = qq!2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd!;
my @array = split(/|/, $line);
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: Tue, 18 Aug 1998 01:13:28 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Easy one for you.
Message-Id: <6raklf$3vp$1@strato.ultra.net>
[ posted and mailed ]
cajun@cyberspace.org wrote:
-> OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
-> that has pipes seperating the values.
perldoc -f split
perldoc perlre
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Tue, 18 Aug 1998 01:23:23 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Easy one for you.
Message-Id: <slrn6thpi0.4n.alastair@calliope.demon.co.uk>
Jonathan M. Hartman <cajun@expert.cc.purdue.edu> wrote:
>OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
>that has pipes seperating the values. I'd like to just load them into an
>array, but I can't figure out the proper syntax for the split function...
>The string I am trying to parse looks like the following:
>
>2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd
>
>How can I do this? I have several of these that I am reading from a file,
>and want to use a foreach loop to deal with each of them in turn.
>
I bet you're not escaping the '|' character as the split pattern.
This works;
@words = split '\|',$string;
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 18 Aug 1998 02:26:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Easy one for you.
Message-Id: <6raop4$rq2$1@client3.news.psi.net>
Kelly Hirano (hirano@Xenon.Stanford.EDU) wrote on MDCCCXIII September
MCMXCIII in <URL: news:6rakie$prs@Xenon.Stanford.EDU>:
++
++ my $line = qq!2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd!;
++ my @array = split(/|/, $line);
That won't work.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'
------------------------------
Date: 18 Aug 1998 02:27:27 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Easy one for you.
Message-Id: <6raoqf$rq2$2@client3.news.psi.net>
Jonathan M. Hartman (cajun@expert.cc.purdue.edu) wrote on MDCCCXIII
September MCMXCIII in <URL: news:Pine.GSO.3.96.980817200902.291D-100000@expert.cc.purdue.edu>:
++ OK. I'll admit it. I'm a newbie at this. I am trying to parse out a string
++ that has pipes seperating the values. I'd like to just load them into an
++ array, but I can't figure out the proper syntax for the split function...
++ The string I am trying to parse looks like the following:
++
++ 2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd
++
++ How can I do this?
man perlre will tell you. | is special.
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]'
------------------------------
Date: 17 Aug 1998 19:40:27 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: Easy one for you.
Message-Id: <6rapir$39p@Xenon.Stanford.EDU>
In article <6raop4$rq2$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Kelly Hirano (hirano@Xenon.Stanford.EDU) wrote on MDCCCXIII September
>MCMXCIII in <URL: news:6rakie$prs@Xenon.Stanford.EDU>:
>++
>++ my $line = qq!2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd!;
>++ my @array = split(/|/, $line);
>
>That won't work.
>
whoops, my bad. should be:
my @array = split(/\|/, $line);
guess i should actually test my code before posting it. 8^)
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: Mon, 17 Aug 1998 23:00:57 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Easy one for you.
Message-Id: <alecler-1708982300570001@dialup-580.hip.cam.org>
In article <6rakie$prs@Xenon.Stanford.EDU>, hirano@Xenon.Stanford.EDU
(Kelly Hirano) wrote:
> geez, there was just another thread about how to split a comma-delimited
> string...
>
> man perl
> perldoc -f split
>
> my $line = qq!2|WARNINGS|WARNINGS|1600034|sunthu4|arbctprd!;
> my @array = split(/|/, $line);
^^^
geez...
Andre
------------------------------
Date: 18 Aug 1998 03:38:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Enhance Warning meaning, possibly?
Message-Id: <6rasv9$9qb$2@nswpull.telstra.net>
In article <35D58ED8.731F5713@sneex.fccj.org>,
Bill 'Sneex' Jones <sneaker@sneex.fccj.org> writes:
> while($inpData = define(<INPUTFILE>))
while(defined($inpData = <INPUTFILE>))
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 18 Aug 1998 03:26:59 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: exception handling
Message-Id: <6rasa3$102$1@netnews.csie.NCTU.edu.tw>
hi all,
I am designing some modules for my other main programs.
If any error occurred in the modules, an error code can be returned
to notify main program, and I have to check the returned code
everytime I call the subroutines. So is it possible to
have a exeception handling subroutine in the main program,
and let it called by the modules if any error encountered?
thanks.
------------------------------
Date: Mon, 17 Aug 1998 20:42:07 -0500
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Re: here's an implementation of diff in perl
Message-Id: <35D8DBEF.A7BC90C0@mediaone.net>
Nevertheless, "very high probability" and "very good chance" are _not_
necessarily coincident . . .
Lloyd Zusman wrote:
>
> Given the possible set of characters that
> could fill each of the N positions of the lines, there is a very high
> probability that any two arbitrary lines will not match, and there is
> also a very good chance that this non-matchingness will be detected
> after a small number characters of the two lines have been compared.
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely proportional to how much we
think we know. The more I know, the more I know I don't know . . . "
------------------------------
Date: 18 Aug 1998 03:42:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Outputting Images & Links in HTML
Message-Id: <6rat6m$9qb$3@nswpull.telstra.net>
In article <e2yuy2Iy9GA.306@upnetnews05>,
"bon" <TOWER_DENE_EDU@email.msn.com> writes:
> Can anyone please show me how I can include images and links in a script
> that I have found?
Huh?
> Also, is it possible to have dynamically generated images in CGI output?
Oh, you mean 'How do I write a CGI program?'
First of all, you should learn about CGI, and how it operates. A
'page' is not handled by just one connection to the server, but
fetches each embedded item separately. You cannot mix html and images
with one CGI process (note that I didn't say 'program').
You will need to handle the generation of the image and the generation
of the HTML as two different processes.
None of this has anything to do with perl. I've given you a few hints,
so you can go to www.cgi-resources.com, and/or to one of the groups
that talks about this in the comp.infosystems.www.* hierarchy, and
find out about it there. When you have a question that is specific to
perl, you can come back and ask here.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 17 Aug 1998 20:50:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: pattern matching with uc and lc
Message-Id: <MPG.104299c4860705d69897d6@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6rai0g$55s$1@nnrp1.dejanews.com> on Tue, 18 Aug 1998 00:31:12
GMT, julzrulz@my-dejanews.com <julzrulz@my-dejanews.com> says...
> What I am trying to do is take a line,
> split on spaces, put items into an array,
> compare each array item with the items
> in the list. If the item is not found
> Capitalize the first letter, and lowercase
> the rest. If the item is found keep it.
> Problem is when you do the split you get
> CFP, It looks at the word plus the comma,
> ^
...
> @rep = split (/ /, $rep_name);
Try splitting on /, +/ # comma followed by one or more spaces.
> foreach (@rep) {
> next if $list{$_}; # if word matches word in list, keep value
> $_ = ucfirst lc ($_); # capitalize first letter only and replace
> }
> $rep_name = join ' ', @rep;
and joining with ', '
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 18 Aug 1998 00:50:14 GMT
From: josephryan@yahoo.com
Subject: Pics from the 1998 Perl Conference
Message-Id: <6raj46$6pl$1@nnrp1.dejanews.com>
I posted some photos from the 1998 Perl Conference if anyone is interested.
http://www.mdbusiness.com/perl/
Enjoy!
--
Joseph Ryan
Perl Programmer
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 17 Aug 1998 22:37:30 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: problem with activate perl 5.,003_07 PERL_VERSION
Message-Id: <6rastq$e4c@fumnix.metronet.com>
"Leo Liou" <leoliou@pacbell.net> writes:
) "use Win32::Registry" caused error "Win32::Registry 1 required--this is only
) version (undef) at ....". Problem looks like Win32::Registry wants at least
) 5.001 and current perl version is undefined. However, perl -v yields "This
) is perl, version 5.003_07" and perl -e "print $];" yields 5.00307. I am
) lost. What happened? Can anyone help?
You got that backward. It _sounds_ like you actually wrote:
use Win32::Registry 1;
which means you are requiring version 1 or later of Win32::Registry
but Win32::Registry doesn't bother to declare a version number.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 17 Aug 1998 22:35:25 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: problem with Win32::Registry
Message-Id: <6raspt$dmd@fumnix.metronet.com>
"Leo Liou" <leoliou@pacbell.net> writes:
) How does one step through all subkeys and values in a RegsitryObject? What
) are the methods?
You can fetch Win32API::Registry and Win32::TieRegistry from
http://www.perl.com/CPAN/authors/Tye_McQueen/. If you have
a C compiler, then you can use them. If not, you can use the
Win32API::Registry documentation to figure out how to use
the Win32::Registry routines and the Win32::TieRegistry
code to see sample usages.
Note that using C<[]> for NULL won't work with Win32::Registry
and there are a few other mostly minor differences.
I haven't had time to play with Perl5.005 much yet. At some
point these modules should be available to people without C
compilers, perhaps even distributed with ActivePerl.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Tue, 18 Aug 1998 01:25:41 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Problems with file opening
Message-Id: <6ralcc$3vp$2@strato.ultra.net>
[ posted and mailed ]
"Daniel Adams" <dan@fearsome.net> wrote:
-> In my (Perl) CGI script I use $foo to describe a directory path - call it
-> 'a/b/c'
->
-> After a great deal of other stuff (which all works fine) I ask the script to
-> simply create a file 'a/b/c/bar.htm' and then close it without writing any
-> data to the file. Simple, right? So I thought. I am using:
->
-> open(FILE, ">/$foo/bar.htm") || die "I can't create that file\n";
-> close(FILE);
->
-> and the script returns the dreaded "Internal Script Error" when I try
-> running it.
That's the http error. What do the logs say?
What does the $! variable contain?
Use Carp and print the errors to the browser.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Tue, 18 Aug 1998 03:35:10 GMT
From: romac9464@my-dejanews.com
Subject: programmer wanted
Message-Id: <6raspe$jta$1@nnrp1.dejanews.com>
Seeking a very smart programmer w/a BS in Computer Science or equivalent
experience/skills. Must be very strong in C/C++, Java, or Perl. Expertise in
Perl CGI will win you fame, glory, more money, & stock options.
You will write & maintain CGI scripts & other supporting code for websites.
You will be part of small, highly motivated team, & you will be responsible
in a large part for the company's success. Expect to submit samples of your
code & to write a sample routine at the interview.
Please reply to charlie@idealab.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 18 Aug 1998 02:07:42 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <6ranle$c4e@fridge.shore.net>
I R A Aggie <fl_aggie@thepentagon.com> wrote:
: In article <6r9ts9$nj@fridge.shore.net>, Scratchie <upsetter@ziplink.net> wrote:
: +
: + You mean you didn't say "What kind of stupid idiot are you for coming into
: + this course without knowing what a mean is? It's you slobbering
: + wannabe-stats-mongers that are destroying our educational system!!" ???
: He was paying for it, just like I was. That no one bothered to enforce the
: pre-reqs wasn't his fault. Thus why one should be an informed consumer.
What difference does it make whether he's paying for it or not? If
anything, paying for a course and showing up unprepared would make one
*more* deserving of abuse, not less. If he takes up the teacher's time
with FAQs, that means that *you* are not getting *your* money's worth. On
Usenet all you waste is the amount of time it takes you to move on to the
next thread or message.
The issue is not commerce, it is simple politeness. As a daily newsgroup
reader, I find the constant insults a lot more annoying than the constant
FAQs.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 18 Aug 1998 01:08:36 GMT
From: richsark@pcav.com
Subject: Question: How do I test Perl?
Message-Id: <6rak6k$88m$1@nnrp1.dejanews.com>
Hello, I just installed Perl on my Solaris 2.51 box. I would like to know
what the command is to test it. I saw something like "hello World" but I
cannot remember how to type it out. Please send me a copy of your responce
to rich@pcav.com
Thanks
Rich
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 17 Aug 1998 20:41:02 -0500
From: Paul Phillips <paul@partitura.com>
Subject: regex word boundary question
Message-Id: <35D8DBE2.8BED869B@partitura.com>
Hello,
I am reading and studying the "llama" book. (best way to learn, right?)
On page 83, when discussing word boundaries in regular expressions, I
read this:
/\bFred\b/; # matches Fred but not Frederick or alFred
Yes, I understand that, it makes perfect sense. However, the next line
reads:
/\b\+\b/; #matches "x+y" but not "++" or " + "
That does not make sense. As I read it, the first "\b" is a word
boundary, the next "\" escapes the "+" so it is a real plus and not a
multiplier (so there is one "+"), then the final "\b" is again a word
boundary. So to me it matches " + " (space on either side of the plus)
and not the other two choices. Am I dense and missing something here,
or is this a typo in the book?
Thanks...
Paul Phillips
------------------------------
Date: 17 Aug 1998 21:54:35 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: paul@partitura.com
Subject: Re: regex word boundary question
Message-Id: <iujr0zkk.fsf@mailhost.panix.com>
Paul Phillips <paul@partitura.com> writes:
> I am reading and studying the "llama" book. (best way to learn, right?)
Yes. A thousand times yes.
> /\b\+\b/; #matches "x+y" but not "++" or " + "
>
> That does not make sense. As I read it, the first "\b" is a word
> boundary, the next "\" escapes the "+" so it is a real plus and not a
> multiplier (so there is one "+"), then the final "\b" is again a word
> boundary. So to me it matches " + " (space on either side of the plus)
> and not the other two choices. Am I dense and missing something here,
> or is this a typo in the book?
To see if it's a typo, you could quickly write a test script to check
it out. Something like this:
print "Huh. The book's right.\n"
if 'x+y' =~ /\b\+\b/ && ' + ' !~ /\b\+\b/;
The manual (perlre) says this:
A word boundary (\b) is defined as a spot between two characters that
has a \w on one side of it and a \W on the other side of it (in either
order), counting the imaginary characters off the beginning and end
of the string as matching a \W.
There are no \w characters in either "++" or " + ", so clearly neither
of them can have a word boundary. "x" and "y" are both members of \w,
"+" is a member of \W, so therefore \b will match between "x" and "+"
and also between "+" and "y". Capice?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Mon, 17 Aug 1998 15:31:32 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: split Ruined my Life! (was Re: X-file (?=...), case postponed)
Message-Id: <6r9icl$o3d$1@nnrp1.dejanews.com>
Never has so much been done by so many to help so few (me). I hope someone
else learned something as well. It would be a shame to have all that
effort expended, and have me be the only one to benefit from it.
I particlarly want to thank Ronald Kimball and Abigail, who persisted in
their battle to save me from myself, even as I was beginning to get "an
attitude". Your help is truly appreciated, and I will try harder to not be
distracted by irrelevant facts in the future.
I will also keep my eyes peeled for anyone else who slips down the same
slope as myself regarding how split works when you have a PATTERN that
matches the null string.
Again, many thanks.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 17 Aug 1998 20:38:09 -0400
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
To: Greg Flanders <gflan@avalon.net>
Subject: Re: Splitting numbers?
Message-Id: <m3yasnqg3y.fsf@mail.biol.sc.edu>
Greg Flanders <gflan@avalon.net> writes:
> Say I've got a decimal number, and I want to split it into two
> variables, can I use split()? As in
>
> $time = 4.55;
> @splitted = split(/./, $number);
> $minuteTime = @splitted[0];
> $secondTime = @splitted[1];
>
> what am I doing wrong here? Will split not do numbers?
Remember that split() uses a regular expression, so "." matches any
single character (well, technically, any single character except
newline, unless you use the /s modifier to the regexp). Using "\."
would probably be what you want.
You'll probably want to use "$time" in the split clause, rather than
"$number" (just guessing from the fragment above).
Might I suggest a different approach though? The split on the decimal
character is far from robust: what happens if the number is an
integer? I don't know and I'd rather not find out...
If what you want is the integral and fractional parts of the number,
what about:
$time = 4.55;
$minuteTime = int $time;
$secondTime = $time - $minuteTime;
(you'll want to be careful if there is any chance that $time could be
negative).
Hope that's useful...
-Dean
--
N. Dean Pentcheff <pentcheff@acm.org>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: Tue, 18 Aug 1998 01:38:29 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Splitting numbers?
Message-Id: <35D8DC85.250E84EC@shaw.wave.ca>
Greg Flanders wrote:
>
> Say I've got a decimal number, and I want to split it into two
> variables, can I use split()? As in
>
> $time = 4.55;
> @splitted = split(/./, $number);
> $minuteTime = @splitted[0];
> $secondTime = @splitted[1];
>
> what am I doing wrong here?
Well, the first thing you should be doing is using the -w switch.
See perlrun.
This would have told you that $time and $number are only used once in
this program. It would also tell you that you want to use '$', not
'@', to access one scalar element of an array.
See perldata.
If you're going to use a function like split, look it up.
See perlfunc.
You would see that the first argument to it is a regex. If you are
going to use regexes, you should know which characters have special
meanings.
See perlre.
Then you would realize that '.' has a special meaning and you need
@splitted = split(/\./, $time);
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Mon, 17 Aug 1998 23:12:37 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Splitting numbers?
Message-Id: <alecler-1708982312370001@dialup-580.hip.cam.org>
In article
<Pine.LNX.3.96.980817184817.4610A-100000@darwin.xdsl.avalon.net>, Greg
Flanders <gflan@avalon.net> wrote:
> Say I've got a decimal number, and I want to split it into two
variables, can I
> use split()? As in
>
> $time = 4.55;
> @splitted = split(/./, $number);
> $minuteTime = @splitted[0];
> $secondTime = @splitted[1];
>
> what am I doing wrong here?
You are using a past participle that does not exist.
Andre
------------------------------
Date: 18 Aug 1998 03:48:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Strange behavior with 'use'
Message-Id: <6rati8$9qb$4@nswpull.telstra.net>
In article <35D62559.8D3858DC@thegrid.net>,
Casey Lee <sysadmin@thegrid.net> writes:
> I have two files a.pm and b.pm, both are similar and
> they use each other and call functions in each other.
> % perl -e 'use a; &testa()'
> Why isn't it looping around and around forever??
Now, that would be very very bad, wouldn't it?
# perldoc -f use
[snip]
It is exactly equivalent to
BEGIN { require Module; import Module LIST; }
# perldoc -f require
[snip]
Otherwise, demands that a library file be included if it hasn't already
been included.
'if it hasn't already been included.'
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 17 Aug 1998 14:36:31 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <6r9f5f$jt2$1@nnrp1.dejanews.com>
In article <199808161535.LAA04315@coos.dartmouth.edu>,
"Ronald J. Kimball" <rjk@coos.dartmouth.edu> wrote:
[snip]
> Yes, you are absolutely correct about that. However, you are neglecting
> one interesting behavior of split when the pattern matches a null
> string.
>
and
>
> A pattern matching the null string (not to be confused with a null
> pattern //, which is just one member of the set of patterns matching
> a null string) will split the value of EXPR into *separate
> characters* at each point it matches that way.
> [my emph]
>
> > since the perldocs show the matching substring in the delimiter being
> > thrown on to the array where it is encountered, and since we are
> > encountering it right off the bat, it should be thrown on to the
> > array. But instead it is discarded. This is curious, and illogical.
>
> It is curious, but it is not illogical. The substring is not thrown
> into the array because the pattern matches the null string. Thus, there
> is no delimiter before the first character.
[snip]
So split sees that we have a pattern matching the null string, and
this is a special case, as you point out in the documentation cited
above (and as Abigail pointed out in her first post or so). So instead of
beginning it's operation on the null just in front of the 'J' in "Just
another Perl Hacker String\n", this special case will, instead, ignore that
null and begin at the 'J' itself.
Since the split match requires a null that is followed by zero or more of
any characters to operate, and since we are behaving as if there is no null
in front of "Just another Perl Hacker\n" (because of the special case with
splitting on null), then the "#null#Just another Perl Hacker\n" is never
encountered, so it doesn't get thrown on to the array under the
parenthetical substring of the delimiter. This seems logical enough to me,
and so ... oh!
.....
........
........... nevermind.
Patrick Timmins
U. Nebraska Medical Center
--
perl - 'print "Apologies to all for the noise.\n";
print "Thanks to Ronald and Abigail from their difficult student.\n";'
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3471
**************************************