[26244] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8429 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 18 00:05:45 2005

Date: Sat, 17 Sep 2005 21:05:03 -0700 (PDT)
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, 17 Sep 2005     Volume: 10 Number: 8429

Today's topics:
    Re: convert $array[0] into $new-array[0,0] <t18_pilot@hotmail.spam.com>
    Re: Customizing the Output of a Sorted Array <hlarons@yahoo.com>
    Re: sorting data - hash vs. list <Fred@fred.net>
    Re: sorting data - hash vs. list <Fred@fred.net>
    Re: sorting data - hash vs. list <matthew.garrish@sympatico.ca>
    Re: sorting data - hash vs. list <sherm@dot-app.org>
        What is "$^O" on Cygwin? <jkeen_via_google@yahoo.com>
    Re: What is "$^O" on Cygwin? <see.sig@rochester.rr.com>
    Re: What is "$^O" on Cygwin? <randy@SpamFree.com>
    Re: What is "$^O" on Cygwin? <jkeen_via_google@yahoo.com>
    Re: What is "$^O" on Cygwin? <see.sig@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 18 Sep 2005 03:23:45 GMT
From: "William Hymen" <t18_pilot@hotmail.spam.com>
Subject: Re: convert $array[0] into $new-array[0,0]
Message-Id: <555Xe.13500$_84.11603@newsread1.news.atl.earthlink.net>

Thanks Jim.

Would the syntax for the split remian
the same? I need to split using the pipe char
as a separator, and I'm not sure what
to place between [] in your example.

My split _was_ split(/\|/ , $entry);

thanks,

Bill

"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
news:1126977725_3969@news-west.n...
> On 2005-09-17 06:22:59 -0700, "William Hymen"
> <t18_pilot@hotmail.spam.com> said:
>
> > All,
> >
> > I have a pipe-delimited text file which I pull
> > into a one-dimensional array, then scan thru with
> > the split command. How would I convert this
> > into $twoDIM[$i,$j] so I only have to read
> > and split the file just once.
> >
> > Thanks in advance.
> >
> > Bill
> >
> > @infiledata = <INFILE>;
> > foreach $entry (@infiledata) {
> > @entry_parts = split(/\!/ , $entry);
> > #
> > # Split into about 20 variables per line
> > #
> > $one  = @entry_parts[0];
> > $two  = @entry_parts[1];
> > $three = @entry_parts[3];
> > #
> > # etc until done, then test and do something on $field
> > #
> > }
>
> No need to slurp the whole file into memory just to store the records
> into a 2-dimensional array. This may be what you are looking for:
>
> my @entry_parts;
> while(<INFILE>) {
>   push( @entry_parts, [ split ]);
> }
>
> After this, you can access the data in field 3 of row 5, for example,
> as $entry_parts[5][3].
>
> --
> Jim Gibson
>




------------------------------

Date: Sat, 17 Sep 2005 18:33:08 -0000
From: HaroldWho <hlarons@yahoo.com>
Subject: Re: Customizing the Output of a Sorted Array
Message-Id: <slrndiooad.th.hlarons@Beagle.mylocal.net>

On Fri, 16 Sep 2005 18:22:09 -0000, HaroldWho wrote in comp.lang.perl.misc:
> '@sorted' contains lines of text, space-delimited and sorted on the first
> field and then on others. Some lines have duplicate first fields.
>
> How can I emphasize the lines with duplicate first fields during output;
> e.g., by indenting them or with leading asterisks?

Sincere thanks to Eric Schwartz, xhoster@gmail.com and William James for
your suggestions. They sure beat the kludge I was working on.

Just when I think I speak perl, folks like you come along to show me what
it's all about. Thanks again.

HW
-- 
Powered by SuSE Linux 9.0 -- Kernel 2.6.11
News Reader slrn 0.9.8.1




------------------------------

Date: Sat, 17 Sep 2005 17:39:13 -0500
From: "Fred@fred.net" <Fred@fred.net>
Subject: Re: sorting data - hash vs. list
Message-Id: <ip5pi1lsk2od557qdi6p8iart5n6t7e5v9@4ax.com>

On Fri, 16 Sep 2005 20:31:42 -0500, Tad McClellan <tadmc@augustmail.com> wrote:

>Fred@fred.net <Fred@fred.net> wrote:
>> On Fri, 16 Sep 2005 04:08:21 GMT, "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>>>"Fred@fred.net" <Fred@fred.net> wrote in
>>>news:sc3ki1lka0o2ub8v6sodndmu1n2ltijjbb@4ax.com: 
>
>> I have already deviated from my intention.
>
>
>That's what trolls do.

I always thought "trolls"attempted to "bait" people into dicussions
that umtimately turned into flames.
I'm sorry, I'g going to "Trolls Anonymous" right away where
I shall introduce myself as "Greetings, My name is Fred and I'm a troll." and everyone
will say "Hi Fred."
And I will pratter about how I didn't know I was a Troll at 
first, but I was outed by Tad on c.l.p.m Then everyone will
pat me on the knee and speak of how "cruel" and  "mean" others can be.

You ever just disagree with something and will be damnned if you'll do it? I have
made the point here, not refuted, that "out of form" posts here have and continue
to yeild very useful information.

>
>>>> Other usenet groups are more "relaxed". 
>>>
>>>So?
>> So why not? I posted 1 time to alt.engineering.electrical 
>
>
>The alt.* hierarchy is much closer to anarchy than a Big 8 newsgroup.

What's a Big 8 newgroup? And I disagree about the anarchy
thing, the group I referred to had (go look at it.) really well
formed subjects and all posts had replies. Not smart
ass replies, but, heck just go look.
>
>Maybe you are looking for the alt.perl newsgroup?
>
>
>> if there was a way to tell, how much electricity a AC window unit was using.
>> I got tons of expert replies and they were all gentlemen about it. 
>> I was definitely off-topic.
>
>
>That doesn't sound off-topic at all to me.
See I can't get it right.

>
>>>I find Ruby interesting, too. 
>
>
>You should abandon Perl and its community of Nazis immediately
>and use Ruby for all of your future programming.

Well, thanks for the advice, but I like perl, and as indicated,
I seldom post here, mostly just search it.

Regards,
Fred


------------------------------

Date: Sat, 17 Sep 2005 18:07:05 -0500
From: "Fred@fred.net" <Fred@fred.net>
Subject: Re: sorting data - hash vs. list
Message-Id: <as6pi1duq171dqncuv38u58uc928voil6n@4ax.com>

On Fri, 16 Sep 2005 20:54:55 -0400, Sherm Pendley <sherm@dot-app.org> wrote:

>"Fred@fred.net" <Fred@fred.net> writes:
>
>> I mean you all act as if, were
>> it not for such tight guidlines, the group would be awash with
>> erroneous posts
>
>You've got it precisely backwards. The guidelines were established as a way
>to help restore order and bring the signal to noise ratio back to sanity,
>after the group found itself awash with erroneous posts.
>
>> and yet you never consider... WHO-TF 
>> would be interested in this group, save someone interested in perl.
>
>Someone who's looking for a "please write my code for me" service.
I'm a little guilty of that, but mainly for ideas. I mine this group exstensively.
>
>Someone who needs help configuring a script, and thinks this might be a good
>place to ask, since the script happens to be written in Perl.
Gently suggest they hire a consultant.
>
>Someone with an HTML question, because the HTML happens to be printed by a
>Perl script.
The occasional idiot.
>
>Someone with a question about operating their web browser, because that's
>what they happen to be using to view the HTML that happens to be printed
>by a Perl script.
Wow and ain't there a bunch of those!
>
>Someone with a question about knitting, because they can't spell and don't
>know the difference between purl and Perl.
That's funny!
>
>Someone who has a PHP question, because their brother-in-law's cousin - the
>one that's "really good with the interweb" - told them that PHP and Perl
>are the same thing.
Just ignore.
>
>Someone who thinks that the correct answer to every Perl question is "use
>my favorite trendy language of the month instead."
Advocates... just ignore them. perl doesn't need defending.
>
>Someone with a question about how to operate their news reader, because this
>happens to be the group that appeared when the clicked around at random.
Bet you get a lot of that!
>
>... and hundreds of other trolls, flamers, and flat-out lunatics whose
>comments and questions have f**k-all to do with Perl. The guidelines exist
>for a damn good reason, so that the people who come here who *are* interested
>in Perl can hear and be heard, instead of being drowned out in all the noise.
>
>The old-timers here have seen, first-hand, what happens without guidelines.
>It drove some of Perl's best and brightest - Larry Wall and Tom Christiansen,
>to name two - to give up on the group entirely, because it felt like trying
>to discuss particle physics while standing in the middle of a crowd of fifty
>screaming two-year-olds.
I don't quite see it that way. I just don't see as much "noise" here are you imply.
I don't see why you just don't ignore the message "Pleez Help! I need my cgi fixed." we ain't
short on bandwidth anymore. Who cares? For Linux guys it'd be trivial to filter a whole
c.l.p.m dictionary filled with key words to ignore. (In headers) They already have that I'm sure.
>
>The group guidelines can be condensed into four simple words: Behave like an
>adult. Some people can't or won't do that, and frankly I think this group is
>better off without those people.
That's a joke, right? I mean the part about acting "adult". You know, RTFM and
all that business.
>
>> You would think you all would be better perl advocates.
>
>I've never understood language advocacy. It's just a tool. It's better for
>some tasks, not so good for others. Besides, why would *I* care what *you*
>use to do your job?

I have fun programming. So, it's kind of fun to idealize and it adds to my 
enthusiasm and creativity to regard the tools I use as just awesome tools. I think perl
is awesome. It's (At least for me.) a magic wand for manipulating the lingua franca
of the "star" of systems integration, the flat file. So, I'm profoundly sorry you
seem to take no joy in it. I one of those guys who might write the same
algorithm in more than 1 language for the hell of it.

And I don't think my original post fell into many of the slots you
articulated in your reply.

Fred

 
>
>sherm--





------------------------------

Date: Sat, 17 Sep 2005 19:21:00 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: sorting data - hash vs. list
Message-Id: <ux1Xe.4737$1G4.941369@news20.bellglobal.com>


<Fred@fred.net> wrote in message 
news:ip5pi1lsk2od557qdi6p8iart5n6t7e5v9@4ax.com...
> On Fri, 16 Sep 2005 20:31:42 -0500, Tad McClellan <tadmc@augustmail.com> 
> wrote:
>>
>>You should abandon Perl and its community of Nazis immediately
>>and use Ruby for all of your future programming.
>
> Well, thanks for the advice, but I like perl, and as indicated,
> I seldom post here, mostly just search it.
>

Tad may have broken Godwin's Law, but you just confirmed in that one 
sentence what most regulars already suspected: you want free advice, but you 
aren't interested in helping out yourself. Worse, you want free advice, and 
you expect people to give it to you the way you want it. That isn't usenet. 
Until you shell out money you're getting what you pay for.

Matt 




------------------------------

Date: Sat, 17 Sep 2005 21:49:10 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: sorting data - hash vs. list
Message-Id: <m2y85vf8mh.fsf@Sherm-Pendleys-Computer.local>

"Fred@fred.net" <Fred@fred.net> writes:

> On Fri, 16 Sep 2005 20:54:55 -0400, Sherm Pendley <sherm@dot-app.org> wrote:
>
>>It drove some of Perl's best and brightest - Larry Wall and Tom Christiansen,
>>to name two - to give up on the group entirely, because it felt like trying
>>to discuss particle physics while standing in the middle of a crowd of fifty
>>screaming two-year-olds.
> I don't quite see it that way. I just don't see as much "noise" here

You don't see it *now* because we have guidelines. We have guidelines because
that's how it *was* back when.

That's what you're missing here. When the regulars here tell you that a group
without guidelines turns into chaos, they're not guessing. They're giving you
a history lesson - we *had* a group without guidelines, and it *was* chaos.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Sun, 18 Sep 2005 00:26:16 GMT
From: James E Keenan <jkeen_via_google@yahoo.com>
Subject: What is "$^O" on Cygwin?
Message-Id: <Iu2Xe.5345$iv5.79@trndny03>

Can anyone running Cygwin tell me what the value for $^O is?

     perl -e 'print "$^O\n";'

MSWin32? Cygwin?  Something else?

Thanks in advance.

jimk


------------------------------

Date: Sun, 18 Sep 2005 00:36:51 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: What is "$^O" on Cygwin?
Message-Id: <DE2Xe.98026$Hx4.19250@twister.nyroc.rr.com>

James E Keenan wrote:
> Can anyone running Cygwin tell me what the value for $^O is?
> 
>     perl -e 'print "$^O\n";'
> 
> MSWin32? Cygwin?  Something else?
 ...
> jimk

When I try it, I get:

bob@vektron ~
$ perl -e 'print $^O'
cygwin
bob@vektron ~
$

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


------------------------------

Date: Sun, 18 Sep 2005 00:53:09 GMT
From: "Randy Harris" <randy@SpamFree.com>
Subject: Re: What is "$^O" on Cygwin?
Message-Id: <VT2Xe.1829$gK.1455@newssvr22.news.prodigy.net>


"James E Keenan" <jkeen_via_google@yahoo.com> wrote in message
news:Iu2Xe.5345$iv5.79@trndny03...
> Can anyone running Cygwin tell me what the value for $^O is?
>
>      perl -e 'print "$^O\n";'
>
> MSWin32? Cygwin?  Something else?
>
> Thanks in advance.
>
> jimk

$ perl -e 'print "$^O\n";'
MSWin32




------------------------------

Date: Sun, 18 Sep 2005 01:08:08 GMT
From: James E Keenan <jkeen_via_google@yahoo.com>
Subject: Re: What is "$^O" on Cygwin?
Message-Id: <432CBDF8.9040403@yahoo.com>

Bob Walton wrote:

> James E Keenan wrote:
> 
>> Can anyone running Cygwin tell me what the value for $^O is?
>>

> 
> When I try it, I get:
> 
> bob@vektron ~
> $ perl -e 'print $^O'
> cygwin
> bob@vektron ~
> $

and then Randy Harris wrote:

 >
 > $ perl -e 'print "$^O\n";'
 > MSWin32
 >

Interesting that the results are *not* consistent!

jimk


------------------------------

Date: Sun, 18 Sep 2005 04:04:00 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: What is "$^O" on Cygwin?
Message-Id: <QG5Xe.98047$Hx4.72852@twister.nyroc.rr.com>

James E Keenan wrote:

> Bob Walton wrote:
> 
>> James E Keenan wrote:
>>
>>> Can anyone running Cygwin tell me what the value for $^O is?
>>>
> 
>>
>> When I try it, I get:
>>
>> bob@vektron ~
>> $ perl -e 'print $^O'
>> cygwin
>> bob@vektron ~
>> $
> 
> 
> and then Randy Harris wrote:
> 
>  >
>  > $ perl -e 'print "$^O\n";'
>  > MSWin32
>  >
> 
> Interesting that the results are *not* consistent!
> 
> jimk

I can get that result also, if I execute ActiveState Perl built 
for Windoze under Cygwin:

bob@vektron ~
$ /cygdrive/c/perl/bin/perl.exe -e 'print $^O'
MSWin32
bob@vektron ~
$

I was executing Perl built under Cygwin when I got the "cygwin" 
result.  HTH.
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


------------------------------

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 8429
***************************************


home help back first fref pref prev next nref lref last post