Re: one liner need help

2009-03-12 Thread John W. Krahn
John W. Krahn wrote: John W. Krahn wrote: Toby Stuart wrote: Hello All Hello, It's been almost 13 years since I last posted on this board and my Perl skills are extremely rusty. Could someone help me to convert this to a one liner:- use strict; use warnings; while (<>) { /^##\s*(.*)$/

Re: one liner need help

2009-03-12 Thread John W. Krahn
John W. Krahn wrote: Toby Stuart wrote: Hello All Hello, It's been almost 13 years since I last posted on this board and my Perl skills are extremely rusty. Could someone help me to convert this to a one liner:- use strict; use warnings; while (<>) { /^##\s*(.*)$/ && print $1; print "

Re: one liner need help

2009-03-12 Thread John W. Krahn
Toby Stuart wrote: Hello All Hello, It's been almost 13 years since I last posted on this board and my Perl skills are extremely rusty. Could someone help me to convert this to a one liner:- use strict; use warnings; while (<>) { /^##\s*(.*)$/ && print $1; print " && " unless eof; } I

RE: one liner need help

2009-03-12 Thread Toby Stuart
Great. Thankyou chenxy. -Original Message- From: chenxy [mailto:tin...@gmail.com] Sent: Friday, 13 March 2009 2:01 PM To: Toby Stuart Cc: beginners@perl.org Subject: Re: one liner need help 2009/3/13 Toby Stuart < toby.stu...@figtreesys.com.au> Hello All It's been almost 13 years s

Re: Can anyone comment on "Sams Teach Yourself Perl in 21 Days" ?

2009-03-12 Thread Raymond Wan
Hi Shlomi, Shlomi Fish wrote: Hi all! I've been tutoring someone in Perl 5, and as she wants to learn Perl from a paperware book, she borrowed the book "Sams Teach Yourself Perl in 21 Days" from her workplace's library, and started reading it. Now, all those "in 21 Days"/"in 24 hours"/"unl

RE: running perl script on remote windows machine

2009-03-12 Thread David Christensen
Madhusudhan.v wrote: > I am looking for a script which should get information on remote > computers. > please assist on this.. The mailing list archive is your friend: http://www.mail-archive.com/beginners%40perl.org/ For example: http://www.mail-archive.com/beginners@perl.org/msg99721

Re: one liner need help

2009-03-12 Thread chenxy
2009/3/13 Toby Stuart > Hello All > > It's been almost 13 years since I last posted on this board and my Perl > skills are extremely rusty. Could someone help me to convert this to a one > liner:- > > > use strict; > use warnings; > > while (<>) { > /^##\s*(.*)$/ && print $1; > print " && " un

one liner need help

2009-03-12 Thread Toby Stuart
Hello All It's been almost 13 years since I last posted on this board and my Perl skills are extremely rusty. Could someone help me to convert this to a one liner:- use strict; use warnings; while (<>) { /^##\s*(.*)$/ && print $1; print " && " unless eof; } Input file looks like this:-

Re: use constant

2009-03-12 Thread Paul Johnson
On Thu, Mar 12, 2009 at 11:50:46PM +0100, "Stanisław T. Findeisen" wrote: > Is there any way to change the values of [scalar/array] constants > defined via "use constant" pragma? That seems a strange thing to want to do. But useful for redefining pi, or perhaps G, I suppose. In general the an

use constant

2009-03-12 Thread Stanisław T. Findeisen
Is there any way to change the values of [scalar/array] constants defined via "use constant" pragma? STF === http://eisenbits.homelinux.net/~stf/ . My PGP key fingerprint is: 9D25 3D89 75F1 DF1D F434 25D7 E87F A1B9 B80F 8062 =

Re: use SDBM_File - Can't use string as a HASH ref

2009-03-12 Thread Chas. Owens
On Thu, Mar 12, 2009 at 09:20, Jerry Rocteur wrote: > Hi, > > I'm trying to tie this kind of hash into SDBM > > $hash_of_baseline{$hdr_user_name} = { user_name => $hdr_user_name, >                                      passwd    => $hdr_user_passwd, > ... > ... >                                    

Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-12 Thread Chap Harrison
On Mar 12, 2009, at 12:52 AM, Chas. Owens wrote: On Thu, Mar 12, 2009 at 01:27, Chap Harrison wrote: It's still not intuitive to me why we FIRST "convert" the hash to an array, and THEN ask for keys - keys being hash-ish, rather than array-ish sorts of things. (I've said that badly.) W

Re: Can anyone comment on "Sams Teach Yourself Perl in 21 Days" ?

2009-03-12 Thread Francisco Valladolid
Hi On Thu, Mar 12, 2009 at 9:27 AM, Shlomi Fish wrote: > Hi all! > > I've been tutoring someone in Perl 5, and as she wants to learn Perl from a > paperware book, she borrowed the book "Sams Teach Yourself Perl in 21 Days" > from her workplace's library, and started reading it. Now, all those "i

RE: Network Printing using a Perl Script

2009-03-12 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Aglipay, Recelyn [mailto:recelyn.agli...@ehmc.com] > Sent: Thursday, March 12, 2009 07:19 > To: Wagner, David --- Senior Programmer Analyst --- CFS; > beginners@perl.org > Subject: RE: Network Printing using a Perl Script > > Hi Dave, > > I'm using a third p

Re: Stupid newb question

2009-03-12 Thread NEckhardt
Thanks John, The missing ! was the trick. I knew it had to be something stupid. Adding that and using SYSTEM which I incorrectly thought was unavailable made everything work. Now onto bigger and better things. Neal

Re: Network Printing using a Perl Script

2009-03-12 Thread jm
On Wed, Mar 11, 2009 at 4:35 PM, Aglipay, Recelyn wrote: > Hello everyone, > > > > I'm a beginner and having some issues with a Perl Script I had written > for work. > > I am trying to print to a network label printer.  I've verified that the > printer is working on its own. > > But when I try to

Re: Network Printing using a Perl Script

2009-03-12 Thread Jim Gibson
On 3/12/09 Thu Mar 12, 2009 6:18 AM, "Aglipay, Recelyn" scribbled: > Hi Dave, > > I'm using a third party application to call the perl script. This > application only allows for subroutines to be written since the app also > uses some perl. So the code below is all I have. My goal was to op

Can anyone comment on "Sams Teach Yourself Perl in 21 Days" ?

2009-03-12 Thread Shlomi Fish
Hi all! I've been tutoring someone in Perl 5, and as she wants to learn Perl from a paperware book, she borrowed the book "Sams Teach Yourself Perl in 21 Days" from her workplace's library, and started reading it. Now, all those "in 21 Days"/"in 24 hours"/"unleashed"/"for Dummies"/etc. books te

Re: Stupid newb question

2009-03-12 Thread Neal Eckhardt
"Jim Gibson" wrote in message news:c5dd973f.4740%jimsgib...@gmail.com... > On 3/11/09 Wed Mar 11, 2009 11:36 AM, "neckha...@penntraffic.com" > scribbled: > Thanks Jim, The missing ! was the key. I knew it had to be something stupid. The capitalization of the commands was just to differenti

use SDBM_File - Can't use string as a HASH ref

2009-03-12 Thread Jerry Rocteur
Hi, I'm trying to tie this kind of hash into SDBM $hash_of_baseline{$hdr_user_name} = { user_name => $hdr_user_name, passwd=> $hdr_user_passwd, ... ... groups => [ @info_group_names ] }; I can store it but when

Re: OO constructors

2009-03-12 Thread Dr.Ruud
Dermot wrote: Dr.Ruud: Dermot: my $instance = new MyClass; my $instance = MyClass->new; MyClass::->new MyClass::->new() So do they all amount to the same thing? Fundamentally not. In many practical situations they behave about the same. Until they don't. The last one is the mo

use SDBM_File - Can't use string as a HASH ref

2009-03-12 Thread Jerry Rocteur
Hi, I'm trying to tie this kind of hash into SDBM $hash_of_baseline{$hdr_user_name} = { user_name => $hdr_user_name, passwd=> $hdr_user_passwd, ... ... groups => [ @info_group_names ] }; I can store it but when

Re: Stupid newb question

2009-03-12 Thread Chuck Lyon
Hi, I thought: 'perl is pretty eclectic, and it's usually simpler than it looks'. Let's give it a try: The following does what you want from an AIX 5.3 (perl 5.8.2) command line perl -e'print system("ls -l")' These are quotes and apostrophes. No "backticks." On 3/11/09 2:36 PM, "neckha...

RE: Network Printing using a Perl Script

2009-03-12 Thread Aglipay, Recelyn
Hi Dave, I'm using a third party application to call the perl script. This application only allows for subroutines to be written since the app also uses some perl. So the code below is all I have. My goal was to open the directory which contains .dat files. Print all of them to the printer. I

Re: unable to connect to all the hosts using Net::SSH2 module

2009-03-12 Thread Gunnar Hjalmarsson
monnappa appaiah wrote: Gunnar Hjalmarsson wrote: monnappa appaiah wrote: I"m sorry for starting the new threadi tried to understand the solution but i couldn't understand much from it, i have used the used eval to trap errors but after that i couldn't understand as i'm new to perl

Re: unable to connect to all the hosts using Net::SSH2 module

2009-03-12 Thread monnappa appaiah
can u suggest me some book or material from which i can understand some advance concepts of perl...i'm refering to learning perl On Thu, Mar 12, 2009 at 3:53 PM, Gunnar Hjalmarsson wrote: > monnappa appaiah wrote: > >> I"m sorry for starting the new threadi tried to understand the >>

Re: Regexp-Question: What is backtracking?

2009-03-12 Thread Erez Schatz
2009/3/12 Deviloper > Can somebody explain what Backtracking is? > > thanx, > B. > In a nutshell, consider the following regex: /foo((b+)ar)/ a regex engine will check every character in the string that is checked against until it reaches the first "f". When reached, it will mark the place and ch

Regexp-Question: What is backtracking?

2009-03-12 Thread Deviloper
This may sound a little bit stupid, but I never ask about "what is up with this regexps behind the curtain". I was lucky when they did what I was expecting... But I´m getting old and want to know more. Can somebody explain what Backtracking is? thanx, B.

Re: unable to connect to all the hosts using Net::SSH2 module

2009-03-12 Thread Gunnar Hjalmarsson
monnappa appaiah wrote: I"m sorry for starting the new threadi tried to understand the solution but i couldn't understand much from it, i have used the used eval to trap errors but after that i couldn't understand as i'm new to perl Maybe the task you are trying to accomplish is somewha

Re: running perl script on remote windows machine

2009-03-12 Thread gvms34
On Feb 6, 2:02 pm, perl...@gmail.com (Perl Pra) wrote: > Hi Hi I am looking for a script which should get information on remote computers. please assist on this.. Best regards Madhusudhan.v > I have a pel script  I want to execute this perl script on remote machine > and get the information r

Re: problem with random arrays

2009-03-12 Thread John W. Krahn
Kammen van, Marco, Springer SBM NL wrote: Hi All, Hello, I'm trying to generate random sentences using a few words, but can't get the thing to work.. I know I'm doing something wrong but what? :-D Any help is appreciated! #!/usr/bin/perl -w #!/usr/bin/perl use warnings; use strict;

Re: problem with random arrays

2009-03-12 Thread Chas. Owens
On Thu, Mar 12, 2009 at 03:40, Kammen van, Marco, Springer SBM NL wrote: > Hi All, > > > > I'm trying to generate random sentences using a few words, but can't get > the thing to work.. > > I know I'm doing something wrong but what? :-D > > > > Any help is appreciated! > > > > > > #!/usr/bin/p

Re: unable to connect to all the hosts using Net::SSH2 module

2009-03-12 Thread monnappa appaiah
Hi Gunnar, I don't get 132 unable to connect host message.but i get this error message Can't call method "exec" on an undefined value at C:\perl-scripts\new_test\test.pl line 22, <$input> line 48. I noted an another interesting thing, if i run the same script for the se

problem with random arrays

2009-03-12 Thread Kammen van, Marco, Springer SBM NL
Hi All, I'm trying to generate random sentences using a few words, but can't get the thing to work.. I know I'm doing something wrong but what? :-D Any help is appreciated! #!/usr/bin/perl -w # my $count = "0"; my $word0 = "aap"; my $word1 = "nood"; my $word2 = "mies