[12540] in Perl-Users-Digest
Perl-Users Digest, Issue: 6140 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 27 00:07:32 1999
Date: Sat, 26 Jun 99 21:00:18 -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 Sat, 26 Jun 1999 Volume: 8 Number: 6140
Today's topics:
Re: "Slurping" a .jpg file <rcampbel@gbtech.net>
Re: 'Perl core' or 'perl core'? (Larry Rosler)
Re: 'tr/ / /s; myfile.txt won't work (Abigail)
Re: ASCII character coversion (Abigail)
Re: Command line parameters / Wildcard characters / Rec (I R A Aggie)
Re: Command line parameters / Wildcard characters / Rec <rick.delaney@home.com>
Re: Command line parameters / Wildcard characters / Rec <eman@cc.gatech.edu>
Re: Command line parameters / Wildcard characters / Rec <eman@cc.gatech.edu>
Re: Command line parameters / Wildcard characters / Rec <tchrist@mox.perl.com>
Re: Comparing two associative arrays <rick.delaney@home.com>
Re: FAQ 2.16: Where can I buy a commercial version of P (Philip 'Yes, that's my address' Newton)
Re: FAQs and attitudes (was Re: How can I read a whole (Larry Rosler)
Re: Index of an array-item (Larry Rosler)
Re: Kicking off remote program <smallm@netway.com>
Re: My script works! PLEASE HELP!!! (Larry Rosler)
Re: Read a file starting a a certain point in the middl (Philip 'Yes, that's my address' Newton)
Re: Safe expression evaluation (Abigail)
Re: Unlink == delete files? Why (on earth) is it called (Abigail)
Re: Unlink == delete files? Why (on earth) is it called <aperrin@mcmahon.qal.berkeley.edu>
Re: Very easy integer question (Abigail)
Re: Viral matters [completely off-topic] (Abigail)
Re: Viral matters [completely off-topic] <tchrist@mox.perl.com>
Re: wwwboard on webjump.com (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Jun 1999 03:23:48 GMT
From: "Rich Campbell" <rcampbel@gbtech.net>
Subject: Re: "Slurping" a .jpg file
Message-Id: <01bec04c$6db3cce0$e9dfffcc@upstairs>
Thanks guys - the BINMODE() thing worked like a charm
> I've tried "slurping" the file by:
>
> open(FD, "picture.jpg");
>
> undef $/;
>
> $file = <FD>;
>
> but no go (but it works fine for a .txt file)
>
> --------------
>
> Suggestions (Other than Perlfaq5 - been there)
>
------------------------------
Date: Sat, 26 Jun 1999 18:27:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <MPG.11df1ded76c7d78c989c51@nntp.hpl.hp.com>
In article <x77loyadl6.fsf@home.sysarch.com> on 20 Jun 1999 15:15:01 -
0400, Uri Guttman <uri@sysarch.com> says...
...
> actually you are wrong. larry used the lower case as he was referring to
> the perl core of the binary. i thought it would be more consistant to
> capitalize Perl. hence this thread.
...
> i agree. we are staying inside the Perl core and not executing any perl
> language in the sort function. how the perl binary handles it is
> irrelevent.
After considering the responses, I submitted the paper using 'perl
binary', and Uri hasn't been around to argue with it. The distinction
between 'Perl core' (the language) and 'perl core' (the program) seemed
too elusive.
Thanks to all who advised.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 26 Jun 1999 22:30:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: 'tr/ / /s; myfile.txt won't work
Message-Id: <slrn7nb6lc.npo.abigail@alexandra.delanet.com>
j_a_p@my-deja.com (j_a_p@my-deja.com) wrote on MMCXXIV September MCMXCIII
in <URL:news:7l09p5$87s$1@nnrp1.deja.com>:
== I have written a search engine that looks into a textfile and finds
== prints out the results if found. However my problem is that since I
== converted the text file from excell there are a lot of empty spaces
== after my delimeter (::). I need to remove these spaces but not the
== spaces between the words.
== For Example
==
== text:: text :: text:: text text:: text text text::
== ^ ^ ^ ^ ^
== | | | | |
== remove remove remove remove
== I need to remove all of these spaces. I tried using
== perl -ne 'tr/ / /s;' myfile.txt, but this isn't working. Does anyone
== know what I am doing wrong?
Two things. First, you are using -n without a print, hence you don't get
output. You want -p. Secondly, you are using tr/// while context is
important. Use s///.
perl -pwe 's/:\: +/:\:/g' myfile.txt
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== 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: 26 Jun 1999 22:33:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ASCII character coversion
Message-Id: <slrn7nb6qu.npo.abigail@alexandra.delanet.com>
Steve . (syarbrou@nospam.enteract.com) wrote on MMCXXIV September
MCMXCIII in <URL:news:3773a3c3.5857447@news.enteract.com>:
== I have the character P. I am redoing a program that uses ascii
== conversions was told by the original programmer that the ascii value
== should be 0x50. I get an ord value of 80. What am I missing here?
You are missing the wrong group. This group discusses Perl, not ASCII.
Secondly, you are totally missing what 0x50 actually means.
You're missing quite some computer basics here.
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
-----------== 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: 27 Jun 1999 01:35:46 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <slrn7nb03v.aea.fl_aggie@thepentagon.com>
On Sat, 26 Jun 1999 21:00:56 -0400, Eric Anderson <eman@cc.gatech.edu>, in
<377577C8.9B4AF3BB@cc.gatech.edu> wrote:
+ The problem is that the the shell processes too much.
Unix lovers consider that a feature, not a flaw...
+ Windows shell doesn't do as much (only sends me the *.html) so I can do
+ the same with all the subdirectories.
...and consider this to be a flaw, not a feature.
+ In my case the auto wildcard expansion is a bad thing
In which case, your question is qq|How do I tell the shell "don't
expand wild cards"?| (a question about the shell, not perl)
You might try something like:
real_shell % myProg '*.html'
James
------------------------------
Date: Sun, 27 Jun 1999 02:10:48 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <377587EC.A77A6598@home.com>
[posted & mailed]
Eric Anderson wrote:
>
> Although I appreciate any help I can get for I am only a beginning perl
> writer, but this is not really the type of pointer I was looking for. I
> meant any documention that might talk about this issue, or functions in
> some module I should look at.
perldoc -f -X
perldoc -f opendir
perldoc -f readdir
perldoc -f closedir
perldoc File::Find
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sat, 26 Jun 1999 21:00:56 -0400
From: Eric Anderson <eman@cc.gatech.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <377577C8.9B4AF3BB@cc.gatech.edu>
Tom Christiansen wrote:
>
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc, Eric Anderson <eman@cc.gatech.edu> writes:
> :I want to write a script that runs one both windows and unix. Now when
> :the script is running on windows the wildcard character is not
> :automatically processed
>
> That depends on whether you're running a broken shell or not.
> The default shell is broken. You probably don't want to do that.
> I've heard good things about pdksh.
I'm not quite understanding your message? The problem is that the the
shell processes too much. Windows shell doesn't do as much (only sends
me the *.html) so I can do the same with all the subdirectories. With
Unix the shell it process if for me so I don't can't do the same
processing for the subdirectories when trying to recurse down them. Also
what do you mean by broken. In my case the auto wildcard expansion is a
bad thing but with other programs it would be considered a good thing.
Neither one is broken, but just don't different ways. My problem is with
the unix shell (bash). It is doing to much for me. I think the windows
way is better becuase of this issue, but then again programs like rm and
cp and mv can all do wildcard expansion recursively so there has got to
be some way to do it with Bash since those commands work for me and I
use bash.
> :Now the question is how will the work out under Unix. Since it processes
> :the wildcard characters before I even get it I won't know what wildcard
> :string to use with glob on the subdirectories.
>
> And now you see the fundamental issue. That's part of why the only sane
> thing to do is to bump the common processing up to the run-time system.
Are you saying that the should do the wildcard expansion. My problem is
with that feature. Not really sure what you mean here.
> :Any pointers?
>
> Get a real shell?
Although I appreciate any help I can get for I am only a beginning perl
writer, but this is not really the type of pointer I was looking for. I
meant any documention that might talk about this issue, or functions in
some module I should look at. I cannot expect the users of my script to
use a specific shell just for my program. A program should not be depend
upon a shell. And it should be able to run under such a popular shell as
bash. Any other ideas?
--
Eric Anderson
Computer Science, Georgia Tech
Co-op, Southern Regional Education Board
ICQ# 1279816
------------------------------
Date: Sat, 26 Jun 1999 22:59:23 -0400
From: Eric Anderson <eman@cc.gatech.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <3775938B.375A714C@cc.gatech.edu>
<Message mailed to author and posted to newsgroup - comp.lang.perl.misc>
Tom Christiansen wrote:
> If you follow up with a coherent and well-formed posting to the newsgroup,
> then I shall do what I can to elucidate the fundamental issues regarding
I apoligize for my previous posting. I will try and post a clearer
message this time. Let me try again, hopefully being clearer this time.
The basic issue that I am trying to figure out is how to get around
problems I am having with perl's interaction with various some shells.
Specifically I am trying to figure out if there is a way to get around
the automatic wildcard expansion done by some UNIX shells. Other command
line utilities such as 'rm' can apply a given wildcard string
recursively down directories (such as rm -rf *.html would delete all
'html' files in the current directory and every subdirectory of the
current directory). This would believe me to think that there is some
way around this problem that I am having with these unix shells. If
there is not then that is fine. I will either use other characters to
indicate wildcard characters or require the use of quotes. But if it is
possible, then that would be nicer because that would allow my program
to work in a more consistant style that the other command line utilities
have.
Athough using another shell might be a solution, it is not a solution
that I can use because the requirements for this program is to work
under Win32 (and I would perfer it to work under UNIX also). I cannot
specify the user to use a different shell so I am forced to deal with
this issue in my program. It would seem to me with perl's slant towards
text processing that someone would have had to deal with this issue
before and that is why I posted hoping that a nice solution already
existed. If that is not the case then I will simply use one of the
alternatives that I described above. It may not be as consistant with
the style of other command line utilities as I would like but it is a
solution and in my opinion much better than asking the user to switch
the shell they use to run a single program.
Also thanks for pointing out my problems with my previous post.
Hopefully my future post will be easier to read.
--
Eric Anderson
Computer Science, Georgia Tech
Co-op, Southern Regional Education Board
ICQ# 1279816
------------------------------
Date: 26 Jun 1999 20:08:35 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <377587a3@cs.colorado.edu>
+----------------------------------------------------+
| COURTESY CC OF THIS POSTING MAILED TO CITED AUTHOR |
+----------------------------------------------------+
In comp.lang.perl.misc, Eric Anderson <eman@cc.gatech.edu> writes:
:I'm not quite understanding your message?
You form declarative sentences strangely?
:The problem is that the the shell processes too much.
Wrong.
:Windows shell doesn't do as much (only sends me the *.html) so I can do
:the same with all the subdirectories.
A fundamental design flaw, as I shall perhaps explain presently.
:With Unix the shell it process if for me so I don't can't do the same
:processing for the subdirectories when trying to recurse down them.
If you hope to secure understandable answers, you're going to have to
provide understandable questions. I can't figure out what you mean,
and I absolutely refuse to attempt to decipher what is to all appearances
the random results of a rather retarded Markov chain generator.
Please try again, this time in English.
:Also what do you mean by broken.
I'm a programmer, not a dictionary.
:In my case the auto wildcard expansion is
:a bad thing
No, it's not. Your misunderstanding is a bad thing. Let's not be
confusing the two.
:but with other programs it would be considered a good thing.
:Neither one is broken, but just don't different ways.
Yes, one is broken; and in blazes does the rest of the sentence mean?
Don't you *read* these messages before you actually post them?
:My problem is with
:the unix shell (bash).
:It is doing to much for me.
This time I'll take a guess: your really meant to write "too much" but
neglected to proofread.
:I think the windows way is better becuase of this issue,
Because of *what* issue?
:but then again programs like rm and cp and mv can all do wildcard
:expansion recursively so there has got to be some way to do it with Bash
:since those commands work for me and I use bash.
No, they don't. It's none of their business to process globs.
Rather, they process filenames.
:Are you saying that the should do the wildcard expansion.
How the should I know?
:My problem is with that feature.
Perhaps, but you've not yet painted a picture I can make out.
:Not really sure what you mean here.
Oh, good. It unanimous then.
:> :Any pointers?
:> Get a real shell?
:Although I appreciate any help I can get for I am only a beginning perl
:writer, but this is not really the type of pointer I was looking for.
It is, however, the correct one. However, I suppose I should not expect
you to understand why yet.
:I meant any documention that might talk about this issue, or functions
:in some module I should look at. I cannot expect the users of my script
:to use a specific shell just for my program. A program should not be
:depend upon a shell. And it should be able to run under such a popular
:shell as bash. Any other ideas?
Ask again, this time in English. I completely fail to understand what
your problem even is, largely because you are either unable or unwilling
to produce sentences that I can easily parse. Proofread your work.
If you follow up with a coherent and well-formed posting to the newsgroup,
then I shall do what I can to elucidate the fundamental issues regarding
the handling of arguments, filename globbing, and why CP/M's approach
is inherently broken and wrong -- and provably so as well, in a simple
and straightforward fashion so obvious to all that not even a smidgen of
doubt shall possibly remain in your mind nor in the minds of all who read
that followup. But if you even cannot be bothered to invest sufficient
effort into your news posting so as to allow me and the rest of the
readers of this newsgroup to readily understand what it is you're trying
to do here and why, then you'll get what you deserve; to wit, nothing --
at best. And if you once again send me in private mail the same thing
that you publicly posted to the newsgroup without also including proper
notification of this doubling--perhaps but not necessarily by including
a notification similar to the one I myself have used above in the current
message--then I guarantee that your address shall inexorably and indelibly
find its way into my per-newsgroup killfile, and quite frankly, you will
then be rather less likely to get the answers you haphazardly seek.
You probably think I'm being harsh. Look at this way: You're begging
for free help here. So bloody well work for it!
--tom
--
"A ship then new they built for him/of mithril and of elven glass"
--Larry Wall in perl.c from the v5.0 perl distribution,
citing Bilbo from Tolkien's Lord of the Rings trilogy
------------------------------
Date: Sun, 27 Jun 1999 02:41:02 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Comparing two associative arrays
Message-Id: <37758F05.283DC971@home.com>
[posted & mailed]
Andrew Allen wrote:
>
>
> "@{[%hash1]}" eq "@{[%hash2]}"
>
> almost works (but can you explain why?).
Nope, I give up. Can you? Would you?
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sat, 26 Jun 1999 05:37:25 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: FAQ 2.16: Where can I buy a commercial version of Perl?
Message-Id: <377463a5.126086609@news.nikoma.de>
On 25 Jun 1999 13:03:56 -0700, Tom Christiansen
<perlfaq-suggestions@perl.com> wrote:
>(This excerpt from perlfaq2 - Obtaining and Learning about Perl
> ($Revision: 1.31 $, $Date: 1999/04/14 03:46:19 $)
[...]
> The
> comp.lang.perl.* newsgroups and several of the mailing lists
> provide free answers to your questions in near real-time.
This *does* seem to be what a lot of people expect, doesn't it?
Especially the "free" ("without having to think or--shudder--read the
docs") and "near real-time" ("if I don't get an answer in two hours,
I'll post again; maybe they didn't see it" or "urgent, need this
program by Friday").
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: Sat, 26 Jun 1999 18:38:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: FAQs and attitudes (was Re: How can I read a whole file in one go ?)
Message-Id: <MPG.11df207e5d066137989c52@nntp.hpl.hp.com>
In article <slrn7nas3k.npo.abigail@alexandra.delanet.com> on 26 Jun 1999
19:29:53 -0500, Abigail <abigail@delanet.com> says...
...
> $ cd ~/Src/perl5.005_57/pod
> $ cat *.pod | grep -ci 'billtax'
> 1
> $ cat *.pod | grep -ci 'prisoner of bill'
> 1
> $
I think Randal owes you two Useless Use of Cat Awards for that. Or
perhaps only one. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 26 Jun 1999 19:21:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Index of an array-item
Message-Id: <MPG.11df2a816ba31176989c53@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37752380@cs.colorado.edu> on 26 Jun 1999 13:01:20 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :Cursed to torture myself and others with MicroPlanet Gravity v2.11
>
> For the record, is MicroPlanet Gravity v2.11 non-torturous? You don't
> see to post mutiliated messages the way webbrowsers being abused as
> newsreader do. I'm slightly surprised. Or are you going out of your
> way not to post severely mangled material?
Simple line wrap set at 72 chars. The program does the rest. It also
has a configurable warning about retransmitting quoted lines that are
more than 80 characters.
I (actually HP :-) paid about $30 for this newsreader more than a year
ago, and I've never regretted it. It has far more bells and whistles
than I am interested in (filters, rule-based scoring, ...), excellent
configurability, and excellent tech support.
For me the life-saver is the ability to specify that the database be
kept on a designated drive other than where the program binaries are.
Many Windows programs try to hide that kind of complexity in
installation. I use a shared network drive over a LAN, so I can work
seamlessly with a single netnews database from separate binaries
installed on my office NT workstation and home W95 PC and notebook.
But no, *you* can't use that neat program unless you cough up for one or
more PoB systems, and we *know* that that's never going to happen.
...
> :I don't know how to do this besides using a dumb for-loop linear search
> :with breakout on match, do you?
...
> it's certainly easy enough to ask for the i'th line. But when you want
> to know what value of i has "fred" stored at it, you're in big trouble.
> So you get stuck using a linear (cf line, linear) search algorithm rather
> than one of constant order.
It would appear that that's exactly what I said, linear search.
But the derivation of 'linear' has to do with the equation of a straight
line, y = a * x + b, rather than with searching lines of a file. So
your comparison of line and linear is rather bogus. :-)
> The obvious thing to do is of course:
<SNIP> nice code to create a hash that indexes the lines of a data file.
> So now, given datum X, you can find its indices using @{$data{X}}, and
> given index I, you can find its datum with $line[I]. If you only
> want one of the indices for a given datum, then either use $data{X}[0]
> or else use overwriting in lieu of pushing.
>
> But I'm sure you knew all this, Larry.
Well, yes. I also side with Abigail in regard to not over-generalizing
the value of complicated data-structure setups for simple retrievals.
But I know better than to jump into the middle of that one between the
two of you.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 26 Jun 1999 22:15:44 -0400
From: Mike Small <smallm@netway.com>
Subject: Re: Kicking off remote program
Message-Id: <87vhcawfqn.fsf@elizabeth.netway.com>
There's a utility in the NT resource kit called rcmd.exe that you can
run to do this.
"SfpcC" <scrosby1@nycap.rr.com> writes:
> I want to be able to kick off either a .bat job or .pl program from one NT
> server to another (also WinNT). The far end is complete (checks if tape
--
Mike Small
smallm@netway.com
------------------------------
Date: Sat, 26 Jun 1999 19:28:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: My script works! PLEASE HELP!!!
Message-Id: <MPG.11df2c34c0a907fc989c54@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7l3lfq$4th$1@gellyfish.btinternet.com> on 26 Jun 1999
22:50:34 -0000, Jonathan Stowe <gellyfish@gellyfish.com> says...
> On 26 Jun 1999 17:35:53 -0000 Anno Siegel wrote:
...
> > 1 { my ( $set, $byte, $bit ); # private variables, therefore
> > # ...bare block around
>
> Perl doesnt have line numbers ... it makes it really difficult to cut
> and paste ...
Getting lazy, are we? Use a decent text editor, or sed,
or Perl s/^\d+ //;, or ...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 26 Jun 1999 06:09:37 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Read a file starting a a certain point in the middle
Message-Id: <37746d95.128631874@news.nikoma.de>
On 25 Jun 1999 23:14:57 GMT, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
>Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> wrote:
>>
>>True. However, this does not help the person who knows "$. was 28792
>>at the end of yesterday's run, so I'll just seek to ... errm, what
>>(byte) offset *do* I seek to?"
>
>But why would you remember $. ? The obvious thing to remember is the
>result from tell().
*I* know that. However, the original poster said something about...
lemme see... "pick up from that predetermined line". So I just wanted
to point out that seek() can't pick up from any predetermined line,
only from byte offsets. Using tell() was left as an exercise for the
reader, I suppose.
Maybe I should add that, since the poster talked about IIS, under Win*
you have to keep binmode in mind (e.g. don't seek() to an offset you
got with tell() if one of your accesses used binmode and the other
didn't; don't compute your own value for seek() unless you use
binmode, etc.). Unless I misunderstood something about how binmode and
(seek and tell) affect each other.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: 26 Jun 1999 20:18:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Safe expression evaluation
Message-Id: <slrn7nauuu.npo.abigail@alexandra.delanet.com>
Bart Lateur (bart.lateur@skynet.be) wrote on MMCXXIII September MCMXCIII
in <URL:news:37798e98.4068129@news.skynet.be>:
__ Tom Christiansen wrote:
__
__ >--
__ >If you want to see useful Perl examples, we can certainly arrange to have
__ >comp.lang.misc flooded with them, but I don't think that would help the
__ >advance of civilization. :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>
__
__ "comp.lang.misc"?
Take a popsicle if you can figure out the meaning of the leading 4 digits
in the message ID.
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())))))))))))))))))))))))
-----------== 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: 26 Jun 1999 21:00:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <slrn7nb1d9.npo.abigail@alexandra.delanet.com>
Mats Pettersson (mats.pettersson@falukuriren.se) wrote on MMCXXV
September MCMXCIII in <URL:news:37752DDB.5D596676@falukuriren.se>:
:: Hi!
::
:: After searching for a built in file-delete function in despair, i was
:: surprised (although i probably shouldn't be) to find it in 'unlink'.
::
:: Why such an unlogical name? Does it really delete files (as freeing up
:: disk space), or am i missing something of great importance here?
Yes, understanding of the file system.
In a nutshell: A file can have more than one name. In fact, it can
have no names at all. Unlink()ing a filename removes one of the names
(links) of the file. Only when the last name of the file is removed,
the file is removed from disk (barring open filehandles).
Removal of the file is merely a side effect of unlink a filename. A
common side effect, but it doesn't happen always.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== 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: Sat, 26 Jun 1999 19:43:46 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <37758FE2.75F22A85@mcmahon.qal.berkeley.edu>
Jonathan Stowe wrote:
> On Sat, 26 Jun 1999 14:34:31 -0700 Ook! wrote:
> A) That is artefact
>
err... sorry but according to my dictionary either one is acceptable, and
'artifact' is preferred.
No quarrels, substantively or nit-pickily, with any other part of your post
though....
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting - aperrin@mcmahon.qal.berkeley.edu
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------
------------------------------
Date: 26 Jun 1999 21:08:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Very easy integer question
Message-Id: <slrn7nb1sn.npo.abigail@alexandra.delanet.com>
Cal Bond (cal@spacemoose.com) wrote on MMCXXV September MCMXCIII in
<URL:news:3774E063.29DB@spacemoose.com>:
;; Hi-
;; Could anyone tell me the command/prefix or whatever to get a number from
;; a calculation to be calculated to 2 decimal places. Ive just cut and
;; pasted bits of code in so don't know how to actually change this myself,
;; right now Ive got
;; $blah=int($x/$y)
;; but I'd like it to go to 2 decimals. Thanks lots if you can help me out
$blah = int ($x / $y).".".0.0.0;
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== 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: 26 Jun 1999 21:57:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Viral matters [completely off-topic]
Message-Id: <slrn7nb4p8.npo.abigail@alexandra.delanet.com>
John Thompson (John.Thompson@ibm.net) wrote on MMCXXV September MCMXCIII
in <URL:news:3774D7B2.C8C80DB7@ibm.net>:
<> Dan Carson wrote:
<> >
<> > Unfortunately, "hacking root" is getting more practical all the time. For
<> > some reason, some people want Linux to "compete" with Microsoft. So in the
<> > interest of making Linux "easy to use", the Standard Operating Procedure
<> > is becoming:
<> >
<> > 1. Download anything you see on the net with a '.rpm' extension.
<> >
<> > 2. su root.
<> >
<> > 3. Type rpm -whatever.
<> >
<> > 4. Voila! Something happened! I have no idea what, but whatever it was,
<> > it ran as root!
<> >
<> > Now maybe /bin/ls is suid root and does something in addition to the
<> > standard functionality.
<> >
<> > Am I just being paranoid?
<>
<> That's why many people use pgp signatures with the rpm's
<> they build.
I wasn't aware of that functionality of PGP. Is it only 5.0 that
refuses to sign files that contain viri, or does 2.6.x have that
functionality as well?
Abigail
--
perl -e 'for (s??4a75737420616e6f74686572205065726c204861636b65720as?;??;??)
{s?(..)s\??qq \?print chr 0x$1 and q 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: 26 Jun 1999 21:38:31 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Viral matters [completely off-topic]
Message-Id: <37759cb7@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
abigail@delanet.com writes:
:I wasn't aware of that functionality of PGP. Is it only 5.0 that
:refuses to sign files that contain viri, or does 2.6.x have that
:functionality as well?
VIRI? Look like you didn't read
http://language.perl.com/misc/virus.html
Yet. :-)
--tom
--
"I have many friends who question authority. For some reason most of 'em
limit themselves to rhetorical questions."
--Larry Wall
------------------------------
Date: 26 Jun 1999 21:52:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: wwwboard on webjump.com
Message-Id: <slrn7nb4f5.npo.abigail@alexandra.delanet.com>
luvencl@my-deja.com (luvencl@my-deja.com) wrote on MMCXXV September
MCMXCIII in <URL:news:7l2tob$2dn$1@nnrp1.deja.com>:
?? I am looking for help with placing wwwboard on the webjump.com server.
Then you shouldn't be here. Go ask your sysadmin.
Now, for the return question, why do you have the following header:
References: <3770eb36@cs.colorado.edu> <37712F3E.FECEEB9D@mail.cor.epa.gov> <3771e997.62822881@news.nikoma.de> <3772645C.CC3D8C6B@mail.cor.epa.gov> <377378c6.65950891@news.nikoma.de> <3773BEA4.58DD1F39@mail.cor.epa.gov>
if you don't followup on any of the messages?
Please learn how Usenet works before posting again.
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== 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: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6140
**************************************