Re: while reading 'mastering perl' @+ and @-, not too clear on this

2008-03-24 Thread brian d foy
In article [EMAIL PROTECTED], Richard Lee [EMAIL PROTECTED] wrote: While reading 'mastering perl', I run into @- and @+ for the first time. Trying to understand what's going on, I ran the code from the book, but $-[1] and $+[1] shoudln't match only the first match? (in this case, shoudln't

Re: how to replace @ inside of { }

2008-03-24 Thread Richard Lee
Gunnar Hjalmarsson wrote: Chas. Owens wrote: On Sat, Mar 22, 2008 at 11:53 PM, Richard Lee [EMAIL PROTECTED] wrote: snip @{ $HoH{$1} }{ @{ $HoA{$1} } } = split; This is really spinning my heads in all direction trying to see if I can truly understand them instead of just using it. snip

Re: how to replace @ inside of { }

2008-03-24 Thread Gunnar Hjalmarsson
Richard Lee wrote: say I have @data which below was pushed(bunch of them) with below hash of hash refernce $VAR1 = { 'element' = { 'element2' = 'now', 'element3' = '2', 'element4' =

how do check th argument is passing to running file

2008-03-24 Thread sivasakthi
Hi all, How we can check the argument is passing to the running file or not? #sample.pl 2008 03 i want to check the two arguments of 2008 03 is passed to sample.pl or not.. Thanks,

RE: diff of two files

2008-03-24 Thread Irfan.Sayed
No it is not a homework. It's a official script which I want to make it into production??? Please help. Regards, Irfan -Original Message- From: Ken Foskey [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:48 PM To: beginners@perl.org Subject: RE: diff of two files Sounds

Re: how do I shorten this code

2008-03-24 Thread itshardtogetone
Hi , Looking at the reg expression ( $playercard1 =~ /10|J|Q|K/ ), it will match 0, 1, and '10' , J, Q, K What must I do so that it will match only '10' , 'J', 'Q', and 'K' Thanks - Original Message - From: Rodrick Brown [EMAIL PROTECTED] #!/usr/bin/perl -w use strict; use

Re: how do check th argument is passing to running file

2008-03-24 Thread yitzle
Arguments are passed in the @ARGV array. You can access $ARGV[0] and $ARGV[1] unless (defined $ARV[0] and defined $ARGV[1]) { die You need to supply two arguments\n; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how do I shorten this code

2008-03-24 Thread yitzle
On Mon, Mar 24, 2008 at 9:00 AM, [EMAIL PROTECTED] wrote: Hi , Looking at the reg expression ( $playercard1 =~ /10|J|Q|K/ ), it will match 0, 1, and '10' , J, Q, K What must I do so that it will match only '10' , 'J', 'Q', and 'K' Thanks /10|J|Q|K/ will not match 0 or 1 alone. It will

Re: how do check th argument is passing to running file

2008-03-24 Thread ken Foskey
On Mon, 2008-03-24 at 17:46 +0530, sivasakthi wrote: Hi all, How we can check the argument is passing to the running file or not? #sample.pl 2008 03 i want to check the two arguments of 2008 03 is passed to sample.pl or not.. if( defined $ARGV[1] ) { die Two arguments required\n

Re: how do check th argument is passing to running file

2008-03-24 Thread John W. Krahn
sivasakthi wrote: Hi all, Hello, How we can check the argument is passing to the running file or not? #sample.pl 2008 03 i want to check the two arguments of 2008 03 is passed to sample.pl or not.. @ARGV == 2 or die You must supply two arguments!\n; John -- Perl isn't a toolbox, but

algorithm/permute.pm

2008-03-24 Thread Sharan Basappa
Hi, I am trying to use permute call from the above module and I get the following error. I believe this is due to either missing lib or incorrect path setting. Can you tell me how to install this package quickly in my home path and try out this call? Regards Can't locate Algorithm/Permute.pm in

Concatenating Strings

2008-03-24 Thread Bobby
Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA . $count;). Right now my script is printing $strB as below. How do i get perl to print

Re: Concatenating Strings

2008-03-24 Thread Wolf
Bobby [EMAIL PROTECTED] wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA . $count;). Right now my script is

Re: Concatenating Strings

2008-03-24 Thread Bobby
Wolf, I still don't understand, so set my $strB = $strA($count); ? That didn't worked. Wolf [EMAIL PROTECTED] wrote: Bobby wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0

Re: Concatenating Strings

2008-03-24 Thread Wolf
Bobby [EMAIL PROTECTED] wrote: Wolf, I still don't understand, so set my $strB = $strA($count); ? That didn't worked. Wolf [EMAIL PROTECTED] wrote: Bobby wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3.

Re: Concatenating Strings

2008-03-24 Thread yitzle
IIRC, Perl does not let you use a string to build a variable name like PHP does. If you do this: $myVar = 123; $varName = myVar; print $varName; You get myVar and not 123 which seems to be what you want. However, I think you might be able to use hashes and get what you want. $hash{myVar} =

Re: Concatenating Strings

2008-03-24 Thread Bobby
Thanks for both of your suggestions. I've tried them both but still getting same result. Any other suggestions? Thanks. Wolf [EMAIL PROTECTED] wrote: Bobby wrote: Wolf, I still don't understand, so set my $strB = $strA($count); ? That didn't worked. Wolf wrote:

Re: Concatenating Strings

2008-03-24 Thread Wolf
Grab a perl book or search the web for concatenating variables together... Unfortunately the current place I am in doesn't have perl on the server for me to try and play around more, but the gist is the same. Your problem arise from setting it up as string during the concatination process.

Re: Concatenating Strings

2008-03-24 Thread Jenda Krynicky
Bobby wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA . $count;). Right now my script is printing $strB as below.

Re: algorithm/permute.pm

2008-03-24 Thread Paul Lalli
On Mar 24, 11:52 am, [EMAIL PROTECTED] (Sharan Basappa) wrote: Hi, I am trying to use permute call from the above module and I get the following error. I believe this is due to either missing lib or incorrect path setting. Can you tell me how to install this package quickly in my home path

Re: Concatenating Strings

2008-03-24 Thread Gunnar Hjalmarsson
Bobby wrote: I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA . $count;). Right now my script is printing $strB as below. How do i get perl to

Re: Concatenating Strings

2008-03-24 Thread kens
On Mar 24, 12:09 pm, [EMAIL PROTECTED] (Bobby) wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA . $count;). Right now my

Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a polling process that runs 24x7 ( internal site ) and for the most part has no problems except that they shutdown the the internal site every three or four weeks and my process then dies. I have a simple setup: $MyFtp = Net::FTP-new($GlblInfo{ipaddr}, Debug = 1);

Re: Concatenating Strings

2008-03-24 Thread Gunnar Hjalmarsson
yitzle wrote: IIRC, Perl does not let you use a string to build a variable name like PHP does. Then you do not remember it correctly. If you do this: $myVar = 123; $varName = myVar; print $varName; You get myVar and not 123 Sure, but if you replace the last line with print

Re: Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread yitzle
1) Can you set a really long timeout? 2) When I asked about doing something similar with Mechanize-get(), someone suggested wrapping the call in an eval block and testing the exit status of the function call. Or something like that. Would that approach work here? -- To unsubscribe, e-mail:

Re: diff of two files

2008-03-24 Thread Chas. Owens
On Mon, Mar 24, 2008 at 8:33 AM, [EMAIL PROTECTED] wrote: No it is not a homework. It's a official script which I want to make it into production??? snip Diff /tmp/dev_path_PRS.DB.01.12.000 /tmp/dep_path_D.PRS.DB.01.12.000.8 snip Diff is not a Perl command; however, there is a diff (note

Re: Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread Chas. Owens
On Mon, Mar 24, 2008 at 2:25 PM, Wagner, David --- Senior Programmer Analyst --- WGO [EMAIL PROTECTED] wrote: I have a polling process that runs 24x7 ( internal site ) and for the most part has no problems except that they shutdown the the internal site every three or four weeks and my

Re: diff of two files

2008-03-24 Thread Octavian Rasnita
Here is a diff program made in perl: #!/usr/bin/perl # # `Diff' program in Perl # Copyright 1998 M-J. Dominus. ([EMAIL PROTECTED]) # # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # # Altered to output in `context diff' format

RE: Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message- From: Chas. Owens [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2008 11:42 To: Wagner, David --- Senior Programmer Analyst --- WGO Cc: Perl Beginners Subject: Re: Looking for example of how to keep an FTP processing running if the Ip Address is down or

Re: how to replace @ inside of { }

2008-03-24 Thread Richard Lee
Gunnar Hjalmarsson wrote: Richard Lee wrote: say I have @data which below was pushed(bunch of them) with below hash of hash refernce $VAR1 = { 'element' = { 'element2' = 'now', 'element3' = '2',

Re: how to replace @ inside of { }

2008-03-24 Thread Gunnar Hjalmarsson
Richard Lee wrote: below is hash of hash? No, it's not. It's a failed attempt to try to imitate what's outputted when you use Data::Dumper to print a hash of hashes. how do I dereference them (all of them)? C:\hometype test.pl my %HoH = ( 'number' = { 'three' = '21',

Re: how to replace @ inside of { }

2008-03-24 Thread Rob Dixon
Richard Lee wrote: Gunnar Hjalmarsson wrote: C:\hometype test.pl use Data::Dumper; my %HoA = ( something = [ qw/val1 val2 val3 and so forth/ ], something2 = [ qw/vala valb valc and so forth/ ], something3 = [ qw/valZ valZ1 valZ2 so forth/ ], ); my %HoH; while ( DATA ) {

Re: how to replace @ inside of { }

2008-03-24 Thread Rob Dixon
Richard Lee wrote: say I have @data which below was pushed(bunch of them) with below hash of hash refernce $VAR1 = { 'element' = { 'element2' = 'now', 'element3' = '2', 'element4' =

Re: how to replace @ inside of { }

2008-03-24 Thread Rob Dixon
Richard Lee wrote: let's say I have @someting = qw/1 2 3 4/; @something2 = qw/110 11 12/; @something3 = qw/20 30 40 50/; and I get the name of array from regular expression match something like this from some other file $_ =~ /^(\S+) \s\s$/; so, now $1 is either something or

Re: Concatenating Strings

2008-03-24 Thread Rob Dixon
Bobby wrote: Hi all, I'm trying to write a simple do until loop to print out the value of $strA0 through $striA3. What i'm doing is replacing the value of 0 through 3 in the $strA by joining two strings (my $strB = strA. $count;). Right now my script is printing $strB as below. How do i get

Re: Concatenating Strings

2008-03-24 Thread Randal L. Schwartz
Bobby == Bobby [EMAIL PROTECTED] writes: Bobby I'm trying to write a simple do until loop to print out the value of Bobby $strA0 through $striA3. If your variable names are named sequentially, you've almost always done something wrong. Please rethink your problem, keeping data structures in

Re: Concatenating Strings

2008-03-24 Thread Rob Dixon
kens wrote: # Or if you must use a counter my $count = 0; while ( defined($strA[$count]) ) { print $strA[$count++]\n; } for my $count (0 .. $#strA) { print [$count] = $strA[$count]\n; } **OR** my $count = 0; foreach (@strA) { print [$count] = $strA[$count]\n; $count++; } Rob

Re: help witht he ffmpeg::Command perl module

2008-03-24 Thread Nasser Al-Hilal
Hi Rob, I've set it up just as you recommended. I also opened up the module file it did seem that I was trying to look for a value it was not returning, however, I could not really test if it was working or not. I could not debug it. To me, it seemed even a little advanced. The file was not