On 17/05/2012 23:19, Shawn H Corey wrote:
> On 12-05-17 05:24 PM, Chris Stinemetz wrote:
>>
>> push(@fields, $Icell,$Isect,$Ichan,$cfc,$cfcq,$rtd);
>
> # push an anonymous array for each record
> push @fields, [ $Icell,$Isect,$Ichan,$cfc,$cfcq,$rtd ];
>
>> }
>> }
>>
>>
>> my @sorted_fields = sort
On 12-05-17 05:24 PM, Chris Stinemetz wrote:
Thank you Uri and Shawn.
I am getting the following error and not sure how to resolve:
I will also checkout the great suggestions Uri made.
Can't use string ("3") as an ARRAY ref while "strict refs" in use at
./DBSRtest.pl line 51,<> line 999.
#!/
Thank you Uri and Shawn.
I am getting the following error and not sure how to resolve:
I will also checkout the great suggestions Uri made.
Can't use string ("3") as an ARRAY ref while "strict refs" in use at
./DBSRtest.pl line 51, <> line 999.
#!/usr/bin/perl
use warnings;
use strict;
use POSI
On 05/17/2012 04:52 PM, Shawn H Corey wrote:
On 12-05-17 03:36 PM, Chris Stinemetz wrote:
I would like to sort the array by
$fields[0],$fields[1],$fields[2],$fields[3],$fields[4],$fields[5] in
ascending order starting witht he first element before I print the
array.
Do you want the fields sort
On 12-05-17 03:36 PM, Chris Stinemetz wrote:
I would like to sort the array by
$fields[0],$fields[1],$fields[2],$fields[3],$fields[4],$fields[5] in
ascending order starting witht he first element before I print the
array.
Do you want the fields sorted or do you want records sorted? If you want
I have an array "@fields" that contains 6 elements.
I would like to sort the array by
$fields[0],$fields[1],$fields[2],$fields[3],$fields[4],$fields[5] in
ascending order starting witht he first element before I print the
array.
I haven't been able to figure this out. Any help is greatly apprecia
On 30/10/2011 13:20, newbie01 perl wrote:
Hi Rob,
Thanks for your response and to everyone else who had given their thoughts,
especially John. This whole exercise is turning out to be a "fun" way of
learning arrays and print formatting.
I tried the script that you suggested and it is giving som
Hi Rob,
Thanks for your response and to everyone else who had given their thoughts,
especially John. This whole exercise is turning out to be a "fun" way of
learning arrays and print formatting.
I tried the script that you suggested and it is giving some error and not
sure how to get around it. F
On 24/10/2011 21:35, John W. Krahn wrote:
>
> You forgot the part where the OP wants to sort the output. :-)
I thought I didn't have enough information to know how the OP wanted the
report sorted, but I see from the attacked shell script that the
original lines from the df output are sorted befor
Rob Dixon wrote:
**OUTPUT**
FilesystemMBytes UsedAvail Capacity
Mount
-- - -
-
/dev/md/dsk/d1 3027-MB 2424-MB 542-MB 82% /
/proc
On 22/10/2011 03:18, newbie01 perl wrote:
> Hi all,
>
> Am trying to write/convert a customized df script in Perl and need some
> help with regards to using arrays and file handlers.
>
> At the moment am using
>
> system("df -k > /tmp/df_tmp.00");
>
> To re-direct the df output. Am using df -k
On 2011-10-22 17:37, timothy adigun wrote:
my($filesys,$mbytes,$used,$avail,$capacity,$mount)=("","","","","","");
Alternative:
$_ = "" for my ( $p, $q, $r, $s );
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
htt
"Learning Perl" turns out to be the 6th edition.
Oh my! I thought to myself, perhaps mine might be about
the 4th or 5th edition - alas, it is the 2nd. Start
saving...
Tx & rgds, GFStC.
On Fri, 21 Oct 2011 22:37:14 -0700
David Christensen wrote:
The canonical book for learning Perl i
On Sat, Oct 22, 2011 at 7:13 PM, Brian Fraser wrote:
> I say this without a bit of sarcasm: Feel blessed in your ignorance of
> formats. The declarations on top are unfortunately needed (If it helps,
> think of formats using lexical variables as closures).
> But you shouldn't be using formats. So
On Sat, Oct 22, 2011 at 4:57 PM, Brandon McCaig wrote:
> On Sat, Oct 22, 2011 at 11:37 AM, timothy adigun <2teezp...@gmail.com>
> wrote:
> > my($filesys,$mbytes,$used,$avail,$capacity,$mount)=("","","","","","");
>
> Declaring these variables here is useless (and initializing them
> here is even
On Sat, Oct 22, 2011 at 3:00 PM, Brandon McCaig wrote:
> http://search.cpan.org/~abarclay/Filesys-DiskFree-0.06/DiskFree.pm
I guess the proper way to post a CPAN link is with the 'permalink':
http://search.cpan.org/perldoc?Filesys::DiskFree
Regards,
--
Brandon McCaig
Castopulence Software
On Fri, Oct 21, 2011 at 10:18 PM, newbie01 perl wrote:
> At the moment am using
>
> system("df -k > /tmp/df_tmp.00");
>
> To re-direct the df output. Am using df -k because some of the Solaris and
> HP servers does not have df -h, by using df -k, am sure it will work on all
> of them.
Apparently
On Sat, Oct 22, 2011 at 11:37 AM, timothy adigun <2teezp...@gmail.com> wrote:
> my($filesys,$mbytes,$used,$avail,$capacity,$mount)=("","","","","","");
Declaring these variables here is useless (and initializing them
here is even more useless). :-/ The lack of whitespace is also
useless and makes
Hi newbie01 perl,
Try the code below and see if it works for you, it works well on my
Ultimate Ubuntu OS.
Assumptions in the code below:
1. you must pass df to the perl script on the Command Line Interface *e.g
perl mydf.pl df*,
2. you don't have Perl6::Form installed, though you can get here
h
On 10/21/2011 07:18 PM, newbie01 perl wrote:
Am trying to write/convert a customized df script...
> I've attached a version of the script in Korn shell. ...
...
[input]
Filesystemkbytesused avail capacity Mounted on
/dev/md/dsk/d1 3099287 2482045 55525782%/
/pr
Hi all,
Am trying to write/convert a customized df script in Perl and need some help
with regards to using arrays and file handlers.
At the moment am using
system("df -k > /tmp/df_tmp.00");
To re-direct the df output. Am using df -k because some of the Solaris and
HP servers does not have df -h
On Tue, Aug 09, 2005 at 05:00:44PM -0400, Jeff 'japhy' Pinyan wrote:
> On Aug 9, Jeremy Kister said:
>
> >>my @s = map $_->[ 1 ],
> >>sort { $a->[ 0 ] cmp $b->[ 0 ] }
> >>map [ inet_aton( $_->{ N } ), $_ ],
> >>@a;
> >
> >Now to analyze WTF we're doing here :)
>
> Paul'
On Aug 9, Jeremy Kister said:
my @s = map $_->[ 1 ],
sort { $a->[ 0 ] cmp $b->[ 0 ] }
map [ inet_aton( $_->{ N } ), $_ ],
@a;
Now to analyze WTF we're doing here :)
Paul's answer had a slight typo in it -- he was comparing $a->[0],
$a->[1], $a->[2], and $a->[3], wh
On 8/9/2005 8:43 AM, John W. Krahn wrote:
> Jeremy Kister wrote:
>>I've apparently dumbed down my code and question a bit too much: I have
>>multiple hashrefs in each element of the array, and I need the resulting
>>sorted array to contain all the data in the original array, simply
>>sorted by the
Jeremy Kister wrote:
> On 8/9/2005 6:26 AM, Paul Johnson wrote:
>>my @s = map { $_ -> [0] }
>>sort { $a->[0] <=> $b->[0] ||
>> $a->[1] <=> $b->[1] ||
>> $a->[2] <=> $b->[2] ||
>> $a->[3] <=> $b->[3] }
>>map { [ $_, split /\./ ] }
>>
On Tue, Aug 09, 2005 at 06:53:33AM -0400, Jeremy Kister wrote:
> On 8/9/2005 6:26 AM, Paul Johnson wrote:
> > my @s = map { $_ -> [0] }
> > sort { $a->[0] <=> $b->[0] ||
> >$a->[1] <=> $b->[1] ||
> >$a->[2] <=> $b->[2] ||
> >$a->[3] <=> $b->
On 8/9/2005 6:26 AM, Paul Johnson wrote:
> my @s = map { $_ -> [0] }
> sort { $a->[0] <=> $b->[0] ||
>$a->[1] <=> $b->[1] ||
>$a->[2] <=> $b->[2] ||
>$a->[3] <=> $b->[3] }
> map { [ $_, split /\./ ] }
> map { $_->{N} } @a;
On Tue, Aug 09, 2005 at 06:03:18AM -0400, Jeremy Kister wrote:
> I've got an array full of hashrefs:
> my @a = ( {N => '10.1.2.1'},
> {N => '10.1.9.1'},
> {N => '10.3.5.1'},
> {N => '10.1.1.3'},
> );
>
> I want to sort this array, and print. I expect the ou
I've got an array full of hashrefs:
my @a = ( {N => '10.1.2.1'},
{N => '10.1.9.1'},
{N => '10.3.5.1'},
{N => '10.1.1.3'},
);
I want to sort this array, and print. I expect the output resemble:
10.1.1.3
10.1.2.1
10.1.9.1
10.3.5.1
I've fumbled with this fo
Chris wrote:
Hi Guys,
I have something im basically stumped on, so mabey somebody can
give me a hand ;)
This is my scenario:
I have a bunch of random URL's in a plain text file. I also have a text
file with just the domain of certain URL's that are in the random URL
file.
IE: random file:
Hi Guys,
I have something im basically stumped on, so mabey somebody can
give me a hand ;)
This is my scenario:
I have a bunch of random URL's in a plain text file. I also have a text
file with just the domain of certain URL's that are in the random URL
file.
IE: random file:
something.
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Rob Richardson) writes:
>--- Peter Scott <[EMAIL PROTECTED]> wrote:
>> In article <[EMAIL PROTECTED]>,
>> [EMAIL PROTECTED] (Rob Richardson) writes:
>> >sub GetTrainsByTime
>> >{
>> >my $self = shift;
>> >my @result;
>> >my @temp;
>>
Rob Richardson wrote:
>
> --- Peter Scott <[EMAIL PROTECTED]> wrote:
> >
> > (2) If you want to sort the keys of a hash, there's no need to put
> > them into an array. sort takes a list as input:
> >
> > return sort { $a->GetCrewCall cmp $b->GetCrewCall } keys %self
>
> Since I am not usin
Rob Richardson wrote:
(1) If you wanted to put the keys of a hash into an array, just do it
all at once:
@temp = keys %$self
I am not putting the keys of the hash into the temporary array. I'm
putting the values of the hash into the array.
In that case, perldoc -f values, 'values' does the s
Peter,
Thanks for your reply. My responses are in-line below.
Rob
--- Peter Scott <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED] (Rob Richardson) writes:
> >sub GetTrainsByTime
> >{
> > my $self = shift;
> > my @result;
> > my @temp;
> > my $a
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Rob Richardson) writes:
>Greetings!
>
>In the train schedule program that you are all probably heartily sick
>of by now, I have added a ScheduleDay class that represents all trains
>running on a given day. It has a method that returns an array of
Greetings!
In the train schedule program that you are all probably heartily sick
of by now, I have added a ScheduleDay class that represents all trains
running on a given day. It has a method that returns an array of
references to all of the Train objects for that day. I want to sort
those train
37 matches
Mail list logo