Re: sub alias name

2008-08-27 Thread Jeff Pang
> Message du 27/08/08 21:21 > De : "Raja Vadlamudi" > A : "Perl Beginners" > Copie à : > Objet : Re: sub alias name > > Or you might just want to use typeglob for only sub-routine. > > *real_long_fund = \& really_long_function_name_i_do_not_like_to_type; > or use an alias to the alias: *real_lo

Re: Question on Perl

2008-08-27 Thread dan
On Wed, 27 Aug 2008 06:29:53 -0700 (PDT), [EMAIL PROTECTED] wrote: > Hi All, > > I am learning how to use Perl. When I was first time using VBA, I > could use "F8" to track how all the variables change each by each and > step by step so that I can understand how the whole coding flows. Is > there

Re: Question on Perl

2008-08-27 Thread Raymond Wan
Hi Jin Hoo, Jenda Krynicky wrote: From: [EMAIL PROTECTED] I am learning how to use Perl. When I was first time using VBA, I could use "F8" to track how all the variables change each by each and step by step so that I can understand how the whole coding flows. Is there any method to do so (

Re: taking a total line from a filehandel

2008-08-27 Thread Rob Dixon
Anirban Adhikary wrote: > Dear List > I have a source file as follows > hello how are you? > hello how are you? > What language did you want to use? > What language did you want to use? > I am here > You are there > this is my first perl script > What language did you want to use? > ###

Re: Multi-line regex?

2008-08-27 Thread Rob Dixon
STEVEN WHALEY wrote: > > The program I'm trying to write requires me to grab a specific set of > multiline output from a command and store it in an array. I have output > that looks like this: > [lengthy data snipped] > > and make each line an entry in an array. I do not actually need the > fir

Re: Multi-line regex?

2008-08-27 Thread John W. Krahn
STEVEN WHALEY wrote: First off, hello everyone. Hello, The program I'm trying to write requires me to grab a specific set of multiline output from a command and store it in an array. I have output that looks like this: Hosts associated with this datastore. ag-vmsql01-srv.agbr.com ag

Re: Multi-line regex?

2008-08-27 Thread Mr. Shawn H. Corey
On Wed, 2008-08-27 at 16:54 -0500, STEVEN WHALEY wrote: > and make each line an entry in an array. I do not actually need the > first two lines, but I can pop them off so grabbing them isn't a > problem. I can get a regex to match the "Folder Path:..." line but > I'm > not sure how to get the res

Multi-line regex?

2008-08-27 Thread STEVEN WHALEY
First off, hello everyone. The program I'm trying to write requires me to grab a specific set of multiline output from a command and store it in an array. I have output that looks like this: Hosts associated with this datastore. ag-vmsql01-srv.agbr.com ag-vmsql01-srv.agbr.com ag-vmsq

Re: sub alias name

2008-08-27 Thread John W. Krahn
[ Please do not top-post. TIA ] Raja Vadlamudi wrote: On 8/27/08 3:02 PM, "John W. Krahn" <[EMAIL PROTECTED]> wrote: Ryan wrote: sub really_long_function_name_i_do_not_like_to_type {return 'data';} can I create some kind of alias, like real_long_func ? Using a typeglob copy: $ perl -le

Re: sub alias name

2008-08-27 Thread Raja Vadlamudi
Or you might just want to use typeglob for only sub-routine. *real_long_fund = \& really_long_function_name_i_do_not_like_to_type; On 8/27/08 3:02 PM, "John W. Krahn" <[EMAIL PROTECTED]> wrote: > Ryan wrote: >> given: >> >> sub really_long_function_name_i_do_not_like_to_type {return 'data';} >

Re: sub alias name

2008-08-27 Thread John W. Krahn
Ryan wrote: given: sub really_long_function_name_i_do_not_like_to_type {return 'data';} can I create some kind of alias, like real_long_func ? how? Using a typeglob copy: $ perl -le' sub really_long_function_name_i_do_not_like_to_type { return q/data/ } print really_long_function_name_i_do_

Re: sub alias name

2008-08-27 Thread Rob Coops
Of course you can... sub really_long_function_name_i_do_not_like_to_type {return 'data';} sub short_func { return really_long_function_name_i_do_not_like_to_type(); } Should do the trick, Rob On Wed, Aug 27, 2008 at 8:44 PM, Ryan <[EMAIL PROTECTED]> wrote: > given: > > sub really_long_functio

sub alias name

2008-08-27 Thread Ryan
given: sub really_long_function_name_i_do_not_like_to_type {return 'data';} can I create some kind of alias, like real_long_func ? how? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: what is the best GUI to display this result

2008-08-27 Thread Aruna Goke
zentara wrote: On Tue, 26 Aug 2008 18:09:58 +0100, [EMAIL PROTECTED] (Aruna Goke) wrote: ... __END__ zentara Thanks Zentara, I have edited the code as below.. however, I wanted to be able to scroll both horizontally and vertically so that i can see all the n

Shell outpur redirect, perl input issue linux

2008-08-27 Thread TADIPAH
I have the following command that redirects output from the script to temp.txt. system "ssh -x -t $_ \"sudo /home/tadipah/test.sh\" > temp.txt "; If I open the file temp.txt, I can see one word "jboss"; I tried to print it using the code below: open TESTFILE, "temp.txt"; @srv=; chomp(@srv);

Re: what is the best GUI to display this result

2008-08-27 Thread Rob Dixon
Aruna Goke wrote: > I am writing a raffle draw promo using perl and i have the script as below. > > what i intend to achieve is to print all the numbers in the array to gui > screen, clear the screen and display randomly selected one as the winner. > > however, I have run my script in the cmd li

Re: HV in XS

2008-08-27 Thread Rob Dixon
Patrick Dupre wrote: > I am trying to explain, > > Here are the 2 perl subroutines: > sub sub1 { >my %a ; >$a {a} = 1 ; >$a {b} = 2 ; >foreach (keys %a) { > print $_, " => ", $a {$_}, "\n" ; > } >return \%a ; >} > > sub sub2 { >my ($h) = @_ ; >foreach (ke

Re: what is the best GUI to display this result

2008-08-27 Thread Aruna Goke
zentara wrote: On Tue, 26 Aug 2008 18:09:58 +0100, [EMAIL PROTECTED] (Aruna Goke) wrote: I am writing a raffle draw promo using perl and i have the script as below. what i intend to achieve is to print all the numbers in the array to gui screen, clear the screen and display randomly selected

Re: Question on Perl

2008-08-27 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > I am learning how to use Perl. When I was first time using VBA, I > could use "F8" to track how all the variables change each by each and > step by step so that I can understand how the whole coding flows. Is > there any method to do so (or similar) in Perl? Many thanks!

Re: Repeating the loop

2008-08-27 Thread John W. Krahn
Arun wrote: Hi, i am new to perl so i uat wanted some help. i wanted the followinf loop to be repeated for every 30 seconds. $send_data = strftime( "::DATA::123456789101112,%d.%m.%Y,%H:%M:%S, 13.0076367,77.5489267,0,933.4,AirTel,31,0 \n", gmtime); DATA: {while(1) { $handle-

Re: taking a total line from a filehandel

2008-08-27 Thread John W. Krahn
Anirban Adhikary wrote: Dear List Hello, I have a source file as follows hello how are you? hello how are you? What language did you want to use? What language did you want to use? I am here You are there this is my first perl script What language did you want to use?

Repeating the loop

2008-08-27 Thread Arun
Hi, i am new to perl so i uat wanted some help. i wanted the followinf loop to be repeated for every 30 seconds. $send_data = strftime( "::DATA::123456789101112,%d.%m.%Y,%H:%M:%S, 13.0076367,77.5489267,0,933.4,AirTel,31,0 \n", gmtime); DATA: {while(1) { $handle-> send($send_d

Re: Question on Perl

2008-08-27 Thread Mr. Shawn H. Corey
On Wed, 2008-08-27 at 15:55 +0100, Pat Rice wrote: > Hi ya > I put mine in if statements, then you can turn them of and on globally > > if(debug == 1){ > print "$bla" > } Use Data::Dumper to see all levels of a variable: use Data::Dumper; print '%var : ', Dumper \%var if $debug == 1; -- Just

Re: Question on Perl

2008-08-27 Thread Pat Rice
Hi ya I put mine in if statements, then you can turn them of and on globally if(debug == 1){ print "$bla" } hope that helps Pat On Wed, Aug 27, 2008 at 3:47 PM, Jeff Pang <[EMAIL PROTECTED]> wrote: > >> Message du 27/08/08 16:31 >> De : [EMAIL PROTECTED] >> A : beginners@perl.org >> Copie à : >>

Re: HV in XS

2008-08-27 Thread Patrick Dupre
I am trying to explain, Here are the 2 perl subroutines: sub sub1 { my %a ; $a {a} = 1 ; $a {b} = 2 ; foreach (keys %a) { print $_, " => ", $a {$_}, "\n" ; } return \%a ; } sub sub2 { my ($h) = @_ ; foreach (keys %$h) { print $_, " => ", $$h {$_}, "\n" ; } } +++

Re:Question on Perl

2008-08-27 Thread Jeff Pang
> Message du 27/08/08 16:31 > De : [EMAIL PROTECTED] > A : beginners@perl.org > Copie à : > Objet : Question on Perl > > > Hi All, > > I am learning how to use Perl. When I was first time using VBA, I > could use "F8" to track how all the variables change each by each and > step by step so that I

Re: encrypt a text file

2008-08-27 Thread Bryan R Harris
> hello, > > how to encrypt a text file and decrypt it with perl? > > for example, I have a config file, > > svr.conf > > I want to encrypt it to svr.conf.encrypt. > > But I should also have the ability to decrypt the encryped one to the > original text. > > Any suggestion is welcome. than

Re: Question on Perl

2008-08-27 Thread Mr. Shawn H. Corey
On Wed, 2008-08-27 at 06:29 -0700, [EMAIL PROTECTED] wrote: > Hi All, > > I am learning how to use Perl. When I was first time using VBA, I > could use "F8" to track how all the variables change each by each and > step by step so that I can understand how the whole coding flows. Is > there any met

Question on Perl

2008-08-27 Thread leejinhoo
Hi All, I am learning how to use Perl. When I was first time using VBA, I could use "F8" to track how all the variables change each by each and step by step so that I can understand how the whole coding flows. Is there any method to do so (or similar) in Perl? Many thanks! Best regards, Ronald

Re: Perl and "vi" (not "vim") , ctags like feature in Perl !

2008-08-27 Thread asmith9983
Hi The program is called "screen" just in case you are looking fo it. The first sentence from the man page says "Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells)." On Linux I also use Ctrl-Z whrn in vim to go o

Re: encrypt a text file

2008-08-27 Thread Dan Baker
[EMAIL PROTECTED] wrote: how to encrypt a text file and decrypt it with perl? for example, I have a config file, svr.conf I want to encrypt it to svr.conf.encrypt. But I should also have the ability to decrypt the encryped one to the original text. when using crypt

Re: HV in XS

2008-08-27 Thread Rob Dixon
Patrick Dupre wrote: > Rob Dixon wrote: >> >> It would be nice to have been told the symptoms you are getting, as your code >> looks basically correct. >> >> All I can see that is wrong is that you need to add PUSHMARK(SP) before the >> call to the Perl subroutine to mark the end of any parameter

Re: HV in XS

2008-08-27 Thread Patrick Dupre
Hello Rob, I am trying to investigate more, but, one problem seems to that that the SvTYPE (ret) is 3, ie that it is a RV reference when it should be a hash reference. Am I correct ? Patrick Dupre wrote: I am desesperated ! Assuming the following perl sub: sub sub1 { my %a ; $a {a} = 1

Re: matching ' in regx

2008-08-27 Thread Mr. Shawn H. Corey
On Tue, 2008-08-26 at 22:31 -0600, Dan Baker wrote: > There must be some really odd stuff going on with html encoding or regx! > Anyway, if I change my match to :: I can now catch the situation... not > that I understand how a ' gets changed to :: In Perl version 4, a single quote was use to de-re

Re: HV in XS

2008-08-27 Thread Rob Dixon
Patrick Dupre wrote: > > I am desesperated ! > > Assuming the following perl sub: > sub sub1 { >my %a ; >$a {a} = 1 ; >$a {b} = 2 ; >foreach (keys %a) { > print $_, " => ", $a {$_}, "\n" ; > } >return \%a ; >} > > Using XS, I am tring to get the hash using: >

RE: perl script on remote server linux

2008-08-27 Thread Jeff Pang
> Message du 27/08/08 11:51 > De : "Irfan J Sayed (isayed)" > A : "Jeff Pang" > Copie à : beginners@perl.org > Objet : RE: perl script on remote server linux > > > > Thanks Jeff. It really helped. > Just one doubt, if we can perform operation with ssh then why we require > Net::SSH module??

Re: matching ' in regx

2008-08-27 Thread Jenda Krynicky
From: Dan Baker <[EMAIL PROTECTED]> > I have a thing driving me NUTS trying to detect a ' in a variable > with regex, and either strip it out or at least detect and error out. > for instance, this just does NOT work. DO NOT TEST FOR DANGEROUS CHARACTERS! MAKE SURE YOU ONLY HAVE THE SAFE ONE

RE: perl script on remote server linux

2008-08-27 Thread Irfan J Sayed (isayed)
Thanks Jeff. It really helped. Just one doubt, if we can perform operation with ssh then why we require Net::SSH module?? Regards Irf. -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2008 2:32 PM To: Irfan J Sayed (isayed) Cc: beginners@perl.o

Re: perl script on remote server linux

2008-08-27 Thread Raymond Wan
Raymond Wan wrote: Assuming we are using the same ssh, isn't the login name for ssh is supplied using the "-l" parameter (lowercase L)? Give it a try on the command line before putting it in the script so that you can figure out what is wrong easier. Sorry Irfan and thanks Jeff...I was wron

Re: perl script on remote server linux

2008-08-27 Thread Raymond Wan
Hi Irfan, Assuming we are using the same ssh, isn't the login name for ssh is supplied using the "-l" parameter (lowercase L)? Give it a try on the command line before putting it in the script so that you can figure out what is wrong easier. Ray Irfan J Sayed (isayed) wrote: Hi, In my

RE: perl script on remote server linux

2008-08-27 Thread Jeff Pang
> system "ssh [EMAIL PROTECTED] /home/cgadgil/avm2.1/launchtomcat.sh"; you need a "\" before the "@". modify it to: system "ssh [EMAIL PROTECTED] /home/cgadgil/avm2.1/launchtomcat.sh"; Créez votre adresse électronique [EMAIL PROTECTED] 1 Go d'espace de stockage, anti-spam et anti-virus intégr

RE: perl script on remote server linux

2008-08-27 Thread Irfan J Sayed (isayed)
Hi, In my case, the user with which I am executing the script is not there in sudoers file. So I did in the following manner. #!/usr/bin/perl open FILE, "server_list" or die $!; while() { print "the host is: $_"; chomp; system "ssh [EMAIL PROTECTED] /home/cgadgil/avm2.1/launchtomcat

Re: taking a total line from a filehandel

2008-08-27 Thread Xavier Mas
El Wednesday 27 August 2008 10:20:50 Anirban Adhikary va escriure: > Dear List > I have a source file as follows > hello how are you? > hello how are you? > What language did you want to use? > What language did you want to use? > I am here > You are there > this is my first perl script > What lang

Re: encrypt a text file

2008-08-27 Thread Xavier Mas
El Wednesday 27 August 2008 08:28:40 [EMAIL PROTECTED] va escriure: > hello, > > how to encrypt a text file and decrypt it with perl? > > for example, I have a config file, > > svr.conf > > I want to encrypt it to svr.conf.encrypt. > > But I should also have the ability to decrypt the encryped one

Re:taking a total line from a filehandel

2008-08-27 Thread Jeff Pang
Hello, for removing the spaces, try s/\s//g, like: # perl -e '$x="multi words with spaces";$x=~s/\s//g;print $x' multiwordswithspaces Créez votre adresse électronique [EMAIL PROTECTED] 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

taking a total line from a filehandel

2008-08-27 Thread Anirban Adhikary
Dear List I have a source file as follows hello how are you? hello how are you? What language did you want to use? What language did you want to use? I am here You are there this is my first perl script What language did you want to use? I want t