[25636] in Perl-Users-Digest
Perl-Users Digest, Issue: 7878 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 14 09:06:49 2005
Date: Mon, 14 Mar 2005 06:05:23 -0800 (PST)
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, 14 Mar 2005 Volume: 10 Number: 7878
Today's topics:
Re: [perl-python] a program to delete duplicate files <postmaster@castleamber.com>
accessing WMI object's attributes (Martin)
C::Scan module doesn't support old C function defintion <ganesh_tiwari@hotmail.com>
Re: Do you have much use for formats, protos, ties,...? <No_4@dsl.pipex.com>
Re: Do you have much use for formats, protos, ties,...? <phaylon@dunkelheit.at>
Re: FCNTL in perl <vek@station02.ohout.pharmapartners.nl>
Re: How to make a blessable anonymous scalar ref? (Anno Siegel)
Re: How to make a blessable anonymous scalar ref? (Anno Siegel)
Re: How to make a blessable anonymous scalar ref? <abigail@abigail.nl>
Re: How to make a blessable anonymous scalar ref? (Anno Siegel)
Re: How to wrap DBI $sth object? <pilkowsk@informatik.uni-marburg.de>
Make money fast robara0326@hotmail.com
Re: new IO::Socket::INET + UDP/Broadcast = Permission d <a.newmane.remove@eastcoastcz.com>
Re: One Liner to reverse sort file axel@white-eagle.invalid.uk
Re: One Liner to reverse sort file <do-not-use@invalid.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Mar 2005 05:10:35 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: [perl-python] a program to delete duplicate files
Message-Id: <Xns9615EBC3735Acastleamber@130.133.1.4>
David Eppstein wrote:
> In article <1110372973.657649.212920@l41g2000cwc.googlegroups.com>,
> "Xah Lee" <xah@xahlee.org> wrote:
>
>> a absolute requirement in this problem is to minimize the number of
>> comparison made between files. This is a part of the spec.
>
> You need do no comparisons between files. Just use a sufficiently
> strong hash algorithm (SHA-256 maybe?) and compare the hashes.
I did it as follows (some time ago):
is filesize in hash?
calculate md5 (and store), if equal then compare
files.
store info in hash.
In some cases if might be faster to drop the md5 (since it reads all data)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 11 Mar 2005 00:00:12 -0800
From: lbdu597@web.de (Martin)
Subject: accessing WMI object's attributes
Message-Id: <97d1abef.0503110000.7092be0f@posting.google.com>
Hi all,
I'm pretty new to perl and toying around with WMI. Now I stumble upon
accessing the attributes of an WMI object.
The problem is as follows:
I've an object reference to Win32_NetworkAdapterConfiguration called
$objItem.
If I say
print "$objItem->{WINSPrimaryServer}\n";
I get the desired output. But if I say
my $pwins = $objItem->{WINSPrimaryServer};
print "$pwins\n";
I don't get any output.
I also tried dereferencing:
my $pwins = ${$objItem->{WINSPrimaryServer}};
but the result is the same.
Using
print Dumper $objItem1;
I get something like:
$VAR1 = bless( {
'Qualifiers_' => bless( {
'Count' => 4
}, 'Win32::OLE' ),
'Properties_' => bless( {
'Count' => 61
}, 'Win32::OLE' ),
'Methods_' => bless( {
'Count' => 41
}, 'Win32::OLE' ),
'Derivation_' => [
'CIM_Setting'
],
'Path_' => bless( {
........
But I can't find the desired attribute.
Does anybody have an idea, what's going wrong.
Thank,
Martin
------------------------------
Date: 13 Mar 2005 23:06:57 -0800
From: "Gancy" <ganesh_tiwari@hotmail.com>
Subject: C::Scan module doesn't support old C function defintions...
Message-Id: <1110784017.368912.296150@l41g2000cwc.googlegroups.com>
Hi All,
I wanted to parse a C program for function defintions. I checked on
usage of C::Scan perl module, but it does not support old C style
function defintions - something like this..
int func(a,b,c,d)
int a,b;
float c;
char *d;
{
....
....
}
Is there anyway i can parse this to find the defintion. I also tried to
right a regex for this. It does not work in all the cases as C has
very flexible sytax. I can write same func() in different way
int func(a,b,c,d)
int a;
int b;
float c; char *d;
{
}
I could not write a single regex to find a old C style function
defintion. Could anybody give some suggestions to move me in right
direction or a generic regex to do the job.
Thanks
Gancy
------------------------------
Date: Mon, 14 Mar 2005 09:31:42 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Do you have much use for formats, protos, ties,...?
Message-Id: <X9qdnVtJx8FgxKjfRVnysQ@pipex.net>
Big and Blue wrote:
>> 1. formats
>
> I use this is some "quick-information" scripts to wrap output (*and*
> I set the variable which determines where the long line may be split).
I also use it in scripts which format files from a "free-form" nature
to that required for input by a particular program. Since any edits made
to this intermediate copy will be lost at next rebuild I put warning
messages throughout it saying this. Done by setting a relevant header,
then setting the page length to 20 lines.
------------------------------
Date: Mon, 14 Mar 2005 11:30:40 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Do you have much use for formats, protos, ties,...?
Message-Id: <pan.2005.03.14.10.30.39.998167@dunkelheit.at>
kj wrote:
> 1. formats
Nope.
> 2. prototypes
Jap, for any less-complex often-to-use functions.
> 3. operator overloading
Nope.
> 4. tied variables
Only for experimental/debugging. I always have this 'slow'-feeling when
I'm using them.
> I'm curious whether other Perl programmers find these feature useless as I
> do, and if not (as is likely) when do you find any of these features truly
> handy? I.e. what kind of programming task would become for you
> significantly more difficult (or plain less fun) to code if the feature
> were not available?
I would just say every coder has his own favorite "tools".
p
--
http://www.dunkelheit.at/
thou shallst fear...
------------------------------
Date: 11 Mar 2005 08:02:50 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: FCNTL in perl
Message-Id: <slrnd32k57.591.vek@station02.ohout.pharmapartners.nl>
On Thu, 10 Mar 2005 16:28:34 +0100,
Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote:
>> could be able to do that?
>
> That's not much different from how you'd do it in C:
>
> use Fcntl qw/F_NOTIFY DN_CREATE DN_ACCESS/;
>
> $SIG{IO} = sub { print "creation or access happened\n"; };
>
> open DIR, "/tmp/." or die $!;
> fcntl DIR, F_NOTIFY, DN_CREATE|DN_ACCESS or die $!;
>
> # /tmp is now being watched for DN_CREATE and DN_ACCESS
>
What systems supports that?
$ perl -cwe ' use Fcntl qw/F_NOTIFY DN_CREATE DN_ACCESS/;'
"F_NOTIFY" is not exported by the Fcntl module at -e line 1
"DN_CREATE" is not exported by the Fcntl module at -e line 1
"DN_ACCESS" is not exported by the Fcntl module at -e line 1
Can't continue after import errors at -e line 1
BEGIN failed--compilation aborted at -e line 1.
Villy
------------------------------
Date: 14 Mar 2005 08:20:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d13hgq$9he$1@mamenchi.zrz.TU-Berlin.DE>
Peter Scott <Peter@PSDT.com> wrote in comp.lang.perl.misc:
> On Sun, 13 Mar 2005 12:04:11 +0000, J Krugman wrote:
> > Is there a way to get a blessable anonymous ref to a scalar? The
> > typical example of an anonymous scalar ref is something like \3,
> > but if one tries to bless such a ref, the compiler chokes on the
> > "attempt to modify a read-only value".
>
> bless \do { my $foo }, 'Foo';
Why the do{}?
bless \ my $foo, 'Foo';
works just as well.
Anno
------------------------------
Date: 14 Mar 2005 08:23:28 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d13hm0$9he$2@mamenchi.zrz.TU-Berlin.DE>
J Krugman <jkrugman345@yahbitoo.com> wrote in comp.lang.perl.misc:
>
>
>
> [] and {} are blessable anonymous refs. I.e., both
>
> bless [], 'Foo';
>
> and
>
> bless {}, 'Bar';
>
> Is there a way to get a blessable anonymous ref to a scalar? The
> typical example of an anonymous scalar ref is something like \3,
> but if one tries to bless such a ref, the compiler chokes on the
> "attempt to modify a read-only value".
bless \ "$_", 'Foo' for 3;
Anno
------------------------------
Date: 14 Mar 2005 08:47:10 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <slrnd3ajsd.cqe.abigail@alexandra.abigail.nl>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMCCXIII
September MCMXCIII in <URL:news:d13hgq$9he$1@mamenchi.zrz.TU-Berlin.DE>:
() Peter Scott <Peter@PSDT.com> wrote in comp.lang.perl.misc:
() > On Sun, 13 Mar 2005 12:04:11 +0000, J Krugman wrote:
() > > Is there a way to get a blessable anonymous ref to a scalar? The
() > > typical example of an anonymous scalar ref is something like \3,
() > > but if one tries to bless such a ref, the compiler chokes on the
() > > "attempt to modify a read-only value".
() >
() > bless \do { my $foo }, 'Foo';
()
() Why the do{}?
()
() bless \ my $foo, 'Foo';
()
() works just as well.
Without the do, the scalar isn't anonymous - it's known as '$foo'.
The do creates a scope, and the scalar no longer has a name.
Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";
------------------------------
Date: 14 Mar 2005 09:44:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to make a blessable anonymous scalar ref?
Message-Id: <d13me6$d2l$1@mamenchi.zrz.TU-Berlin.DE>
Abigail <abigail@abigail.nl> wrote in comp.lang.perl.misc:
> Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMCCXIII
> September MCMXCIII in <URL:news:d13hgq$9he$1@mamenchi.zrz.TU-Berlin.DE>:
> () Peter Scott <Peter@PSDT.com> wrote in comp.lang.perl.misc:
> () > On Sun, 13 Mar 2005 12:04:11 +0000, J Krugman wrote:
> () > > Is there a way to get a blessable anonymous ref to a scalar? The
> () > > typical example of an anonymous scalar ref is something like \3,
> () > > but if one tries to bless such a ref, the compiler chokes on the
> () > > "attempt to modify a read-only value".
> () >
> () > bless \do { my $foo }, 'Foo';
> ()
> () Why the do{}?
> ()
> () bless \ my $foo, 'Foo';
> ()
> () works just as well.
>
>
> Without the do, the scalar isn't anonymous - it's known as '$foo'.
> The do creates a scope, and the scalar no longer has a name.
Oh, okay...
Usually this happens in a ->new method (under whatever name), whose
body already provides a sufficiently small scope.
Anno
------------------------------
Date: Fri, 11 Mar 2005 06:22:04 +0100
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: How to wrap DBI $sth object?
Message-Id: <MPG.1c9b496a2e7961989898cc@news.individual.de>
* Vito Corleone wrote:
>
> I want to make a module that execute the query and return the $sth in
> wrapped form.
>
> If you don't use the wrapper it would be like this:
> ## no_wrapper.pl
> my $sth = $dbh->prepare("SELECT member_id, item_name FROM item");
> $sth->execute();
> while (my $row = $sth->fetchrow_arrayref()) {
> print $row->[0];
> pirnt $row->[1];
> }
>
> I want to wrap that, so I can write it like below:
> ## with_wrapper.pl
> use Item;
> my $it = Item::->new();
> my $obj = $it->get_items(); ## This return $sth in wrapped form
> while (my $item = $obj->each()) {
> print $item->member_id();
> print $item->item_name();
> ## etc
> }
Eh, what should be your "item": the object which Item->new() returned or
each element *within* this object. Certainly you can find better names
for your variables -- or bundle all these functions in only one wrapper
object (in your example there are three: $it, $obj and $item).
>
> How should I write Item.pm, so it can be used as the wrapper above?
> Could you please give some simple example, as I don't know where to
> start. And thank you in advance.
The following code was simply hacked into my newsreader (at the moment I
have neither a database nor DBI installed). Therefore it is untested.
#!/usr/bin/perl -w
use strict;
# -- Item.pm --
package Item;
sub new {
my $class = shift;
my $dbh = shift;
bless { dbh => $dbh }, $class;
}
sub get_items {
my $self = shift;
my $sql = 'SELECT member_id, item_name FROM item';
$self->{sth} = $self->{dbh}->prepare( $sql );
$self->{sth}->execute;
1;
}
sub each {
my $self = shift;
my $row = $self->{sth}->fetchrow_arrayref;
if ( $row ) {
$self->{ member_id } = $row->[0];
$self->{ item_name } = $row->[1];
return 1;
}
else {
$self->{ member_id } = undef;
$self->{ item_name } = undef;
return undef;
}
}
sub member_id {
my $self = shift;
return $self->{ member_id };
}
sub item_name {
my $self = shift;
return $self->{ item_name };
}
1;
__END__
With that, you can fetch your data without cryptic calls now. However,
this should be a little different from these in your predefined example.
#!/usr/bin/perl -w
use strict;
use DBI;
use Item;
my $dbh = DBI->connect( ... );
my $it = Item->new( $dbh );
$it->get_items();
while ( $it->each() ) {
print $it->member_id();
print $it->item_name();
# ...
}
__END__
regards,
fabian
------------------------------
Date: 10 Mar 2005 21:05:15 -0800
From: robara0326@hotmail.com
Subject: Make money fast
Message-Id: <1110517515.661583.28620@o13g2000cwo.googlegroups.com>
MAKE $6,000 TO $30,000 IN JUST A FEW WEEKS!!!
LEARN HOW TO TURN $6 INTO $6000OR EVEN $60000!!
TURN SIX DOLLARS INTO $6000 EASY AND HONESTLY!!!
READING THIS MESSAGE WILL CHANGE YOUR LIFE FOREVER
: I found this on a bulletin board and decided to try it. A little
: while back, I was browsing through newsgroups, just like you are now,
: and came across an article similar to this that said you could make
: thousands of dollars within weeks with only an initial investment of
: $6.00! So I thought, "Yeah right, this must be a scam", but
: like most of us, I was curious, so I kept reading. Anyway, it said
: that you send $1.00 to each of the 6 names and address stated in the
: article. You then place your own name and address in the bottom of
: the list at #6, and post the article in at least 200 newsgroups.
: (There are thousands) No catch, that was it. So after thinking it
: over, and talking to a few people first, I thought about trying it. I
: figured: "what have I got to lose except 6 stamps and $6.00,
: right?" Then I invested the measly $6.00. Well GUESS WHAT!?...
: within 7 days, I started getting money in the mail! I was shocked! I
: figured it would end soon, but the money just kept coming in. In my
: first week, I made about $25.00. By the end of the second week I had
: made a total of over $1,000.00! In the third week I had over
: $10,000.00 and it's still growing. This is now my fourth week and I
: have made a total of just over $42,000.00 and it's still coming in
: rapidly. It's certainly worth $6.00, and 6 stamps, I have spent more
: than that on the lottery!! Let me tell you how this works and most
: importantly, WHY it works... Also, make sure you print a copy of this
: article NOW, so you can get the information off of it as you need it.
: I promise you that if you follow the directions exactly, that you
: will start making more money than you thought possible by doing
: something so easy!
: Suggestion: Read this entire message carefully! (print it out or
: download it.) Follow the simple directions and watch the money come
: in!
: It's easy. It's legal. And, your investment is only $6.00 (Plus
: postage)
: IMPORTANT: This is not a rip-off; it is not indecent; it is not
: ; and it is 99% no risk - it really works!
: If all of the following instructions are adhered to, you will receive
: extraordinary dividends.
: PLEASE NOTE:
: Please follow these directions EXACTLY, and $50,000 or more can be
: yours in 20 to 60 days. This program remains successful because of
: the honesty and integrity of the participants. Please continue its
: success by carefully adhering to the instructions.
: You will now become part of the Mail Order business. In this business
: your product is not solid and tangible, it's a service. You are in
: the business of developing Mailing Lists. Many large corporations are
: happy to pay big bucks for quality lists. However, the money made
: from the mailing lists is secondary to the income which is made from
: people like you and me asking to be included in that list.
: Here are the 4 easy steps to success:
: STEP 1: Get 6 separate pieces of paper and write the following on
: each piece of paper "PLEASE PUT ME ON YOUR MAILING LIST." Now
: get 6 US $1.00 bills and place ONE inside EACH of the 6 pieces of
: paper so the bill will not be seen through the envelope (to prevent
: thievery). Next, place one paper in each of the 6 envelopes and seal
: them. You should now have 6 sealed envelopes, each with a piece of
: paper stating the above phrase, your name and address, and a $1.00
: bill. What you are doing is creating a service. THIS IS ABSOLUTELY
: LEGAL! You are requesting a legitimate service and you are paying for
: it! Like most of us I was a little skeptical and a little worried
: about the legal aspects of it all. So I checked it out with the U.S.
: Post Office (1-800-725-2161) and they confirmed that it is indeed
: legal. Mail the 6 envelopes to the following addresses:
:
: #1) Jeremy Patrick
: P O Box 570632
: Houston, TX 77257
:
: #2) Palak Patel
: 719 Oak Mill Ct
: Addison, IL 60101
:
: #3) Simon Willis
: 4933 Royal Ct. N.
: West Palm Beach, Fl 33415
:
: #4) Alex Martinez
: 2700 Iowa Ave. #9
: Riverside, CA 92507
:
: #5) William Stewart
: 39 Highland Ave.
: Sicklerville, NJ 08081
:
: #6) Roberto Aramburu
: 5933-1 Longstreet Dr.
: Ft Riley, KS 66442
:
: STEP 2: Now take the #1 name off the list that you see above, move
: the other names up 1 place (#2 becomes #1, #3 becomes #2, etc...) and
add YOUR
: name and address as number 6 on the list.
: STEP 3: Change anything you need to, but try to keep this article as
: close to original as possible. Now, post your amended article to at
: least 200 newsgroups. (I think there are close to 24,000 groups) All
: you need is 200, but remember, the more you post, the more money you
: make! You won't get very much unless you post like crazy. :)
: This is perfectly legal! If you have any doubts, refer to Title 18
: Sec. 1302 & 1341 of the Postal lottery laws.
: Keep a copy of these steps for yourself and, whenever you need money,
: you can use it again, and again.
: PLEASE REMEMBER that this program remains successful because of the
: honesty and integrity of the participants and by their carefully
: adhering to the directions. Look at it this way. If you are of
: integrity, the program will continue and the money that so many
: others have received will come your way.
: NOTE: You may want to retain every name and address sent to you,
: either on a computer or hard copy and keep the notes people send you.
: This VERIFIES that you are truly providing a service. (Also, it might
: be a good idea to wrap the $1 bill in dark paper to reduce the risk
: of mail theft.)
: So, as each post is downloaded and the directions carefully followed,
: six members will be reimbursed for their participation as a List
: Developer with one dollar each. Your name will move up the list
: geometrically so that when your name reaches the #1 position you will
: be receiving thousands of dollars in CASH!!! What an opportunity for
: only $6.00 ($1.00 for each of the first six people listed above) Send
: it now, add your own name to the list and you're in business!
---DIRECTIONS ----- FOR HOW TO POST TO NEWSGROUPS------------
: Step 1) You do not need to re-type this entire letter to do your own
: posting. Simply put your cursor at the beginning of this letter and
: drag your cursor to the bottom of this note, and select 'copy'
: from the edit menu. This will copy the entire letter into the
: computer's memory.
: Step 2) Open a blank 'notepad' file and place your cursor at the top
: of the blank page. From the 'edit' menu select 'paste'. This will
: paste a copy of the letter into notepad so that you can add your name
: to the list. Step 3) Save your new notepad file as a .txt file. If
: you want to do your postings in different settings, you'll always
: have this file to go back to.
: Step 4) Use Netscape or Internet explorer and try searching for
: various newsgroups (on-line forums, message boards, chat sites,
: discussions.)
: Step 5) Visit these message boards and post this article as a new
: message by highlighting the text of this letter and selecting paste
: from the edit menu. Fill in the Subject, this will be the header that
: everyone sees as they scroll through the list of postings in a
: particular group, click the post message on. You're done with
: your first one! Congratulations...THAT'S IT! All you have to do is
: jump to different newsgroups and post away, after you get the hang of
: it, it will take about 30 seconds for each newsgroup! **REMEMBER, THE
: MORE NEWSGROUPS YOU POST IN, THE MORE MONEY YOU WILL MAKE! BUT YOU
: HAVE TO POST A MINIMUM OF 200** That's it! You will begin receiving
: money from around the world within days! You may eventually want to
: rent a P.O.Box due to the large amount of mail you will receive. If
: you wish to stay anonymous, you can invent a name to use, as long as
: the postman will deliver it. **JUST MAKE SURE ALL THE ADDRESSES ARE
: CORRECT.**
: Now,
: each of the 5 persons who just sent me $1.00 make the MINIMUM 200
: postings, each with my name at #5 and only 5 persons respond to each
: of the original 5, that is another $25.00 for me, now those 25 each
: make 200 MINIMUM posts with my name at #4 and only 5 replies each, I
: will bring in an additional $125.00! Now, those 125 persons turn
: around and post the MINIMUM 200 with my name at #3 and only receive 5
: replies each, I will make an additional $625.00! OK, now here is the
: fun part, each of those 625 persons post a MINIMUM 200 letters with
: my name at #2 and they each only receive 5 replies, that just made me
: $3,125.00!!! Those 3,125 persons will all deliver this message to 200
: newsgroups with my name at #1 and if still 5 persons per 200
: newsgroups react I will receive $15,625,00! With an original
: investment of only $6.00! AMAZING! When your name is no longer on the
: list, you just take the latest posting in the newsgroups, and send
: out another $6.00 to names on the list, putting your name at number 6
: again. And start posting again. The thing to remember is: do you
: realize that thousands of people all over the world are joining the
: internet and reading these articles everyday?, JUST LIKE YOU are
: now!! So, can you afford $6.00 and see if it really works?? I think
: so... People have said, "what if the plan is played out and no
: one sends you the money? So what! What are the chances of that
: happening when there are tons of new honest users and new honest
: people who are joining the internet and newsgroups everyday and are
: willing to give it a try? Estimates are at 20,000 to 50,000 new
: users, every day, with thousands of those joining the actual
: internet. Remember, play FAIRLY and HONESTLY and this will really:
CHANGE YOUR LIFE!!!
### MAKE SURE YOU SEND THE MONEY TO THE SIX ADDRESSES LISTED TO GET
STARTED!!!##
------------------------------
Date: Mon, 14 Mar 2005 00:12:38 -0800
From: "Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com>
Subject: Re: new IO::Socket::INET + UDP/Broadcast = Permission denied ?? Why?
Message-Id: <39kvc1F5so2pkU1@individual.net>
Villy Kruse wrote:
> On Wed, 9 Mar 2005 13:20:08 -0800,
> Snail <snail@localhost.com> wrote:
>
>
>> The Following code works fine on my Win32 based system (with the
>> server part running on the Linux system)...
>>
>
>
> Broadcasting needs superuser privileges on unix.
>
>
> Villy
I remember there once being a discussion here (possibler cross-posted to
a unix group or two) some time ago wher someone gave an example of how
to get around that (and hence have portable code.)
Unfortunately, I cannot find this thread, maybe someone remembers how it
was done (or has a link to the thread.)
------------------------------
Date: Mon, 14 Mar 2005 01:43:44 -0600
From: axel@white-eagle.invalid.uk
Subject: Re: One Liner to reverse sort file
Message-Id: <hbudndZprsgt3ajfRVn-rQ@adelphia.com>
xhoster@gmail.com wrote:
> "hogg" <don.hoggatt@pbsg.com> wrote:
>> I was wondering if there was a one liner that would reverse order a
>> file w/o having to write the output to another file. I can reverse
>> order a file using: awk '{printf "%10d\t%s\n",NR,$0}' <FILE> | sort -nr
>> | cut -f2- >> <FILE2>,
> No need for all of that, at least not on modern Linux:
> tac FILE > FILE2
Or for those lacking tac:
% tail -r
Axel
------------------------------
Date: 14 Mar 2005 11:39:06 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: One Liner to reverse sort file
Message-Id: <yzdk6oav7ed.fsf@invalid.net>
axel@white-eagle.invalid.uk writes:
> xhoster@gmail.com wrote:
> > "hogg" <don.hoggatt@pbsg.com> wrote:
> >> I was wondering if there was a one liner that would reverse order a
> >> file w/o having to write the output to another file. I can reverse
> >> order a file using: awk '{printf "%10d\t%s\n",NR,$0}' <FILE> | sort -nr
> >> | cut -f2- >> <FILE2>,
>
> > No need for all of that, at least not on modern Linux:
>
> > tac FILE > FILE2
>
> Or for those lacking tac:
>
> % tail -r
That was a new one for me. It turns out the -r option is not available
everywhere either. HP-UX doesn't have it, for example.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7878
***************************************