[13877] in Perl-Users-Digest
Perl-Users Digest, Issue: 1287 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 4 21:20:41 1999
Date: Thu, 4 Nov 1999 18:20:30 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941768430-v9-i1287@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 4 Nov 1999 Volume: 9 Number: 1287
Today's topics:
Re: Perl and commonsense part 2 (Abigail)
Re: Perl and commonsense part 2 (David H. Adler)
Re: Perl and commonsense part 2 (Tad McClellan)
Re: Perl and commonsense part 2 (Tad McClellan)
Re: Perl and commonsense part 2 (Ilya Zakharevich)
Re: perl and commonsense (David Jacoby)
Re: Perl Help (Aaron Chrismas)
Re: Perl Help <cassell@mail.cor.epa.gov>
Re: Perl Help <cassell@mail.cor.epa.gov>
Re: Perl Help <rootbeer@redcat.com>
PERL in Windows CE? johnsteele@my-deja.com
Perl script to convert a date to unix time? <tdk@cris.com>
Re: Perl script to convert a date to unix time? <makkulka@cisco.com>
Re: Perl script to convert a date to unix time? <lr@hpl.hp.com>
Re: Perl script to convert a date to unix time? (Abigail)
PERL/CGI Programmer Wanted for Contract Job and Possibl <island@scruznet.com>
Re: problems reading text file <rootbeer@redcat.com>
Re: problems reading text file <cassell@mail.cor.epa.gov>
Record realaudio in perl jomagam@yahoo.com
Re: Record realaudio in perl <rootbeer@redcat.com>
Re: Record realaudio in perl (Kragen Sitaker)
Re: replace " " with <ab@cd.com>
Re: Round off a number <cassell@mail.cor.epa.gov>
Re: search/replace with variables (Tad McClellan)
Re: Special Problem <cassell@mail.cor.epa.gov>
Re: starting a process without waiting (Abigail)
Re: What does HAND mean? <cassell@mail.cor.epa.gov>
Re: Why am I getting an undefined subroutine error? <cassell@mail.cor.epa.gov>
Re: Year 2000 date problem <cassell@mail.cor.epa.gov>
Yet another Perl Sockets question... <NOSPAMbubba@titan.ndhm.gtegsc.com>
Re: Yet another Perl Sockets question... (Kragen Sitaker)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Nov 1999 17:05:15 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Perl and commonsense part 2
Message-Id: <slrn8244gd.dk.abigail@alexandra.delanet.com>
Kragen Sitaker (kragen@dnaco.net) wrote on MMCCLVI September MCMXCIII in
<URL:news:5jjU3.27843$23.1470853@typ11.nn.bcandid.com>:
""
"" I was thinking of F77.
You must have a pretty big keyboard to have an F77....
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Nov 1999 18:34:30 -0500
From: dha@panix.com (David H. Adler)
Subject: Re: Perl and commonsense part 2
Message-Id: <slrn824605.la9.dha@panix.com>
On Thu, 04 Nov 1999 13:31:43 GMT, ajmayo@my-deja.com
<ajmayo@my-deja.com> wrote:
>QUOTE
>
>You are a 'cut and paste' programmer. You should take the time to learn
>perl properly before shooting your mouth off.
>
>UNQUOTE
Unless I missed a post along the line, you appear to need to
investigate the use of the word 'quote'. :-| I find that rather
unfair to the poster.
>No, that is not what I am saying at all. What I should have said (in
>part) was
>
>"my colleagues and I find that what we would regard, rightly or
>wrongly, as common-sense extrapolations - i.e this worked, so to do
>*this*, I do this similar thing - seem to fail more often in perl than
>they do in other languages we use, such as VB,C, Javascript".
That perl is different from VB, C and Javascript (not to mention just
about every other language out there) is not really in question. :-)
In re the "common-sense extrapolations", they do not appear
particularly sensible to me, for what that may be worth. YMMV.
>Now a lot of contributors here would say - guys, you're just too low on
>the bellcurve to grok perl. Why would you expect it to work?. Perl is a
>*real* language, the others are just toys.
I think what the contributors have been saying, for the most part, is
that A)"Common sense" is not a part of computer language design. Any
given language has a set of rules (and, were this not so, said
language would be, for all intents and purposes, useless) - "common
sense" is insufficiently defined and stable to be a basis for
language design. And B) You do not appear to be familiar enough with
perl at this time to have a feel for how it works enough to
instinctively understand its attempts to do what you mean (note the
subtle but important diffence between this and your comment above).
> Computers were invented, not so alpha geek programmers could perfect
> the most efficient string comparison algorithms, but to solve
> real-world problems.
Perhaps. Nevertheless, without said geek programmers, there would be
no functioning computers that others could use for their own purposes.
[snip something about business solutions]
Perl was not designed to facilitate business solutions. It was
designed to facilitate programming. And it was never going to be
something that *everyone* would be comfortable using. If you have
reason to use it, learn how it works (as opposed to how you might
expect it to work from other knowledge) or find some way of avoiding
it while still accomplishing your goals. *shrug*
> Remember, the alpha geeks blaze the trail. Then lesser mortals come
> behind them. They must maintain and modify the code. They don't
> necessarily know syntax from semantics. I know this sounds awful.
Nope. It sounds foolish. If you don't know syntax from semantics
(and I mean that in a way that has nothing to do with whether you use
those terms or "structure and content" or "grammar and meaning"), you
should not be programming. That doesn't mean you can't learn to
program, but I have no idea how you can do that without learning the
syntax of the language in which you're going to do it.
> I know you're itching to say
>This kind of attitude - this kind of unskilled labour - results in
>crappy software. Just look at (insert company here).
>
>I don't deny it. But the problem is, folks, that there aren't enough
>alpha geeks to go around. They can't (yet) be bred to meet
>requirements. Being a top-notch developer is something you're just born
>with, I think. Its like having musical talent. Either you got it, or
>you ain't. So the insatiable demand for developers has to be met,
>sometimes, with people who can't leap over tall buildings in a single
>bound. They sometimes need a bit of a runup, or perhaps the building
>better not be too tall.
So what? You have crappy programmers, you get crappy software. If
you are willing to use people who are lacking in clue to write your
software, you will have to learn to live with the consequenses.
*shrug again*
>How do I explain to these folks that assignments in perl are subtle;
>that perl sometimes returns things in scalar context and sometimes in
>list context - and what the rules are (yes, I know this is explained,
>sort of, in the online help).
Um, by having them read the documentation and helping them with the
details that they find unclear? Sounds good to me. If you can't do
this, perhaps you aren't the one to be explaining it (and, again,
that's not intended as a slight - *I* shouldn't be explaining ballet
to anyone... :-).
> That the peculiar tilde ~ operator (is it an operator, exactly?)
> binds a match operation to the lhs (now, let me remember, was it =~
> or ~=)?.
Well, ~ *is* an operator, but not the binding op. That's =~ - an op
unto itself. You, as well as those hypothetical explainees (and
myself, for that matter) can look these things up when confused -
perlop is only a few keystrokes away...
> That debugging will be a bit painful because you won't get the
> context - just a line number and an error message.
I think this is a bit of an exaggeration. Use of -w and diagnostics,
much like burning airlines, give you so much more. :-) Again, YMMV.
> That you can't take a reference to a list (why not, by the
> way?). And so on.
Because you can't. The language doesn't allow it. I wish you didn't
have to declare variables in C, but that doesn't make it so.
> Then I tried the O'Reilly reference. It is ok, as far as it
> goes. But too much of this stuff assumes you're going to learn
> computer programming with perl as your first language. Gather round,
> children. Now, when you want the computer to do something more than
> once, you use something called a 'loop'... and so on.
Now you have totally lost me. The ORA books explicitly claim to *not*
be for first time programmers.
>Can someone point me at some coherent documentation that brings
>together the perl philosophy assuming I am a competent programmer in
>other languages (I will make the assumption that I *am*, thanks. They
>are still paying me, so I am going to assume my code doesn't stink too
>badly).
Um, the documentation that comes with perl? Works for most people.
If it doesn't work for you, then, well, it doesn't. You can't please
everyone with that sort of thing. I seem to be *shrugging* a lot...
>In particular, documentation absolutely *replete* with examples. Yes,
>cut and paste code. Yes, I know.
I think perhaps you missed the Perl Cookbook.
>"go to CPAN. There's a pile of professionally-commented code. Learn
>from that".
>
>I would, I really would. But life is just too short. The sun will burn
>out.
Again, you've lost me. You ask where to find such things, point out a
good source, then seem to say "but I don't have time for it".
*boggle* (it makes a change from shruging :-)
>Meanwhile, and this is the crux of the issue, I have little choice
>about whether or not to use perl. I pretty much *have* to. This makes
>discussions on the orthogonality of perl rather relevant, I think. It
>is becoming a very pervasive language. Will it prove to be a good tool
>or is it too subtle and clever for its own good, with too many disjoint
>features. Occam once said 'never multiply entities unnecessarily'. In
>perl, I think the entities are starting to get out of hand. What do you
>think?
I think that that is part of the purpose of perl's design. That there
is More Than One Way To Do It. This allows many different people to
code in a way that suits them, rather than being forced to use
constructs that hinder them because there is no other choice.
Also, you do *not* have to use perl. There are many, many other
languages out there - and you claim to know several.
Perl does try to make everyone happy. It cannot actually do this
however, because there are too many differences between the things
that make any two people happy.
Perl works the way it does through much thought, effort and testing.
If it doesn't work for you, then I'm sorry to hear that.
Nevertheless, the examples you've given in these two threads do
nothing to indicate to anyone who has read and thought about perl's
documentation that there is a problem here. You can't take a
reference to a list. Oh well. You can't use a function that is
specifically designed to work with arrays on a hash. Oh well. I made
the screw/nail point earlier, and I think it holds there.
I wish you luck in your further endeavors, though.
best,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Perl should only be studied as a second language. A good first
language would be English. - Larry Wall
------------------------------
Date: Thu, 4 Nov 1999 14:10:41 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl and commonsense part 2
Message-Id: <hnlsv7.f8f.ln@magna.metronet.com>
Kragen Sitaker (kragen@dnaco.net) wrote:
: In article <7vs1s0$mmk$1@nnrp1.deja.com>, <ajmayo@my-deja.com> wrote:
: > That you can't take a reference to a list (why not, by the
: >way?).
: Because lists are expressed values, not denoted values. They can't be
: stored; they just exist temporarily during the execution of statements.
: You can store their contents in arrays. So you can do e.g. [ 1, 2, 3 ]
: to store the list's contents in an array and return a reference to it.
So then, lists are on a runtime stack, and arrays are taken
from a heap?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 4 Nov 1999 14:17:50 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl and commonsense part 2
Message-Id: <u4msv7.f8f.ln@magna.metronet.com>
ajmayo@my-deja.com wrote:
: In article <7vphkm$tap$1@nnrp1.deja.com>,
: ajmayo@my-deja.com wrote:
: I *do* read the Perl books. I *do* read the online documentation. I
: *do* trawl the newsgroups. But what I can't find is documentation that
: is targetted at what makes perl different. My first attempts to learn
: perl centred round Larry's original book with, as I recall, the three
: wise men travelling across the desert laden with frankincense and
: myrrh. Or something like that. It was so insufferably cute that I
: couldn't cope with it. Then I tried the O'Reilly reference. It is ok,
^^^^^^^^^^^^^^^^^^^^^^
What is that?
Is that the name of some real thing?
: as far as it goes. But too much of this stuff assumes you're going to
: learn computer programming with perl as your first language.
Because it has often been lamented here that the only
"good" Perl books assume that you already know how to program.
So I want to find "the O'Reilly reference" so we can point
folks to it the next time the thread comes around.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 5 Nov 1999 01:46:48 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl and commonsense part 2
Message-Id: <7vtcu8$jfh$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tad McClellan
<tadmc@metronet.com>],
who wrote in article <hnlsv7.f8f.ln@magna.metronet.com>:
> : Because lists are expressed values, not denoted values. They can't be
> : stored; they just exist temporarily during the execution of statements.
> : You can store their contents in arrays. So you can do e.g. [ 1, 2, 3 ]
> : to store the list's contents in an array and return a reference to it.
> So then, lists are on a runtime stack, and arrays are taken
> from a heap?
Probably better to say that lists are syntaxic thingies, while arrays
have an associated (long-time) storage.
There are optimizations which avoid creating lists on the Perl stack,
say, @a = (@b, @c). Instead of putting all the SVs of @b and @c on
the stack, AVs for @a and @b are put on the stack, after which
PP_AASSIGN (array-context assign ;-) code special-cases AVs.
Ilya
------------------------------
Date: 5 Nov 1999 01:20:12 GMT
From: jacoby@dynamo.ecn.purdue.edu (David Jacoby)
Subject: Re: perl and commonsense
Message-Id: <7vtbcc$8u3$1@mozo.cc.purdue.edu>
Kragen Sitaker <kragen@dnaco.net> wrote:
>>Array slices aren't lvalues?
>No, they're lists of lvalues or lists of rvalues under normal
>circumstances.
196 jacoby@shay 8:18pm ~/public-web/Work/Javascript % cat test.pl ;
#!/usr/local/bin/perl -w
@list = qw( one two ) ;
@list[1,0,] = @list[0,1] ;
print join "|" , @list , "\n" ;
197 jacoby@shay 8:19pm ~/public-web/Work/Javascript % test.pl
two|one|
198 jacoby@shay 8:19pm ~/public-web/Work/Javascript %
Smells like an lvalue to me, Kragen ;
--
David Jacoby mailto:jacoby@ecn.purdue.edu
Lead Web Technician, ECE http://www.ecn.purdue.edu/~jacoby/
CS Major If at first you dont succeed, you're a programmer
---------------------------------------------------------------
------------------------------
Date: 4 Nov 1999 21:06:47 GMT
From: achrisma@s3.ucf.engr (Aaron Chrismas)
Subject: Re: Perl Help
Message-Id: <slrn823tbk.o2k.achrisma@s3.ucf.engr>
open(OUTPUT, ">anoutputfile.txt");
open(TXTFILE, "yourfile.txt");
while(<TXTFILE>) {
if (regx to match contents) {
#modify contents of $_
print OUTPUT "modified line";
}
else {
print OUTPUT "new line to be added";
}
close(TXTFILE);
close(OUTPUT);
I hope this helps,
Aaron
>
>A>I need a little direction on this. I'm still sort of new to perl programming
>A>and have written some
>A>small simple scripts but this one I'm not real sure how to attack so any
>A>input to web sites, books,
>A>or similar scripts would be appreciated.
>A>
>A>I need to write a script to read a text file search for a specific line if
>A>its there and modify the line.
>A>If the line is not in the text file then I need to add it. Any thoughts?
>
>Alan:
>Point your browser to www.perl.com
>Also, regularly read this newsgroup. A lot of your questions can be
>answered by reading the FAQs posted here, and responses to questions.
>
>HTH
>
>Mike
>
>
------------------------------
Date: Thu, 04 Nov 1999 15:40:58 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Help
Message-Id: <3822198A.E6DB4EF1@mail.cor.epa.gov>
Alan wrote:
>
> All,
>
> I need a little direction on this. I'm still sort of new to perl programming
> and have written some
> small simple scripts but this one I'm not real sure how to attack so any
> input to web sites, books,
> or similar scripts would be appreciated.
You may to read a book like "Learning Perl" by Schwartz and
Christiansen, or "Elements of Programming with Perl" by
Andrew Johnson. The latter may be better if you have no previous
programming experience.
> I need to write a script to read a text file search for a specific line if
> its there and modify the line.
> If the line is not in the text file then I need to add it. Any thoughts?
Yes. This is covered in the FAQ. To find answers to FAQs, use
"perldoc -q" like this: type at a command prompt
perldoc -q append
or
perldoc -q "change a line"
Or you can read it in perlfaq5:
perldoc perlfaq5
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 04 Nov 1999 16:30:17 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Help
Message-Id: <38222519.A73B8544@mail.cor.epa.gov>
[Umm, Aaron, you posted this in the wrong thread. That makes
it a lot harder to find.]
Aaron Chrismas wrote:
>
> open(OUTPUT, ">anoutputfile.txt");
> open(TXTFILE, "yourfile.txt");
Both of these need error-checking. Read about the die() function
and the special $! variable.
> while(<TXTFILE>) {
> if (regx to match contents) {
> #modify contents of $_
Uh-oh. Looks like my previous guess was correct. The part
of your program causing the trouble is most likely in here.
And you forgot to show it to us. So we *still* can't fix it.
> print OUTPUT "modified line";
> }
> else {
> print OUTPUT "new line to be added";
> }
Care to be more specific about these lines also?
As you have this written, won't your program write
"new line to be written" for *every* line of your file
which doesn't match?
> close(TXTFILE);
> close(OUTPUT);
You ought to check the returns on these as well.
> I hope this helps,
Unfortunately, it doesn't help enough. You're going to
have to show us the *real* code. And please cut-and-paste
instead of typing, to minimize the chance of typos.
[big snip of previous post in this thread, which is not the
thread this started in...]
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 4 Nov 1999 16:33:15 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Help
Message-Id: <Pine.GSO.4.10.9911041632160.29670-100000@user2.teleport.com>
On 4 Nov 1999, Aaron Chrismas wrote:
> open(OUTPUT, ">anoutputfile.txt");
> open(TXTFILE, "yourfile.txt");
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: Thu, 04 Nov 1999 23:06:19 GMT
From: johnsteele@my-deja.com
Subject: PERL in Windows CE?
Message-Id: <7vt3h8$hj1$1@nnrp1.deja.com>
Anyone know if PERL (ActiveState) will run under Windows CE?
John
jsteele AT insyte DOT com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 04 Nov 1999 18:38:13 -0500
From: "Kevin J. Bennett" <tdk@cris.com>
Subject: Perl script to convert a date to unix time?
Message-Id: <382218E5.EC090302@cris.com>
Does anyone know of a simple perl script that would accept a date like
3/5/98 and return the unix time in seconds for that date? To me it seems
like it would be a very simple thing to do but I have looked for the
past three days and can't find any direction.
Thanks,
Kevin.
tdk@cris.com
------------------------------
Date: Thu, 04 Nov 1999 15:47:56 -0800
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Perl script to convert a date to unix time?
Message-Id: <38221B2C.41C50F09@cisco.com>
"Kevin J. Bennett" wrote:
> Does anyone know of a simple perl script that would accept a date like
> 3/5/98 and return the unix time in seconds for that date? To me it seems
> like it would be a very simple thing to do but I have looked for the
> past three days and can't find any direction.
From perldoc POSIX
mktime Convert date/time info to a calendar time.
Synopsis:
mktime(sec, min, hour, mday, mon, year, wday = 0, yday
= 0, isdst = 0)
The month (mon), weekday (wday), and yearday (yday)
begin at zero. I.e. January is 0, not 1; Sunday is
0, not 1; January 1st is 0, not 1. The year (year)
is given in years since 1900. I.e. The year 1995 is
95; the year 2001 is 101. Consult your system's
mktime() manpage for details about these and the
other arguments.
Calendar time for December 12, 1995, at 10:30 am.
$time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 );
print "Date = ", POSIX::ctime($time_t);
Returns undef on failure.
==
------------------------------
Date: Thu, 4 Nov 1999 16:21:51 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl script to convert a date to unix time?
Message-Id: <MPG.128bc2fa5be7d74198a1ab@nntp.hpl.hp.com>
In article <382218E5.EC090302@cris.com> on Thu, 04 Nov 1999 18:38:13 -
0500, Kevin J. Bennett <tdk@cris.com> says...
> Does anyone know of a simple perl script that would accept a date like
> 3/5/98 and return the unix time in seconds for that date? To me it seems
> like it would be a very simple thing to do but I have looked for the
> past three days and can't find any direction.
Split the date string into components, then use the timelocal() or
timegm() function. Make sure to read the documentation for localtime()
or gmtime() to understand the semantics of the arguments.
perldoc Time::Local
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Nov 1999 19:35:25 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Perl script to convert a date to unix time?
Message-Id: <slrn824d9t.dk.abigail@alexandra.delanet.com>
Kevin J. Bennett (tdk@cris.com) wrote on MMCCLVI September MCMXCIII in
<URL:news:382218E5.EC090302@cris.com>:
"" Does anyone know of a simple perl script that would accept a date like
"" 3/5/98 and return the unix time in seconds for that date? To me it seems
"" like it would be a very simple thing to do but I have looked for the
"" past three days and can't find any direction.
my $time = 0;
my ($dd, $mm, $yy) = split m{/} => '3/5/98';
foreach my $bit (reverse (0 .. 30)) {
my $ttime = $time + (1 << $bit);
my ($y, $m, $d) = (localtime $ttime) [5, 4, 3];
return $ttime if $y == $yy && $m + 1 == $mm && $d == $dd;
exit if $y == $yy && $m + 1 == $mm && $d == $dd;
$time = $ttime if
$y < $yy || $y == $yy && ($m + 1 < $mm || $m + 1 == $mm && $d < $dd);
}
die "Impossible!\n";
Note that there are usually about 86400 different values that match
a certain date. Which means the following should work too:
my $date = '3/5/98';
local @& = (-1 .. 11);
$date =~ s((?<=/)\d+(?=/))[$&[$&]];
my $time;
{ $time = int rand 1 << 31;
redo unless $date eq join '/' => (localtime $time) [3 .. 5]
}
print $time, "\n";
This can be the fastest method of all!
Abigail
--
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} # Yet Another silly JAPH by Abigail
sub A::FETCH {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 04 Nov 1999 15:34:43 -0800
From: Bruce Ehrlich <island@scruznet.com>
Subject: PERL/CGI Programmer Wanted for Contract Job and Possible Continuing Employment
Message-Id: <2hciODVh=NrDLxHJjVadmsviIGE6@4ax.com>
PERL/CGI Programmer Wanted for Contract Job and
Possible Continuing Employment
I am owner of two web sites which checked out completely during a
migration from one server to another. Both sites are with Best
Internet. The primary site I am concerned about is
http://www.mindmedia.com which is my main business.
There are several old CGI/PERL scripts on the site which need to
continue to work. Also, I am looking for someone who can improve the
site including installing a PERL package.
Please contact me immediately as migration is happening within a few
days.
The Mind Media site has several scripts including a links database, a
shopping cart etc. I have all info for the move and for ongoing
development. This is a great opportunity for someone with PERL/CGI
talents to work for a company with great upside potential. I have been
on the Internet continuously since 1994 and can co-ordinate the work.
My contact information is below. Don't hesitate to call collect if you
need to.
Bruce Ehrlich
President
Mind Media, Inc.
849 Almar Ave. Suite C-125
Santa Cruz, CA 95060
Tel: (831) 426-0762
Fax: (831) 426-8519
mailto:bruce@mindmedia.com
World Wide Web: http://www.mindmedia.com
------------------------------
Date: Thu, 4 Nov 1999 15:26:54 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: problems reading text file
Message-Id: <Pine.GSO.4.10.9911041520120.29670-100000@user2.teleport.com>
On 4 Nov 1999, Aaron Chrismas wrote:
> Somewhere between reading the file or printing out the
> contents of the from within my script. Everything
> between (and including) the brackets is lost. Does
> anyone know of a solution??
You should fix the bug in your program.
If you'd like help in finding it, you could cut your code down to a small,
stand-alone example program. Ideally, it should use no external files and
be shorter than five or ten lines. Then you can post that here and someone
may be able to see the problem.
If you'd like to ask for help without showing anyone your source code,
call PPAL, the Psychic Perl Assistance Line at 1-900-PSYCHO. $999.99/min,
VISA/AMEX/MC/DISCOVER. Must be 18+ or have parent's permission to call.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 04 Nov 1999 15:58:47 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: problems reading text file
Message-Id: <38221DB7.2BC05D19@mail.cor.epa.gov>
Aaron Chrismas wrote:
>
> Hi,
>
> I have a text file which stores a bit of network info
> anThe problem
> is that on of the fields is wrapped by "<....>". For
> example:
>
> A397-13D <G049> 17.2.3A 99Nov03 99Aug02
>
> Somewhere between reading the file or printing out the
> contents of the from within my script. Everything
> between (and including) the brackets is lost. Does
> anyone know of a solution??
Yes. Debugging.
But seriously, you haven't shown any code that might help
anyone with your problem. Can you reproduce this error with
a five-line text file and a 10 or 15-line Perl program?
That may show you the source of your error.. or at least
give us something to work with.
Otherwise, I'll guess that you have a serious bug in
one of your regular expression statements.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 04 Nov 1999 23:13:19 GMT
From: jomagam@yahoo.com
Subject: Record realaudio in perl
Message-Id: <7vt3uc$hu9$1@nnrp1.deja.com>
Hi,
I'd like to write a scripty that records my favorite radio show which is
broadcasted through RealAudio. My biggest hurdle is that I know very
little about RealAudio protocoll other then the fact that it can go
through UPd or TCP or HTTP .... I'd appreciate any help on this matter
as I found that info is very scarce on RealAudio.
Balazs
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 4 Nov 1999 16:35:44 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Record realaudio in perl
Message-Id: <Pine.GSO.4.10.9911041634000.29670-100000@user2.teleport.com>
On Thu, 4 Nov 1999 jomagam@yahoo.com wrote:
> I'd like to write a scripty that records my favorite radio show which
> is broadcasted through RealAudio. My biggest hurdle is that I know
> very little about RealAudio protocoll other then the fact that it can
> go through UPd or TCP or HTTP ....
When you find out about the protocol, then you should be able to implement
it in Perl. But this newsgroup isn't about the protocol, so it would be
off-topic to discuss it here. Perhaps you should search for the protocol
specification. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 05 Nov 1999 01:32:48 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Record realaudio in perl
Message-Id: <4tqU3.29613$23.1538268@typ11.nn.bcandid.com>
In article <Pine.GSO.4.10.9911041634000.29670-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
>On Thu, 4 Nov 1999 jomagam@yahoo.com wrote:
>> I'd like to write a scripty that records my favorite radio show which
>> is broadcasted through RealAudio.
>
>When you find out about the protocol, then you should be able to implement
>it in Perl.
The protocol is a secret, last I heard, and the specification is not
available. As far as I know, therefore, there is no Perl
implementation of the protocol at present, nor a C implementation
easily usable from Perl.
The secrecy of the protocol allows RealNetworks to (a) maintain a
monopoly on RealAudio servers, and (b) incorrectly claim to potentials
server customers that the RealAudio stream cannot be recorded. (You
can, of course, record it as it comes out of your sound card, or as it
goes into your sound driver. If you're using Linux, there's a kernel
patch to help with this.)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 4 Nov 1999 17:24:27 -0600
From: "Blair Heuer" <ab@cd.com>
Subject: Re: replace " " with
Message-Id: <7vt4m7$6co$1@birch.prod.itd.earthlink.net>
In responce to everyone who took the time to help me, thanks.
I originally had used <pre> tags, but it was within a table, and for some
reason would strech the window to the right as far as the text went until a
return was met, so not a good idea. I had to format the text manually to
avoid such problems.
In the end I went with:
$line =~ s/\G / /g;
It works and only uses one line of code (well 3, 2 for the foreach loop).
Once again, thanks. I was overwhelmed by the responce I got for this
question.
-Blair Heuer
------------------------------
Date: Thu, 04 Nov 1999 15:27:40 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Round off a number
Message-Id: <3822166C.A01E6C09@mail.cor.epa.gov>
Frank de Bot wrote:
[snip]
> $round1 = int($string * 1 +0.5) / 1; # 1
> $round2 = int($string * 10 + 0.5) / 10; # 1.23
> $round3 = int($string * 100 + 0.5) / 100; # 1.235
> $round4 = int($string * 1000 +0.5) / 1000; # 1.246
> $round5 = int($string * 10000 + 0.5) / 10000; # 1.2346
> $round6 = int($string * 100000 + 0.5) / 100000; # 1.23457
>
> And so on. You can see it rounds up and down. ( Next decimal = 5 rounds
> up. Else down)
Frank:
[1] Please use the preferred answers in the FAQ to your own
homegrown versions.
[2] This does not appear to be IEEE-compliant - did you check?
[3] Please post your text *after* the parts to which you respond,
otherwise it becomes onerous to maintain a thread.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 4 Nov 1999 14:22:31 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: search/replace with variables
Message-Id: <ndmsv7.f8f.ln@magna.metronet.com>
Scott Stark (sstark@sirius.com) wrote:
: I've got a simple regex replacement using variables:
: $line=~s/$var1/$var2/;
: I've found that if the value of $var1 contains a question mark, the replacement
: isn't done. For example:
: Any idea why this is so?
Yes.
: Is perl interpreting it as a metacharacter?
Hey!
That was my idea...
either:
$var1 = quotemeta($var);
$line=~s/$var1/$var2/;
or
$line=~s/\Q$var1/$var2/;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 04 Nov 1999 15:32:44 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Special Problem
Message-Id: <3822179C.E44C3887@mail.cor.epa.gov>
Frank de Bot wrote:
>
> I'll try to explain this as good as possible.
>
> I've a perl script ( test.pl ) with some HTML anchors. is there a way to
> create a HTTP_REFERER that isn't indentical to the one the browser wants
> to give.
>
> So I click on a link from this page: http://127.0.0.1/test.pl and I'll
> 'land' at otherfile.pl . If I ask for the referer at otherfile.pl I want
> to return to something other.
It still isn't clear what you want. But it sound like more
of a CGI issue than a Perl one. Perhaps you would have better
luck asking in comp.infosystems.www.authoring.cgi instead.
And perhaps spoofing HTTP_REFERER isn't what you really want to
do here. But my PSI::ESP module isn't giving me a clear answer
now.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 4 Nov 1999 17:26:03 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: starting a process without waiting
Message-Id: <slrn8245nd.dk.abigail@alexandra.delanet.com>
David Stiff (dstiff@symantec.com) wrote on MMCCLVI September MCMXCIII in
<URL:news:7vs4ip$cra$1@news2.symantec.com>:
$$
$$ Is it possible to launch a process without Perl waiting for it to complete?
fork and exec. Or use system and put the command in the background.
Details are in perlipc.
$$ I would like to launch an EXE and have the Perl script continue on.
EXE? Hmmm. That suggest you're on a platform where fork doesn't work.
Run it in the background - however that's done on your platform.
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 04 Nov 1999 15:24:30 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: What does HAND mean?
Message-Id: <382215AE.FC13114@mail.cor.epa.gov>
Bart Lateur wrote:
>
> Abigail wrote:
>
> >&& What does HAND mean? I am not familiar with it.
> >
> >
> >It's the piece of meat that connects your fingers to your wrist.
> >
>
> Only meat (er, "flesh")? Yuck.
Yeah, I think Shylock got into some trouble over the distinction
too. Happens all the time.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 04 Nov 1999 15:15:42 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Why am I getting an undefined subroutine error?
Message-Id: <3822139E.E82F7FD1@mail.cor.epa.gov>
Kragen Sitaker wrote:
[big snip]
> As far as perl can tell (at least by attempting to open() it, which is
> what it does on Unix and, I assume, on Windows too), it *is* called
> Net/ping.pm.
>
> This guy is the second one today to report this problem, so I suspect
> he's not lying.
No, he just posted his problem twice. Same guy.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 04 Nov 1999 15:30:26 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Year 2000 date problem
Message-Id: <38221712.1112BAF@mail.cor.epa.gov>
Michel Dalle wrote:
[snip]
> And you think we have troubles ? Here's what Microsoft has
> to say about Y2K problems with JScript :
>
> | What are the Year 2000 Bug problems with JScript?
> |
> | It is very easy to write code which will fail in the year 2000
> | in JScript due to a poor design decision in the Date object.
> | <snip>
>
> You can read the rest of the story at :
Egad, he's turning into Paul Harvey!
> <http://msdn.microsoft.com/scripting/default.
> htm?/scripting/jscript/techinfo/jsfaq.htm>
That URL no longer works. Try:
http://msdn.microsoft.com/workshop/languages/clinic/Y2Kscript.asp
but if you have scripting [JavaScript] turned off, you'll
get referred to a search page. If so, search on 'Javascript'
and 'Y2K' and it will come up.
Voila, the old 'fix it with a pivot value' trick.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 04 Nov 1999 18:24:05 -0500
From: "J.Z. Brody" <NOSPAMbubba@titan.ndhm.gtegsc.com>
Subject: Yet another Perl Sockets question...
Message-Id: <38221595.17D5670@titan.ndhm.gtegsc.com>
Thanx to the people who've responded to my baby steps into socket
programming in perl.
Here another question.
I'm receiving data like:
$socket($buff, 1024); ## 1024 because I don't know how big it is... just
not bigger than 1024
the server that send the data spits out afterwards
print $SOCKET "OK\n";
Here's the question (ready?)...
Why do I get BOTH the data and the OK in $buff? Where is the closure of
the stream? Shouldn't the OK be on the client screen, not in $buff?
(Simple to you maybe...)
-jZb
------------------------------
Date: Fri, 05 Nov 1999 01:41:02 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Yet another Perl Sockets question...
Message-Id: <OAqU3.29631$23.1539346@typ11.nn.bcandid.com>
In article <38221595.17D5670@titan.ndhm.gtegsc.com>,
J.Z. Brody <NOSPAMbubba@titan.ndhm.gtegsc.com> wrote:
>I'm receiving data like:
>$socket($buff, 1024); ## 1024 because I don't know how big it is... just
>not bigger than 1024
I don't understand this code.
#!/usr/bin/perl -w
use strict;
my ($socket, $buff);
$socket($buff, 1024);
. . . gives me:
syntax error at - line 5, near "$socket("
Execution of - aborted due to compilation errors.
So I guess perl doesn't understand it either.
As to receiving data on a socket: in Perl you can receive it in any
size chunks you want. perl will resize the buffer it's receiving into
appropriately. You do have to specify a maximum read size, though.
>the server that send the data spits out afterwards
>print $SOCKET "OK\n";
>
>Here's the question (ready?)...
>Why do I get BOTH the data and the OK in $buff? Where is the closure of
>the stream? Shouldn't the OK be on the client screen, not in $buff?
I don't understand your situation well enough to understand any of
these questions. Can you describe the situation in more detail?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 1287
**************************************