manipulating X clipboard

2004-02-16 Thread Paul William
Hi, Does anyone know if there are any perl modules that will allow me to manipulate the X clipboard. I have searched cpan.org but didnt find anything. Thanks Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Looking up values in arrays?

2004-02-16 Thread David le Blanc
use List::Util "first"; sub has_element($$) { my( $aref, $value ) = @_; first { $aref->[$_] eq $value } 0..$#$aref } ? -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Monday, 16 February 2004 10:57 PM To: [EMAIL PROTECTED] Subject: Re: Looking up val

RE: data filtering

2004-02-16 Thread David le Blanc
Aha. The problem here is *how do I implement a parser to process a table of data based on a user supplied query* Ok, look at the following:- #!/usr/bin/perl use strict; - matter of style use warnings; - and again # This DATASET has the following columns, with t

Re: Help with array, hashes and objects

2004-02-16 Thread James Edward Gray II
On Feb 16, 2004, at 2:46 PM, george wrote: I want to parse a long ns log text file, and I've attempted to write some perl code to do that. I am a newbie, and I haven't managed to get my code working. I'll provide some general comments below. Basically, the ns file contains information about TCP

Re: LWP Logging or the such..

2004-02-16 Thread R. Joseph Newton
Martin R Morales wrote: > Good Morning/Afternoon Everyone, > > I have been reading up on LWP::UserAgent and HTTP::Request of the LWP package. > This is good stuff. > But I am still confused about a couple of things. Here is ther senario. I have > a file I want to download from > my server and

RE: another directory search, yet many subdirs

2004-02-16 Thread Matt Matijevich
under each of these suddirs, I need all the eml files deleted but there are thousands of them and the actual file name is "training 2001.eml" so my questions still remain, Can I have this search recursively down under all the pc subdir names? File::Find will do what you need. Google can

Re: How to rearrange an array by a hash

2004-02-16 Thread Jan Eden
John W. Krahn wrote: >Shiping Wang wrote: >> >> Hi, > >Hello, > >> How can I rearrange an array in a specific order based on the order of a >> hash? Something like this: >> >> my @a = qw(Mary John Dan); >> print join "\t", @a, "\n"; >> >> my %b = ( John => 0, >> Dan => 1, >> Mary => 2); >> >>

RE: another directory search, yet many subdirs

2004-02-16 Thread DBSMITH
David, under each of these suddirs, I need all the eml files deleted but there are thousands of them and the actual file name is "training 2001.eml" so my questions still remain, Can I have this search recursively down under all the pc subdir names? Can I create a scalar like "/home/emstat

RE: another directory search, yet many subdirs

2004-02-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > People of the Perl, > > I am in need of some help! Here is the info you need for my samba > mount points. > > directories: ~emstat/win32/backup/012004155140/pc*, > ~emstat/win32/backup/01210415175/pc*, ~emstat/win32/pc* > files: under each of these subdirs, pc[###

another directory search, yet many subdirs

2004-02-16 Thread DBSMITH
People of the Perl, I am in need of some help! Here is the info you need for my samba mount points. directories: ~emstat/win32/backup/012004155140/pc*, ~emstat/win32/backup/01210415175/pc*, ~emstat/win32/pc* files: under each of these subdirs, pc[#], I have "training 2001.eml" files

Re: LWP Logging or the such..

2004-02-16 Thread Rob Dixon
Martin R Morales wrote: > > Martin R Morales wrote: > > > > I have been reading up on LWP::UserAgent and HTTP::Request of the LWP > > package. This is good stuff. > > But I am still confused about a couple of things. Here is ther > > senario. I have a file I want to download from > > my server and

Help with array, hashes and objects

2004-02-16 Thread george
I want to parse a long ns log text file, and I've attempted to write some perl code to do that. I am a newbie, and I haven't managed to get my code working. Basically, the ns file contains information about TCP connections and I want to create a perl object for each connection, and gather some data

Re: How to rearrange an array by a hash

2004-02-16 Thread John W. Krahn
Shiping Wang wrote: > > Hi, Hello, > How can I rearrange an array in a specific order based on the order of a > hash? Something like this: > > my @a = qw(Mary John Dan); > print join "\t", @a, "\n"; > > my %b = ( John => 0, > Dan => 1, > Mary => 2); > > print "$_ => $b{$_}\n" for (keys %b); >

Re: shorten code

2004-02-16 Thread John W. Krahn
James Kipp wrote: > > Hi Hello, > I want to split the string below into rows and then columns. I know i can do > a couple of splits, push array refs onto a new array, regex it, etc.. But I > was know the talented people on this list can shorten the code considerably. > I want to split at each ne

Re: getting in between dates in a hash

2004-02-16 Thread Jan Eden
Joseph Alotta wrote: >Greetings, > >I am having some conceptual problems doing what I think is a fairly >simple perl task. It is probably that my mind is just blank on >this. Could someone please recommend a strategy for this. > >I have a hash of data: > >%highest_level = ( 2001-10-14 => 152,

RE: help on picking up key & values

2004-02-16 Thread Singh, Ajit p
Joseph, Let me try and explain. i have a perl script place_order which takes arguments as below: 1. ./place_order -t /thus/axioss/serviceID:123 /thus/axioss/supplierProduct:TestStream 500 /thus/axioss/web/installationTelephoneNumber:112237111663 etc 2. I have a source as

Re: LWP Logging or the such..

2004-02-16 Thread Martin R Morales
Update:: I have figured out how to save to file .. I have to open a file handle .. duh? yeah .. i know. Okay, but I would still like suggestions on saving my http responses to file .. like a log file of what the script was trying to do on execute. ~Martin Martin R Morales wrote: Good Morning

LWP Logging or the such..

2004-02-16 Thread Martin R Morales
Good Morning/Afternoon Everyone, I have been reading up on LWP::UserAgent and HTTP::Request of the LWP package. This is good stuff. But I am still confused about a couple of things. Here is ther senario. I have a file I want to download from my server and I can do that with LWP. But what I'm

Re: Checking prototype with objects

2004-02-16 Thread R. Joseph Newton
Rob Dixon wrote: > R. Joseph Newton wrote: > > > > l Maldonado Torres wrote: > > > > > > > > I am trying to use prototype functions with object but this seems not > > > to work, I mean perl does not check for the type of arguments. > > > > > > I usually do this. > > > > > > sub array_print(\@); >

RE: shorten code

2004-02-16 Thread Kipp, James
> > my @data = map { tr/%//d; [split] } split /\n/, $str; > > :) Clever! but this may be the point where where it may be confusing as you and Paul mentioned :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: shorten code

2004-02-16 Thread Rob Dixon
James Kipp wrote: > > > > > $str = " > > > > /var 0.9950% > > > > /usr 0.5871% > > > > /tmp 0.49 1% > > > > " > > > > > > my @rows = map [split], split /\n/, $str; > > > for (@rows) { $_->[2] =~ tr/%//d } > > > > N

How to rearrange an array by a hash

2004-02-16 Thread Shiping Wang
Hi, How can I rearrange an array in a specific order based on the order of a hash? Something like this: my @a = qw(Mary John Dan); print join "\t", @a, "\n"; my %b = ( John => 0, Dan => 1, Mary => 2); print "$_ => $b{$_}\n" for (keys %b); print "$_-$b{$_}\t" foreach sort {$b{$a} <=> $b{$b}} keys

Re: How i can get info about CPU ?

2004-02-16 Thread Kenton Brede
On Mon, Feb 16, 2004 at 01:07:50PM +0200, Angel Kolev ([EMAIL PROTECTED]) wrote: > Exuseme for my bad english. > How to get info for CPU: overloading, parameters, status .. etc for Windows > and Linux? I wanna use that in my perl script. Your English is fine:) A good place to start for questions

RE: shorten code

2004-02-16 Thread Kipp, James
> > > $str = " > > > /var 0.9950% > > > /usr 0.5871% > > > /tmp 0.49 1% > > > " > > > > my @rows = map [split], split /\n/, $str; > > for (@rows) { $_->[2] =~ tr/%//d } > > Not quite! Because the string starts and

Re: shorten code

2004-02-16 Thread Rob Dixon
Steve Grazzini wrote: > > Kipp, James wrote: > > I want to split at each new line for the row, then split the row into > > columns, and get rid of the "%" on the third column. > > > $str = " > > /var 0.9950% > > /usr 0.5871% > > /tmp

Re: Reg. length of anonymous array

2004-02-16 Thread Shiping Wang
Hi, How can I rearrange an array in a specific order based on the order of a hash? Something like this: my @a = qw(Mary John Dan); print join "\t", @a, "\n"; my %b = ( John => 0, Dan => 1, Mary => 2); print "$_ => $b{$_}\n" for (keys %b); print "$_-$b{$_}\t" f

RE: shorten code

2004-02-16 Thread Kipp, James
> > > my @rows = map [split], split /\n/, $str; > > > for (@rows) { $_->[2] =~ tr/%//d } > > > > > > > Neat. You saved me 6 lines of code :) > > Thank You !! > > Make sure its meaningful to you or someone else maintaining > it. I would > rather see 6 extra lines of code and have it m

Weekly list FAQ posting

2004-02-16 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

RE: shorten code

2004-02-16 Thread Paul Kraus
> > my @rows = map [split], split /\n/, $str; > > for (@rows) { $_->[2] =~ tr/%//d } > > > > Neat. You saved me 6 lines of code :) > Thank You !! Make sure its meaningful to you or someone else maintaining it. I would rather see 6 extra lines of code and have it mean something to me at

Re: shorten code

2004-02-16 Thread Rob Dixon
James Kipp wrote: > > I want to split the string below into rows and then columns. I know i can do > a couple of splits, push array refs onto a new array, regex it, etc.. But I > was know the talented people on this list can shorten the code considerably. > I want to split at each new line for the

RE: shorten code

2004-02-16 Thread Kipp, James
> my @rows = map [split], split /\n/, $str; > for (@rows) { $_->[2] =~ tr/%//d } > Neat. You saved me 6 lines of code :) Thank You !! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Checking prototype with objects

2004-02-16 Thread Rob Dixon
R. Joseph Newton wrote: > > l Maldonado Torres wrote: > > > > > I am trying to use prototype functions with object but this seems not > > to work, I mean perl does not check for the type of arguments. > > > > I usually do this. > > > > sub array_print(\@); > > ...sub array_print(\@) > > ... > > Y

Re: shorten code

2004-02-16 Thread Steve Grazzini
Kipp, James wrote: I want to split at each new line for the row, then split the row into columns, and get rid of the "%" on the third column. $str = " /var 0.9950% /usr 0.5871% /tmp 0.49 1% " my @rows = map [split], sp

Re: Checking prototype with objects

2004-02-16 Thread Randal L. Schwartz
> "Hazael" == Hazael Maldonado Torres <[EMAIL PROTECTED]> writes: Hazael> I am trying to use prototype functions with object but this seems not Hazael> to work, I mean perl does not check for the type of arguments. Exactly. Prototypes are meant for one thing only: to have a Perl function emu

shorten code

2004-02-16 Thread Kipp, James
Hi I want to split the string below into rows and then columns. I know i can do a couple of splits, push array refs onto a new array, regex it, etc.. But I was know the talented people on this list can shorten the code considerably. I want to split at each new line for the row, then split the row i

Re: data filtering

2004-02-16 Thread Rob Dixon
Guruguhan N wrote: > > I have a data set ( only a portion) as follows: >No. x1 x2 x3y1 y2y3 y4 >1 0.20 0.20 0.20 0.76568575881.929289.3 -46592.6 >2 0.200345 0.20 0.200345 0.71

Re: Checking prototype with objects

2004-02-16 Thread R. Joseph Newton
Hazael Maldonado Torres wrote: > -- > Hi there. > > I am trying to use prototype functions with object but this seems not > to work, I mean perl does not check for the type of arguments. > > I usually do this. > > sub array_print(\@); > ...sub array_print(\@) > ... Your immediate problem here i

Re: data filtering

2004-02-16 Thread R. Joseph Newton
David le Blanc wrote: > Guruguhan, > > Can I assume you have the data in memory? > Can I further assume the data is contained in an array of arrays? > Can I also further assume that the conditions you mentioned are AND'd? > (ie > the final result is the intersection of all conditions?) I'm afra

Re: Checking prototype with objects

2004-02-16 Thread Rob Dixon
Hazael Maldonado Torres wrote: > > > I am trying to use prototype functions with object but this seems not > to work, I mean perl does not check for the type of arguments. > > I usually do this. > > sub array_print(\@); > > .. > ... > > sub array_print(\@) >{ ># my code >} > > > Then wh

Re: Updating a text file

2004-02-16 Thread Jan Eden
R. Joseph Newton wrote: >Jan Eden wrote: > >>Hi, >> >>[EMAIL PROTECTED] wrote: >> >>>I have a text file with a records like: >>> >>>smith, James, Dr., 115 Fourth Street, Chicago, IL, 32012, $20.00: >>>[EMAIL PROTECTED] >>> >>>and another text file with placeholders like: >>> >>>Hello $last_name,

Re: Updating a text file

2004-02-16 Thread Mame Mbodji
Thanks, I will give it a try! "R. Joseph Newton" wrote: > > Jan Eden wrote: > > > Hi, > > > > [EMAIL PROTECTED] wrote: > > > > >I have a text file with a records like: > > > > > >smith, James, Dr., 115 Fourth Street, Chicago, IL, 32012, $20.00: > > >[EMAIL PROTECTED] > > > > > >and another text

Checking prototype with objects

2004-02-16 Thread Hazael Maldonado Torres
-- Hi there. I am trying to use prototype functions with object but this seems not to work, I mean perl does not check for the type of arguments. I usually do this. sub array_print(\@); .. ... sub array_print(\@) { # my code } Then when I call it as: array_print(@this_array); Perl is su

RE: data filtering

2004-02-16 Thread David le Blanc
Guruguhan, Can I assume you have the data in memory? Can I further assume the data is contained in an array of arrays? Can I also further assume that the conditions you mentioned are AND'd? (ie the final result is the intersection of all conditions?) Thus $data[0][0] = 0.20 (aka, X1 from r

How i can get info about CPU ?

2004-02-16 Thread Angel Kolev
Exuseme for my bad english. How to get info for CPU: overloading, parameters, status .. etc for Windows and Linux? I wanna use that in my perl script. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Looking up values in arrays?

2004-02-16 Thread Rob Dixon
Paul Johnson wrote: > > > Is there a function to find out if a given value exists in an array? > > > > What I think of is something like &has_element([EMAIL PROTECTED], $value), which > > should return either a boolean value or the index containing the value > > (undef if $value is not found). > >

data filtering

2004-02-16 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All, I have a data set ( only a portion) as follows: No. x1 x2 x3y1 y2y3 y4 1 0.20 0.20 0.20 0.76568575881.929289.3 -46592.6 2 0.200345 0.20 0.200345 0.7175766.029268.4

RE: perl and application server..

2004-02-16 Thread NYIMI Jose (BMB)
Hello, Give a look to this article from perl.com I contains a lot of interesting infos related to your question: http://www.perl.com/lpt/a/2001/10/17/etoys.html HTH, José. -Original Message- From: Joe Echavarria [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 9:25 PM To: [EM