[8115] in Perl-Users-Digest
Perl-Users Digest, Issue: 1733 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 26 17:10:03 1998
Date: Mon, 26 Jan 98 14: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 Mon, 26 Jan 1998 Volume: 8 Number: 1733
Today's topics:
Re: @ == @, comparing arrays (Charles DeRykus)
Re: @ == @, comparing arrays (Chip Salzenberg)
Re: A Type Related Question <rootbeer@teleport.com>
Re: BASE64 Decode <*@qz.to>
Crontab:Automatically Run a Perl Script? safepage@sprynet.com
Re: Crontab:Automatically Run a Perl Script? (Chip Salzenberg)
Re: declarating subroutine prototypes <rootbeer@teleport.com>
Re: do function (works on unix and doesn't on nt?) (Chip Salzenberg)
Re: Evaluating stdin text (Chip Salzenberg)
Re: Evaluating stdin text (Craig Berry)
Re: Finding the missing bracket? <westmj@esvax.dnet.dupont.com>
FIRST, WE KILL ALL THE MIMES. (Chip Salzenberg)
Re: Hotmail Script <rootbeer@teleport.com>
Re: Larry's Quotes <rootbeer@teleport.com>
Re: Localising $. (Chip Salzenberg)
Re: Localising $. <rootbeer@teleport.com>
Re: OS shell in perl to do an FTP <rootbeer@teleport.com>
Perl DB Question <gmac@netcom.ca>
Re: Perl DB Question (Chip Salzenberg)
Re: Problem with hash of hashes (?) <sgordon@athena.lbl.gov>
Re: Simple perl check. <*@qz.to>
Re: substitute... <*@qz.to>
Re: substitute... <rootbeer@teleport.com>
Text::ParseWords vs. Split (Rick Freeman)
Re: What the sys$command ! <rootbeer@teleport.com>
Re: White Hats and Black (John G Dobnick)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 Jan 1998 19:47:13 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: @ == @, comparing arrays
Message-Id: <EnEpMq.7pA@bcstec.ca.boeing.com>
Keywords: hornwort magma pandemic wristband
In article <6ab8qd$gnb$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <En9AuB.L6y@bcstec.ca.boeing.com>,
>Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>>The following array equality test works well for small
>>arrays that don't contain code or anonymous array refs:
>>
>>
>>if (@array1 == @array2 and "@array1" eq "@array2" and
>> "@{[reverse @array1]}" eq "@{[reverse @array2]}") {
>> # arrays are same
>>}
>
>Holy cow. It certainly does not.
>
>@array1 = ("", " ", " ", "");
>@array2 = ("", " ", "", "");
>
>Please let go of this stupid idea before you hurt yourself.
>
>You cannot fix a broken hack by piling two more broken hacks on top of
>it.
For crying out loud, I didn't say "universal, gospel, scientific
truth." I said "works well". In most engineering realms that's
adequate. Sure, you can site some pathological cases, such as
the one above or even another one, such as ("a","a a") and
("a a","a") that'll break this.
But, again, thank you - the qualification needs improvement.
Meanwhile, I'll try not to hurt myself.
--
Charles DeRykus
------------------------------
Date: Mon, 26 Jan 1998 21:09:48 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: @ == @, comparing arrays
Message-Id: <6aiu6f$cr9$1@cyprus.atlantic.net>
Keywords: hornwort magma pandemic wristband
According to ced@bcstec.ca.boeing.com (Charles DeRykus):
>For crying out loud, I didn't say "universal, gospel, scientific
>truth." I said "works well". In most engineering realms that's
>adequate.
Software isn't wiring. In the programming dictionary, the entry
for "almost right" reads "see 'wrong'".
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 12:32:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "V. Chandrasekhar" <vchandra@mail.delcoelect.com>
Subject: Re: A Type Related Question
Message-Id: <Pine.GSO.3.96.980126122752.27056c-100000@user2.teleport.com>
On Mon, 26 Jan 1998, V. Chandrasekhar wrote:
> $time = $time - 0.0; # Line 3
> I do the bogus Line 3 to convert it into a float.
>
> The above seems to work. However, there must be a better
> way than the above to perform type conversions and would
> appreciate input.
Worrying about strings versus numbers in Perl is usually like wondering
whether the land next to the sea is the shore or the coast. :-)
Does your program run any differently if you omit Line 3? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Jan 1998 21:22:23 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: BASE64 Decode
Message-Id: <qz$9801261614@qz.little-neck.ny.us>
The Smiths <smiths@erols.com> wrote:
> Before I write one, I was wondering if a BASE64 decode routine might already
> be available in PERL?
CPAN has one *for* perl (but in C).
Elijah
------
perl -we '$_="anVzdCBhbm90aGVyIG5ldyB5b3JrIHBlcmwgaGFja2VyCg==";
s/.*/eval"use MIME::Base64",decode_base64($&)/e;print;'
------------------------------
Date: Mon, 26 Jan 1998 15:21:41 -0600
From: safepage@sprynet.com
Subject: Crontab:Automatically Run a Perl Script?
Message-Id: <885849239.1477050369@dejanews.com>
Crontab:Automatically Run a Perl Script?
I need to automatically run a perl script using crontab, and have part of
the crontab command but not all of it:
58 23 * * *
I was wondering to automatically run a perl script, would it be as simple
as this:
58 23 * * * /usr/local/etc/httpd/cgi-bin/myscript.pl
Or is there more to it than that?
Help will be greatly appreciated on this...
Thanks,
James
safepage@sprynet.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 26 Jan 1998 21:43:51 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Crontab:Automatically Run a Perl Script?
Message-Id: <6aj062$cv4$1@cyprus.atlantic.net>
According to safepage@sprynet.com:
>I was wondering to automatically run a perl script, would it be as simple
>as this:
>
>58 23 * * * /usr/local/etc/httpd/cgi-bin/myscript.pl
There's nothing about Perl that makes it more or less usable from cron
than any other program.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 11:15:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: declarating subroutine prototypes
Message-Id: <Pine.GSO.3.96.980126110250.27056O-100000@user2.teleport.com>
On Mon, 26 Jan 1998, Chipmunk wrote:
> I've noticed that declaring subroutine prototypes has no effect when the
> declaration is done later in the code than the subroutine call.
As documented in perlsub.
> Why is that?
Because Perl's internal compiler doesn't have ESP. :-) How can perl check
the prototype on foo(1, 2) if you haven't given it the prototype for foo
yet? And consider what a prototype could do to foo(@bar) as well: Perl
can't even compile the call without knowing (or assuming) a prototype.
(Nevertheless, I think that we could make it a -w warnable offense to
define a sub with a proto other than the default (@) after a call to that
sub has been defined.)
The primary purpose for prototypes, as I understand it, is to allow you to
make subs which act like builtins. (Usually, this is done from a module,
which you 'use' at the top of the script.) But you can always call a sub
with other parameters than the proto expects. Doing the call before the
proto is one way to do that.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 20:58:36 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: do function (works on unix and doesn't on nt?)
Message-Id: <6aithb$cpn$1@cyprus.atlantic.net>
According to "Craig A. Keefner" <keefner@kinetic.com>:
>Under NT and 315 perl nothing happens
Well, that about wraps it up for NT.
This isn't a Perl problem, it's a web server and/or configuration problem.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 21:01:23 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Evaluating stdin text
Message-Id: <6aitmf$cqa$1@cyprus.atlantic.net>
According to rsr@best.com (Roy S. Rapoport):
>Now, the perl faq ('How do I unescape a string?' and 'How do I expand
>function calls in a string?') covers this. Sort of. The first
>subject covers very well something like
>
>"This is a line with $i in it", but not
>"This is a line with $i++ in it"
Well, you'd have to come up with a regex that covers all possible
expressions, and I think that's impossible. So maybe your config
file should bracket the expressions somehow:
"This is {{$i++}}"
"This is {{++$i}}"
Then you can do something like this:
s/{{(.*?)}}/$1/gee
Yes, two e's.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: 26 Jan 1998 21:25:30 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Evaluating stdin text
Message-Id: <6aiv0a$qe9$2@marina.cinenet.net>
Roy S. Rapoport (rsr@best.com) wrote:
: I'm trying to do some text parsing on an input text file. Ideally,
: I'd like the textfile to have lines of the form
:
: This is a line with $i things in it
: This is a line with $i++ things in it
: This is another line with $i++ things in it
:
: And, if the perl script defines $i = 0, it should output
: This is a line with 0 things in it
: This is a line with 0 things in it
: This is another line with 1 things in it
[things found in faq snipped]
: The second covers $i++, but not when you're reading it from stdin. I
: need something like "How do I unescape and expadn function calls in a
: string?" I suppose.
Here's a quick and dirty solution. It pulls apart each input line into
its constituent words and shitespace, and tries to eval each token. If
eval returns a defined value, it drops that back into the string;
otherwise, it uses the original text. This requires that each replaceable
thing in the input contain no whitespace; it also goes beyond your spec,
by (e.g.) replacing "15+1" in the input with "16" in the output.
#!/usr/bin/perl -w
# evalit -- evaluates strings from stdin/args, evaling what it can
# in each space-delimited section of text.
# Craig Berry (980126)
while (<>) {
my @parts = split /(\s+)/;
{
# Turn off warnings so we don't have to hear about all
# the barewords.
local $^W;
$^W = 0;
@parts = map { eval || $_ } @parts;
}
my $line = join '', @parts;
print $line;
}
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 26 Jan 1998 20:57:40 GMT
From: Mike West <westmj@esvax.dnet.dupont.com>
Subject: Re: Finding the missing bracket?
Message-Id: <6aitc4$eo5@topgun.es.dupont.com>
In article <Pine.GSO.3.96.980123134723.17597Q-100000@user2.teleport.com>
Tom Phoenix, rootbeer@teleport.com writes:
>
>> I was modifying a fairly big perl script and accidentally missed a
>> right bracket in a subroutine.
>
>> I ended up doing a binary search (inserting a right bracket at a place
>> and compile) to identify the problem.
>>
>> Is there a better way to deal with such a problem?
>
>A programmers' text editor should be able to help you indent code properly
>and to match up braces in pairs. Here's a technique that I like. When perl
>complains that there's a missing right bracket at the end of the file, I
>add one! (Sure, it's probably a mistake, but it's just temporary.) Then I
>ask my editor to find its mate, and it almost always goes straight to some
>construct that wasn't properly terminated.
>
Nice idea.
How do I find the other end with Emacs? (I am stumped...)
Also, if I have a script I want to convert to a nice indent style
like emacs, is there a filter to do so? A way for emacs to take a
shot at it?
I do use BBEdit on a Mac, which I love, but if the other bracket
is farther than a screen away, I do not find it. I can split screens,
but last I checked the other screen does not blink the other bracket.
Regards, Mike West mwest@nyx.net
------------------------------
Date: Mon, 26 Jan 1998 21:41:47 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: FIRST, WE KILL ALL THE MIMES.
Message-Id: <6aj024$cuf$1@cyprus.atlantic.net>
According to Syed Babar <syed.babar@amd.com>:
>--------------D69E269B934A6456D34E20F8
Please do not litter our newsgroup with these hex droppings and
HTML wrappers. Thank you.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 11:44:44 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Walter Archie <warchie@att.net.hk>
Subject: Re: Hotmail Script
Message-Id: <Pine.GSO.3.96.980126114252.27056U-100000@user2.teleport.com>
On Sun, 25 Jan 1998, Walter Archie wrote:
> Okay... This might be asking a lot. But, I am just wondering if there is
> script out there than can do the stuff that hotmail does.
Sure there is. Hotmail has it. :-)
> Please Help me find one. I do not really need but I'd like to know if it
> out there so I do not have take the time make one myself...
There's nothing Perl-specific about your request. That is, the program
you're asking for could be written in nearly any language. So perhaps you
should be looking in a different newsgroup. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 11:42:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Re: Larry's Quotes
Message-Id: <Pine.GSO.3.96.980126114135.27056T-100000@user2.teleport.com>
On Sun, 25 Jan 1998, Jerry Pank wrote:
> In one_of_my_my_many_Perl_books/Faqs/c.l.p.m/ or somewhere else,
> I remember seeing a link to a site with Larry's quotes.
>
> Can't find it now. Would someone shine the torch ?
Try the FAQ again; it's in section one. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 20:55:28 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Localising $.
Message-Id: <6aitb0$cp0$1@cyprus.atlantic.net>
According to neilb@zetnet.co.uk:
>What I'd like to know is will $. range from 1 to n for each
>$file - and will $. range, separately, from 1 to n in the
>subroutine.
I don't know. You already wrote it; why don't you run it and
tell us?
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 12:35:25 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Neil Briscoe <neilb@zetnet.co.uk>
Subject: Re: Localising $.
Message-Id: <Pine.GSO.3.96.980126123331.27056d-100000@user2.teleport.com>
On 26 Jan 1998, Neil Briscoe wrote:
> open(KEYFILE, $file);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 11:57:24 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dave Barstow <deja-jan98-perl@trouser.demon.co.uk>
Subject: Re: OS shell in perl to do an FTP
Message-Id: <Pine.GSO.3.96.980126114558.27056V-100000@user2.teleport.com>
On Mon, 26 Jan 1998, Dave Barstow wrote:
> I need to a UNIX perl code fragment that will ftp a file from another
> machine.
> Any ideas? I don't want to use a .netrc file and I don't want to
> use any extra libaries (such as libnet)
Any advice that I could give would depend upon your reasons: Why do you
wish to avoid using good libraries?
* If you are wanting to do it yourself as a learning experience, then go
DO it! Don't ask us! You'll learn more by debugging it on your own.
:-)
* If you think there's a bug in libnet, fix it!
* If you think you can do the task better than libnet can, go for it!
Then make it into a module and put it on CPAN and earn the gratitude
of everyone who will follow.
* If you don't want to use code that somebody gives to you for free,
then why are you asking for somebody to give you code for free?
* If you aren't sure that libnet will be available on a particular
machine, then bundle it with your code.
* If you're sheepishly realizing that you have no good reason to avoid
libnet and other modules, then just go ahead and use it. We won't hold
this question against you. :-)
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 15:37:31 -0500
From: GM <gmac@netcom.ca>
Subject: Perl DB Question
Message-Id: <34CCF40B.972BDBCC@netcom.ca>
Can someone inform me the most logical way to do this: I have a message
board that parses the input for correctness and then writes to server
from the clients input.
What I wish to do is have either a standard SQL DB or a flat-txt file DB
that contains a listing of "foul words." This would be parsed and
compared to the input from the client to check and see if any potential
foul words are present in his/her input.
Does anyone have a logical efficient way to attack this. I thought of
putting words in a big associatative array and check something like
$hash{'wordtocheck'} exist and use words as keys.
Any information on a logical approach to this situation would be greatly
appreciated.
Thanx
GM
------------------------------
Date: Mon, 26 Jan 1998 21:11:42 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Perl DB Question
Message-Id: <6aiu9u$crt$1@cyprus.atlantic.net>
According to GM <gmac@netcom.ca>:
>What I wish to do is have either a standard SQL DB or a flat-txt file DB
>that contains a listing of "foul words."
Get this out of c.l.p.misc. This isn't a Perl issue.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
-> Ask me about Perl training and consulting <-
"We can shower it with neutrons."
"Or we can do the Neutron Dance!" // MST3K
------------------------------
Date: Mon, 26 Jan 1998 13:18:19 -0800
From: Shawn Gordon <sgordon@athena.lbl.gov>
To: Lars Kellogg-Stedman <lars@bu.edu>
Subject: Re: Problem with hash of hashes (?)
Message-Id: <34CCFD9B.91D8D59A@athena.lbl.gov>
> I've run into a quandry regarding the use of hashes in perl. I've got a
> variable defined something like this:
>
> $somehash{"things"}={"car"=>"red","light"=>"green"};
>
> So, what *is* $somehash{"things"}?
It is a reference to a hash. This is why $somehash{things}{car} works.
You
are really doing: $somehash{things}->{car}.
It is also why 'keys $somehash{things}' does not work. 'keys' expect to
see a hash, not a hash reference. Thus you need to dereference it. ie. :
keys %{$somehash{things}}
>
> Which is why I thought it was a hash in the first place. I've checked
> through the perlfaq4 man page, which wasn't all that helpful, and I've
> tried to find some examples around the 'net to no avail.
Try the perlref.pod documentation. That will give you plenty to chew on.
shawn.
------------------------------
Date: 26 Jan 1998 21:19:55 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Simple perl check.
Message-Id: <qz$9801261549@qz.little-neck.ny.us>
Ed Paquette <ed@ncia.net> wrote:
> I want to check a text file for a given string, if it's found I want it
> to tell me and STOP checking immediately... What is the **FASTEST** way
> to accomplish this?
I don't know if this is fastest, but it is not bad.
#!/uer/bin/perl -w
open(FILE,'</etc/termcap') or die "Help: $!";
while(<FILE>){ next unless /daisy wheel/i; $found=1; last }
if (defined($found)) {
print "We have a winner!\n";
}
__END__
> Basically the equivalent of this /bin/sh snipet:
>
> grep -i "foobar" $filename > /dev/null
> if [ $? -eq 1 ] ; then
> ... Stuff to do when foobar is NOT found in $filename...
> fi
Certainly a lot faster than that, since that will go through the whole
file even if there is a find on the first line. "grep -lqi" would be
a more interesting challenge.
:r! time perl -x %
We have a winner!
real 0m0.18s
user 0m0.16s
sys 0m0.02s
:r!echo 'grep -lqi "daisy wheel" /etc/termcap>/dev/null&&echo "Found"'|time sh
Found
real 0m0.10s
user 0m0.01s
sys 0m0.02s
Those numbers are close, and repeated test will probably be needed for
definitive answers. FWIW:
:r! wc /etc/termcap ; grep -in "daisy wheel" /etc/termcap
10442 46703 434729 /etc/termcap
2712:# There are some ancient printing Qume terminals under `Daisy Wheel
9361:#### Daisy wheel printers
Elijah
------
perl -we '$_="anVzdCBhbm90aGVyIG5ldyB5b3JrIHBlcmwgaGFja2VyCg==";
s/.*/eval"use MIME::Base64",decode_base64($&)/e;print;'
------------------------------
Date: 26 Jan 1998 20:54:56 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: substitute...
Message-Id: <qz$9801261543@qz.little-neck.ny.us>
Keywords: from just another new york perl hacker
Johan Eriksson <nivek@hem2.passagen.se> wrote:
> I just wonder if there is a way to change some characters in a file like
> "\n"(newline) into "<br>". There are certainly some way to do it, but
> since my experience with perl isn't that good yet I haven't figured it
> out.. I suppose I should use s/// but I dont understand how yet...
Did you try "s/\n/<br>/"? What happened?
> Someone who can help me out? Or point me too some further explanations
> about this topic except the perlop....
perlre is good, too. Help teach you the difference between m/\b/ and
m/[\b]/ and what all those /x /i /s /m /e things mean.
Doubtlessly any good book on perl will devote a fair chunk of space to
the s/// operator. Personally I have both editions of the Camel, and
the Hip Owls.
Elijah
------
perl -we '$_="anVzdCBhbm90aGVyIG5ldyB5b3JrIHBlcmwgaGFja2VyCg==";
s/.*/eval"use MIME::Base64",decode_base64($&)/e;print;'
------------------------------
Date: Mon, 26 Jan 1998 12:25:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Johan Eriksson <nivek@hem2.passagen.se>
Subject: Re: substitute...
Message-Id: <Pine.GSO.3.96.980126122401.27056b-100000@user2.teleport.com>
On Mon, 26 Jan 1998, Johan Eriksson wrote:
> I just wonder if there is a way to change some characters in a file like
> "\n"(newline) into "<br>".
> I suppose I should use s/// but I dont understand how yet...
In what way are the existing docs unclear or insufficient for your needs?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 26 Jan 1998 21:07:41 GMT
From: rick@marinweb.com (Rick Freeman)
Subject: Text::ParseWords vs. Split
Message-Id: <34cff9d5.4867146@nntp2.ba.best.com>
Hi all,
I'm reading files consisting of single lines that look like this
fname::rick::lname::smith::age::22::weight::250
and creating hashes.
I'm trying to determine if I should use split or Text::ParseWords. Is
there an advantage to using the module over doing a simple split?
Rick
M a r i n W e b
Marin's Home on the World Wide Web
http://www.marinweb.com/
98 Main Street #453
Tiburon CA 94920
415-458-3201
------------------------------
Date: Mon, 26 Jan 1998 10:49:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Nicholas Jones <nick@namecity.com>
Subject: Re: What the sys$command !
Message-Id: <Pine.GSO.3.96.980126104423.27056N-100000@user2.teleport.com>
On 25 Jan 1998, Nicholas Jones wrote:
> I type "perl -d file.pl" and get debugger output sent to sys$command
> instead of the command line. Have I accidentally set a flag somewhere?
Perhaps one in your system; I've never heard of Perl doing this.
> Also, if I type "t" (i.e. trace) as the first command, I get a
> "segmentation fault" (is this normal?)
It may be normal, but it's not desirable. :-) If you've got the most
recent version properly installed, it's probably a bug which should be
fixed. See if you can make this happen with a small test case - the
smaller the better. If you can reproduce it, perlbug will help you to
report it.
> Further, I've just installed libwww-perl-5.18 along with its
> ancilliaries (libnet etc). I've tried doing a basic "get" URL using
> LWP:Simple.pl but get no HTML returned either on the command line or in
> sys$command...could I have installed libnet incorrectly?
Yes. :-) Or you could have use an incorrect URL, or one to a site which
was down, or which refused your request, or.... If other browsers can
access the site and if LWP passed all tests, but it still can't do this,
you should turn your program into a test and submit it to the LWP
maintainers to see what they make of it. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Jan 1998 20:54:20 GMT
From: jgd@alpha2.csd.uwm.edu (John G Dobnick)
Subject: Re: White Hats and Black
Message-Id: <6ait5s$mjr$1@uwm.edu>
>From article <lcn2gj9lu6.fsf@duncan.cs.utk.edu>, by Myles Barrett Williams <a@b.c.d>:
>
> I predict Netscape will find
> that they can't even give their browser away. It will end up being
> the favorite of hackers, but it's pretty much finished as an end-user
> browser.
Hmmm... just like another "free software package" named Perl? :-)
I'd say Netscape is being _darn_ clever.
--
John G Dobnick "Knowing how things work is the basis
Information & Media Technologies for appreciation, and is thus a
University of Wisconsin - Milwaukee source of civilized delight."
jgd@csd.uwm.edu ATTnet: (414) 229-5727 -- William Safire
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 1733
**************************************