How to skip all tests while using CPAN

2004-09-14 Thread Ramprasad A Padmanabhan
I am installing some perlmodules using CPAN on commandline. Since I am doing this on multiple machines of the same architecture , I want to avoid "make tests" in CPAN , how can I do this ? Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: declaring with my

2004-09-14 Thread John W. Krahn
Gunnar Hjalmarsson wrote: John W. Krahn wrote: Errin Larsen wrote: my @numbers; push @numbers, split while <>; why can't I put that variable declaration in the push function? like this: push my @numbers, split while <>; The original code could be written as: my @numbers; while ( <> ) { push @

How to extract the exact URL

2004-09-14 Thread Franklin Zhang
Hello: Now, there are three kind of URL that I want to extract: 1.2 2.2abcd 2.3 I just want to extract the first URL which fits my condition, so I use: if($line=~m/href="((?:[^"\\]|\\.)*)">2/) But use this method the second also fit it. How can I extact the first URL from the three ind of line

Re: declaring with my

2004-09-14 Thread Errin Larsen
> Because the push() statement is in a loop, and my() would empty > the variable at each iteration. > > -- > Gunnar Hjalmarsson > Email: http://www.gunnar.cc/cgi-bin/contact.pl Hi Gunnar ... Thanks for the help. I assure the list, the following is the code EXACTLY as I was using it to test: #!/u

Re: First module

2004-09-14 Thread Randy W. Sims
On 9/14/2004 8:22 PM, Johnstone, Colin wrote: Gidday all, I have written a module to be used with our CMS 'Teamsite' I wonder if any of you Perl gurus can see any holes in this. It has methods to return the following 1) branch path 2) branch name 3) workarea 4) local path any help appreciated thank

First module

2004-09-14 Thread Johnstone, Colin
Gidday all, I have written a module to be used with our CMS 'Teamsite' I wonder if any of you Perl gurus can see any holes in this. It has methods to return the following 1) branch path 2) branch name 3) workarea 4) local path any help appreciated thank you Colin given the following file path f

Re: declaring with my

2004-09-14 Thread Gunnar Hjalmarsson
John W. Krahn wrote: Errin Larsen wrote: my @numbers; push @numbers, split while <>; why can't I put that variable declaration in the push function? like this: push my @numbers, split while <>; The original code could be written as: my @numbers; while ( <> ) { push @numbers, split; } Is t

Re: declaring with my

2004-09-14 Thread John W. Krahn
Errin Larsen wrote: Hi all, straight out of the Learning Perl book (3rd edition, page 275) is this code: my @numbers; push @numbers, split while <>; foreach (sort { $a <=> $b } @numbers) { printf "%20g\n", $_; } This works flawlessly. My question is why can't I put that variable declaration in

Re: declaring with my

2004-09-14 Thread Gunnar Hjalmarsson
Errin Larsen wrote: Hi all, straight out of the Learning Perl book (3rd edition, page 275) is this code: my @numbers; push @numbers, split while <>; foreach (sort { $a <=> $b } @numbers) { printf "%20g\n", $_; } This works flawlessly. My question is why can't I put that variable declaration in

Re: output to one changing line

2004-09-14 Thread JupiterHost.Net
Chris Devers wrote: On Tue, 14 Sep 2004, JupiterHost.Net wrote: I'd like the line to change as it runs, sort of an animated delivery: I've seen a Damian Conway presentation where he faked out this behavior by prefixing all output with enough backspace ("\h") characters to wipe out the previous

Re: output to one changing line

2004-09-14 Thread Chris Devers
On Tue, 14 Sep 2004, JupiterHost.Net wrote: > I'd like the line to change as it runs, sort of an animated delivery: I've seen a Damian Conway presentation where he faked out this behavior by prefixing all output with enough backspace ("\h") characters to wipe out the previous output and display

declaring with my

2004-09-14 Thread Errin Larsen
Hi all, straight out of the Learning Perl book (3rd edition, page 275) is this code: my @numbers; push @numbers, split while <>; foreach (sort { $a <=> $b } @numbers) { printf "%20g\n", $_; } This works flawlessly. My question is why can't I put that variable declaration in the push function?

output to one changing line

2004-09-14 Thread JupiterHost.Net
Hello list, I've seen this done, but am not sure what its called or where to start looking... Instead of the output of a script via CLI being: # perl script.pl line1 line2 line3 etc # I'd like the line to change as it runs, sort of an animated delivery: As soon as its run it'd look like this: # p

Re: String to Numeric of an Array

2004-09-14 Thread Gunnar Hjalmarsson
Charles K. Clarkson wrote: Edward WIJAYA <[EMAIL PROTECTED]> wrote: I am terribly sorry to have asked such a trivial question. Never be sorry for asking questions. Trivial or complex. We answer questions. If you feel intimidated to ask future questions then we have failed. Even if I see nothing wro

RE: bundle install fails

2004-09-14 Thread u235sentinel
Looks ok to me. What you are probably seeing are the tests usually associated with the CPAN install. It may also find a new version the CPAN.pm module and upgrade it on the fly. It does that every now and then. I didn't see anything to worry about. Looks like the 'make install' worked just

RE: bundle install fails

2004-09-14 Thread James D. Parra
>Sorry for the newbie question, but from where and how do I install the >Convert::BinHex code and build it? > > No worries. I usually go to cpan.org. Here is the direct link to the info page. Lots of good details on how it works. http://search.cpan.org/~eryq/Convert-BinHex-1.119/lib/Convert/B

RE: String to Numeric of an Array

2004-09-14 Thread Charles K. Clarkson
Edward WIJAYA <[EMAIL PROTECTED]> wrote: : : I am terribly sorry to have asked such a trivial : question. Never be sorry for asking questions. Trivial or complex. We answer questions. If you feel intimidated to ask future questions then we have failed. HTH, Charles K. Clarkson -- Mobile

Re: String to Numeric of an Array

2004-09-14 Thread Edward WIJAYA
If you treat the elements of the array as numbers, won't things Just Work ? Thanks a lot for the reply. The reason I asked this because, in one of my regex operation I doubted that the results are correct. Turns out that I am wrong :( I guess I am still living in C-world. I am terribly sorry to h

Re: net::ssh & expect

2004-09-14 Thread Wiggins d Anconia
> On Tue, 14 Sep 2004 07:36:38 -0600, Wiggins d Anconia > <[EMAIL PROTECTED]> wrote: > > > I have a script that I use to ssh to a list of servers to run a few > > > commands. I'm trying to find a way su up & run a command - however I'm > > > in need of some inspiration as to how to pull this off. >

Re: String to Numeric of an Array

2004-09-14 Thread David Greenberg
In a few circumstances, such as binding parameters to a database, you may need to do this, but on the whole, as everyone else has pointed out, Perl will do this for you. If you are using this for one of those few cases, you can change them explicitly like this: @array = ('1','2','3'); @arrayNum =

Re: net::ssh & expect

2004-09-14 Thread john smith
On Tue, 14 Sep 2004 07:36:38 -0600, Wiggins d Anconia <[EMAIL PROTECTED]> wrote: > > I have a script that I use to ssh to a list of servers to run a few > > commands. I'm trying to find a way su up & run a command - however I'm > > in need of some inspiration as to how to pull this off. > > > > Ha

RE: String to Numeric of an Array

2004-09-14 Thread Shaw, Matthew
Edward: What you have there is an array with only one scalar element (an array reference containing 3 values). Note that $array[1] & $array[2] would be undefined in your example. I think what you intended was to do: @array = ('1','2','3'); # An array containing three elements, '1', '2', '3' (Or m

Re: split function

2004-09-14 Thread John W. Krahn
c r wrote: Hi! Hello, Can the perl split function split a random 40 character string into five 8 character strings? No. With random I mean that there is no special pattern in the 40 character string that can be used as split markers. You should probably use a match operator. my @strings = $string =

Re: String to Numeric of an Array

2004-09-14 Thread Chris Devers
On Wed, 15 Sep 2004, Edward WIJAYA wrote: > How can I change the value of this array: > > @array = ['1','2','3']; #which contain "string" numeric > > to > > @arrayNum = [1,2,3]; #as pure numeric Does this even need to be done? If you treat the elements of the array as numbers, won't things

RE: split function

2004-09-14 Thread Jim
> Can the perl split function split a random 40 character > string into five 8 character strings? > > With random I mean that there is no special pattern in the 40 > character string that can be used as split markers. How about unpack? @eights = unpack("A8" x (length($string)/8), $string);

Re: String to Numeric of an Array

2004-09-14 Thread John W. Krahn
Edward WIJAYA wrote: Hi, Hello, How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric As far as perl is concerned they are the same. If you use a string in numeric context it becomes a number and if you use a nu

Re: split function

2004-09-14 Thread Chris Devers
On Tue, 14 Sep 2004, c r wrote: > Can the perl split function split a random 40 character string into > five 8 character strings? > > With random I mean that there is no special pattern in the 40 > character string that can be used as split markers. Wouldn't substr make more sense, or a regex?

Re: split function

2004-09-14 Thread Gunnar Hjalmarsson
C r wrote: Can the perl split function split a random 40 character string into five 8 character strings? With random I mean that there is no special pattern in the 40 character string that can be used as split markers. Don't know, but in any case the m// operator is a better way to do that: my

Re: split function

2004-09-14 Thread Wiggins d Anconia
> > Hi! > > Can the perl split function split a random 40 character string into five 8 character strings? > > With random I mean that there is no special pattern in the 40 character string that can be used as split markers. > This smells like homework? (just a reminder to the gurus, it is t

Re: String to Numeric of an Array

2004-09-14 Thread Gunnar Hjalmarsson
Edward WIJAYA wrote: How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric Why would you need that? my $string = '5'; my $number = 5; print "Equal\n" if $string == $number; -- Gunnar Hjalmarsson Email:

Re: net::ssh & expect

2004-09-14 Thread Wiggins d Anconia
> I have a script that I use to ssh to a list of servers to run a few > commands. I'm trying to find a way su up & run a command - however I'm > in need of some inspiration as to how to pull this off. > Have you considered 'sudo' instead? It would make this task much easier, would eliminate the n

String to Numeric of an Array

2004-09-14 Thread Edward WIJAYA
Hi, How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric Regards, Edward WIJAY -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

split function

2004-09-14 Thread c r
Hi! Can the perl split function split a random 40 character string into five 8 character strings? With random I mean that there is no special pattern in the 40 character string that can be used as split markers. Yahoo! Mail - Gratis: 6 MB lagerplads, spamfilter og virusscan

Problem with ssh and STDIN

2004-09-14 Thread Ohad Ohad
I encounter a weird problem. When I try to execute : system( ssh -x server_name command) It seems to close my STDIN Any idea why that happens and how can I solve it? _ Tired of spam? Get advanced junk mail protection with MSN 8. http:

RE: Regex help

2004-09-14 Thread Jim
> So in short the regex must remove any characters from the > anchor text e.g the & in 'News & events' > and any spaces, basically any characters that cannot be used > in a filename if they have been inadvertently entered by the users. What kind of file names? DOS, UNIX, Other? --- Outgoing

net::ssh & expect

2004-09-14 Thread john smith
I have a script that I use to ssh to a list of servers to run a few commands. I'm trying to find a way su up & run a command - however I'm in need of some inspiration as to how to pull this off. Heres the script template for reference:- #!/usr/bin/perl -w use strict; use Term::ReadKey; use Net:

RE: Regex help

2004-09-14 Thread Chris Devers
On Tue, 14 Sep 2004, Johnstone, Colin wrote: > I found this regex by searching on google and I assumed the guy who > wrote it knew more than me. >From the look of this regex, that ain't necessarily so. The thing with regular expressions is that they tend to be crafted for very specific purpose

RE: Regex help

2004-09-14 Thread Jenda Krynicky
From: "Johnstone, Colin" <[EMAIL PROTECTED]> > rather than re-invent the wheel I would prefer if you could fix this > regex I believe it covers all invalid characters one would encounter > > s/[\w\&%'[EMAIL PROTECTED](\)&_\\+,\.=\[\]]//g; > > I would then use it as a general purpose regex for val

Re: Regex help

2004-09-14 Thread Gunnar Hjalmarsson
[ Please type your reply below the quoted part of the message you reply to. ] Colin Johnstone wrote: Jim wrote: Colin Johnstone wrote: I firstly need to remove any invalid characters (including spaces) $filename = 'News & events'; $filename =~ s/[\w\&%'[EMAIL PROTECTED](\)&_\\+,\.=\[\]]//g; then co