On Thu, Mar 29, 2012 at 6:08 PM, John W. Krahn wrote:
> my wrote:
>>
>> The goal of this assignment is to put in practice the list and I/O
>> functionalities implemented by Perl.
>>
>>
>>
>> Write a program that will read a list from a file (input), will sort
>> the list in lexical order and write
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(open close);
use 5.012;
open my $fh, '<', '/etc/passwd';
open my $fh2, '>', '/tmp/newpasswd';
my $uid;
my %h;
while(<$fh>){
$uid = (split /\:/, $_)[0];
$h{$uid} = $_;
}
print $fh2 map "$h{$_}", sort keys %h;
my wrote:
The goal of this assignment is to put in practice the list and I/O
functionalities implemented by Perl.
Write a program that will read a list from a file (input), will sort
the list in lexical order and write back the sorted list to another
file (output). You can use arrays and any
The goal of this assignment is to put in practice the list and I/O
functionalities implemented by Perl.
Write a program that will read a list from a file (input), will sort
the list in lexical order and write back the sorted list to another
file (output). You can use arrays and any of the Perl
Hi friend.i'm around to watch my children growhttp://www.raysgiftcard.com/profile/34DarrenBailey/";>http://www.raysgiftcard.com/profile/34DarrenBailey/see
you later
http://goo.gl/WOrNy
* Slick [2009-10-07 08:34:44 -0700] wrote :
> I have a thought. Thanks to all of you and Bob as well for asking me what I
> want to do.
>
> I am trying to learn to write script and right now just comes the
> understanding of what goes where and when etc.
>
> However is it possible to write a
Slick wrote:
However is it possible to write a script that allows me to load 1 program on 3
different computers?. I use Windows and I have a home network. Just a
thought. Or even update the computers at the same time with one script instead
of going to each computer and updating individuall
I have a thought. Thanks to all of you and Bob as well for asking me what I
want to do.
I am trying to learn to write script and right now just comes the understanding
of what goes where and when etc.
However is it possible to write a script that allows me to load 1 program on 3
different comp
John W . Krahn wrote:
> On Friday 06 June 2003 13:22, Rob Dixon wrote:
> > Katy Brownfield wrote:
> > > On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon
> > > <[EMAIL PROTECTED]>
> > >
> > > wrote:
> > > > John W. Krahn wrote:
> > > > > Mark Anderson wrote:
> > > > > > B) You should NEVER use map in a
On Friday 06 June 2003 13:22, Rob Dixon wrote:
> Katy Brownfield wrote:
> > On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon
> > <[EMAIL PROTECTED]>
> >
> > wrote:
> > > John W. Krahn wrote:
> > > > Mark Anderson wrote:
> > > > > B) You should NEVER use map in a void context. map works
> > > > > very
On Fri, 6 Jun 2003 21:22:13 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
Katy Brownfield wrote:
On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
> John W. Krahn wrote:
> > Mark Anderson wrote:
> > >
> > > B) You should NEVER use map in a void context. map works very
hard
>
"John W. Krahn" wrote:
> ... just like there are some situations where goto is
> appropriate.
>
> :-)
>
> John
Careful John,
They don't make stake rope and kindling for nothing.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Katy Brownfield wrote:
> On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
> wrote:
>
> > John W. Krahn wrote:
> > > Mark Anderson wrote:
> > > >
> > > > B) You should NEVER use map in a void context. map works very hard
> > > >to build up it's return value, so there should be a
On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]>
wrote:
John W. Krahn wrote:
Mark Anderson wrote:
>
> B) You should NEVER use map in a void context. map works very hard
>to build up it's return value, so there should be an assignment
>(=) operator to the left of your map
John W. Krahn wrote:
> Mark Anderson wrote:
> >
> > B) You should NEVER use map in a void context. map works very hard
> >to build up it's return value, so there should be an assignment
> >(=) operator to the left of your map call almost always, otherwise
> >all of that work is wasted.
From: "John W. Krahn" <[EMAIL PROTECTED]>
> Mark Anderson wrote:
> >
> > B) You should NEVER use map in a void context. map works very hard
> >to build up it's return value, so there should be an assignment
> >(=) operator to the left of your map call almost always,
> >otherwise all o
Mark Anderson wrote:
>
> B) You should NEVER use map in a void context. map works very hard
>to build up it's return value, so there should be an assignment
>(=) operator to the left of your map call almost always, otherwise
>all of that work is wasted.
I would never say NEVER as the
Kevin Pfeiffer wrote:
>
> (Forgive the excitement)
>
> I just reversed the %n2m construct - the original builds a hash using map
> that lets you convert numbers to months, etc. (I probably found it here).
>
> In keeping with my feeling that with 'map' one can do almost anything (if I
> knew how)
In article <[EMAIL PROTECTED]>, Mark
Anderson wrote:
[...]
> "A guy with a hammer sees all his problems as nails." --Old software
> saying
[...]
But it's much easier to figure out what to do with a hammer than it is with
just a nail. ;-)
Thanks all for the lesson(s) and tips.
-K
--
Kevin P
Jenda Krynicky wrote:
> From: Kevin Pfeiffer <[EMAIL PROTECTED]>
> > In keeping with my feeling that with 'map' one can do almost
> > anything
>
> quite right, but
>
> > (if I knew how) I'm happy to have managed to build something using
> > 'map' (without external help I mean). Seems easy, now. ;-)
> (Forgive the excitement)
Not a problem. Congratulations.
> I just reversed the %n2m construct - the original builds a hash using map
> that lets you convert numbers to months, etc. (I probably found it here).
>
> In keeping with my feeling that with 'map' one can do almost anything (if
I
> kne
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I must say that since joining this list I have had many days brightened by yet
another cool piece of code. The neat-o meter gets pegged almost everyday.
:-)
On Thursday 05 June 2003 12:49, Jenda Krynicky wrote:
> From: Kevin Pfeiffer <[EMAIL P
From: Kevin Pfeiffer <[EMAIL PROTECTED]>
> In keeping with my feeling that with 'map' one can do almost anything
quite right, but
> (if I knew how) I'm happy to have managed to build something using
> 'map' (without external help I mean). Seems easy, now. ;-)
>
> # months into numbers...
>
> $m
> (Forgive the excitement)
>
No problem!
> I just reversed the %n2m construct - the original builds a
> hash using map
> that lets you convert numbers to months, etc. (I probably
> found it here).
>
> In keeping with my feeling that with 'map' one can do almost
> anything (if I
> knew how)
(Forgive the excitement)
I just reversed the %n2m construct - the original builds a hash using map
that lets you convert numbers to months, etc. (I probably found it here).
In keeping with my feeling that with 'map' one can do almost anything (if I
knew how) I'm happy to have managed to build s
26 matches
Mail list logo