Re: Displaying a user's group memberships

2006-12-20 Thread John W. Krahn
Mumia W. wrote: > On 12/20/2006 04:14 PM, Tom Smith wrote: >> [...] >> So is there a better way to do this, or perhaps a cleaner way? > > use strict; > use warnings; > $_ = `id $ARGV[0]`; > s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n"; print $1 if `groups $ARGV[0] 2>/dev/null` =~ /$ARGV[0]\s*:

Re: Displaying a user's group memberships

2006-12-20 Thread Tom Smith
Mumia W. wrote: On 12/20/2006 04:14 PM, Tom Smith wrote: [...] So is there a better way to do this, or perhaps a cleaner way? Thanks again for your help! ~ Tom use strict; use warnings; $_ = `id $ARGV[0]`; s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n"; I'm not trying to be argumentativ

Re: Displaying a user's group memberships

2006-12-20 Thread Mumia W.
On 12/20/2006 04:14 PM, Tom Smith wrote: [...] So is there a better way to do this, or perhaps a cleaner way? Thanks again for your help! ~ Tom use strict; use warnings; $_ = `id $ARGV[0]`; s/.*?groups=// && print "@{[ /\((\w+)\)/g ]}\n"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: beginner on the windows platform

2006-12-20 Thread Erik Test
I suggest getting gvim on your PC. gvim can be difficult to learn at first but is definitely needed when needing to replace some snippet of code in multiple locations. While notepad does allow you to do this, you can't enter pattern matching expressions to replace on a command line with notepad.

Re: Displaying a user's group memberships

2006-12-20 Thread John W. Krahn
Tom Smith wrote: > > Thank Chad (and John) for your input on this. I thought I'd post the > portion of the script that I was trying to work out to see if there's > room for improvement. This should work on any *nix system. The format of > the command is simple: `test.pl username`, where username i

Re: Displaying a user's group memberships

2006-12-20 Thread Chad Perrin
On Wed, Dec 20, 2006 at 03:14:18PM -0700, Tom Smith wrote: > > Thank Chad (and John) for your input on this. I thought I'd post the > portion of the script that I was trying to work out to see if there's > room for improvement. This should work on any *nix system. The format of > the command is

Re: Displaying a user's group memberships

2006-12-20 Thread Tom Smith
Chad Perrin wrote: On Mon, Dec 18, 2006 at 04:50:57PM -0700, Tom Smith wrote: I need to capture a user's group memberships for further processing in a Perl script. The user's username is passed to the script via the command line and captured with ARGV. From there, I want to determine the gro

Re: 'unknown column' error

2006-12-20 Thread Dr.Ruud
Huub schreef: > DBD::mysql::st execute failed: Unknown column 'Oostvoorne' in 'field > list' at /home/Huub/workspace/VulWoningen/VulWoningen.pl line 31. > Connection Error: Unknown column 'Oostvoorne' in 'field list' > > It says 'Unknown column'. That is right: It's no column, it's data to > be

Re: Error output from a fork

2006-12-20 Thread Ken Foskey
On Mon, 2006-12-18 at 12:15 -0600, Dukelow, Don wrote: > I'm making two executable file that is just one lines of ping commands > like. > > remsh ping -I > > This file could have a couple hundred line it like this. > Each of the two files will be put off in different forks at the same

Re: Capture remsh output

2006-12-20 Thread Igor Sutton
2006/12/20, Dukelow, Don <[EMAIL PROTECTED]>: I'm going into a "while" loop with a list of servers and need to execute a remote command and bring back the output. Doing a "qx/remsh What about pipe'ing the output of your program to Perl? Check the (untested) code below. foreach my $host (@ho

Capture remsh output

2006-12-20 Thread Dukelow, Don
I'm going into a "while" loop with a list of servers and need to execute a remote command and bring back the output. Doing a "qx/remsh smime.p7s Description: S/MIME cryptographic signature

pdf to excel

2006-12-20 Thread oryann9
I have a scanned PDF file and I want to convert its data so I can store it in an xls file. What module(s) do you recommened? I saw File::Extract::PDF ?? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http:

doubt on time structures

2006-12-20 Thread pradeep reddy
Hello, I used the follwoing code: struct rusage startusage, stopusage; getrusage(RUSAGE_SELF, &startusage); getrusage(RUSAGE_SELF, &stopusage); cpu_delta_user=((stopusage.ru_utime.tv_sec*100) + stopusage.ru_utime.tv_usec) -(startUsage.ru_utime.tv_sec*1

Re: 'unknown column' error

2006-12-20 Thread Greg Sabino Mullane
On Wed, 2006-12-20 at 14:47 +0100, Huub wrote: > $opdracht = "insert into woningen (complex,plaats,straat,huisnr) values > ($complex,$plaats,$straat,$teller)"; > $sth = $dbh->prepare($opdracht); > $sth->execute or die "Connection Error: $DBI::errstr\n"; > ... > It says 'Unknown column'. That is r

Re: File:: Copy

2006-12-20 Thread D. Bolliger
Jeff Pang am Mittwoch, 20. Dezember 2006 15:09: > "Dukelow, Don" <[EMAIL PROTECTED]> > >I can't get "use File::Copy" to work. I declare it at the beginning of > >script but when I try to use it latter nothing happens. There are no > > errors and nothing is copied. > > Did you also add "use strict

Re: 'unknown column' error

2006-12-20 Thread D. Bolliger
Huub am Mittwoch, 20. Dezember 2006 14:47: > Hi, Hello > I'm trying to insert a record in a MySQL database using Perl. I already > wrote a (working) Perl script to make queries, but now I get this problem. > > This is the relevant part of the code: > > $plaats = "Oostvoorne"; > $straat = "Middell

Re: File:: Copy

2006-12-20 Thread Dermot Paikkos
On 20 Dec 2006 at 8:00, Dukelow, Don wrote: > I can't get "use File::Copy" to work. I declare it at the beginning > of script but when I try to use it latter nothing happens. There are > no errors and nothing is copied. > > I'm using the command! > > copy($variable, $variable2); > > I've also

Re: File:: Copy

2006-12-20 Thread Jeff Pang
> >I can't get "use File::Copy" to work. I declare it at the beginning of >script but when I try to use it latter nothing happens. There are no errors >and nothing is copied. > Did you also add "use strict" and "use warnings" at the begin of the script and still saw nothing? -- Books below tr

File:: Copy

2006-12-20 Thread Dukelow, Don
I can't get "use File::Copy" to work. I declare it at the beginning of script but when I try to use it latter nothing happens. There are no errors and nothing is copied. I'm using the command! copy($variable, $variable2); I've also tried "cp" rather then "copy". Don Dukelow smime.p7s Descri

Re: 'unknown column' error

2006-12-20 Thread Jeff Pang
>$opdracht = "insert into woningen (complex,plaats,straat,huisnr) values >($complex,$plaats,$straat,$teller)"; Above is wrong.You maybe want the statement of: $opdracht = "insert into woningen (complex,plaats,straat,huisnr) values ('$complex','$plaats',$straat,$teller)"; When your column typ

'unknown column' error

2006-12-20 Thread Huub
Hi, I'm trying to insert a record in a MySQL database using Perl. I already wrote a (working) Perl script to make queries, but now I get this problem. This is the relevant part of the code: $plaats = "Oostvoorne"; $straat = "Middellandweg"; $teller = 3; $complex = 5; $opdracht = "insert into

Re: constructing a http request using LWP..

2006-12-20 Thread positive mind
Hi Prasanna, Thanks for your reply, but i have to do this on linux. does Win32 or any equivalent module is available on Linux? thanks, pm On 12/20/06, Nagasamudram, Prasanna Kumar < [EMAIL PROTECTED]> wrote: Hi pm I had the same requirement, just with a press of a button, I need my inbox(all

Re: constructing a http request using LWP..

2006-12-20 Thread Rob Dixon
positive mind wrote: Hi there, is it possible to automate the login and log out say from yahoo mail using LWP/HTTP module. cause i have application which is similar to this and i have to send my login request alongwith few query parameters . after i login i will be logged in to my application

Re: HTML::TokeParser question

2006-12-20 Thread Rob Dixon
Mathew Snyder wrote: > > I have a script which runs WWW::Mechanize to obtain a page so it can be parsed > for email addresses. However, I can't recall how I'm supposed to use > HTML::TokeParser to get what I need. This is the pertinent part of the > script: > > ... > my $data = $agent->conte

Re: HTML::TokeParser question

2006-12-20 Thread Rob Dixon
Mumia W. wrote: > On 12/19/2006 10:58 PM, Mathew Snyder wrote: >> I have a script which runs WWW::Mechanize to obtain a page so it can be >> parsed for email addresses. However, I can't recall how I'm supposed to use >> HTML::TokeParser to get what I need. This is the pertinent part of the >> sc

Re: Module for printing file with CUPS

2006-12-20 Thread jm
also be aware that in previous versions of CUPS there was a native ability to print directly to a file; per the cups users group it was removed at some point because too many people were complaining about how difficult/unintuitive it was (seems like if i could figure it out at the time, anybody co

RE: constructing a http request using LWP..

2006-12-20 Thread Nagasamudram, Prasanna Kumar
Hi pm I had the same requirement, just with a press of a button, I need my inbox(all the login etc should be automated) I wrote the following script. (You may have to install the Win32::GuiTest module from cpan. (also change YOURLOGIN and YOURPASSWORD appropriately). With this you don't have to

Re: Module for printing file with CUPS

2006-12-20 Thread Larry Johnson
Toddy Prawiraharjo <[EMAIL PROTECTED]> wrote: Hello all, I am starting to learn how to print via perl in linux. I have setup a network printer (using CUPS), which support TCP/IP and socket (9100). What module do i need, if necessary, to print a file using that printer? Thanks in advance Toddy

constructing a http request using LWP..

2006-12-20 Thread positive mind
Hi there, is it possible to automate the login and log out say from yahoo mail using LWP/HTTP module. cause i have application which is similar to this and i have to send my login request alongwith few query parameters . after i login i will be logged in to my applications mail box. how can i do

Re: HTML::TokeParser question

2006-12-20 Thread Mumia W.
On 12/19/2006 10:58 PM, Mathew Snyder wrote: I have a script which runs WWW::Mechanize to obtain a page so it can be parsed for email addresses. However, I can't recall how I'm supposed to use HTML::TokeParser to get what I need. This is the pertinent part of the script: ... my $data = $ag

Re: foolprof regex

2006-12-20 Thread beast
Chad Perrin wrote: At a wild guess, I'd say that you're probably getting the matches you want, plus getting the "my name =" as a match. The reason is that you didn't specify that the leading spaces before the word "name" must be at the beginning of the line. For that, use "^". Use "perldoc pe

Re: foolprof regex

2006-12-20 Thread John W. Krahn
beast wrote: > > Hi All, Hello, > Basically I want these input : > name= >name= > name= >name = > > But I did not want these input: > my name = > name is = > my name is = > > -- > > if ( /\s*name\s*=/) { > print "Match: $_"; > } > > did not works as i expected. You n

Re: foolprof regex

2006-12-20 Thread Chad Perrin
On Wed, Dec 20, 2006 at 02:56:28PM +0700, beast wrote: > > Hi All, > > Basically I want these input : > name= >name= > name= >name = > > But I did not want these input: > my name = > name is = > my name is = > > -- > > if ( /\s*name\s*=/) { > print "Match: $_"; > } > >