array help

2001-06-19 Thread Yacketta, Ronald
Folks, Can someone shed some light on this little blunder of mine? opendir DIR, "../logs/set1" or die "Can't open ../logs/set1: $!"; @allFiles = readdir DIR; closedir DIR; foreach (@allFiles) { if( ($count % 3) == 0 ) { push(@logFiles1,$_); } else {

array help

2006-04-13 Thread Irfan J Sayed
Hi, I am executing following command. my @activity = system "cleartool lsactivity -short -view Admin_Irfan_Project_int"; but the output of this command is not storing in the array. array is empty. plz help Regards Irfan Sayed

array help

2006-07-20 Thread Sayed, Irfan \(Irfan\)
Hi, I have written following line. but i am getting error my @test = ("/test" , "/playground"); print @test; i am getting output as follows /test/playground i need the output in following fasion /test /playground can you please tell me what is wrong? Regards Irfan.

array help

2006-07-20 Thread Sayed, Irfan \(Irfan\)
Hi, I have written following line. but i am getting error my @test = ("/test" , "/playground"); print @test; i am getting output as follows /test/playground i need the output in following fasion /test /playground can you please tell me what is wrong? Regards Irfan.

array help

2006-09-20 Thread Sayed, Irfan \(Irfan\)
Hi, if i use one array in foreach loop then can i use same array in another part of the code. I am getting following error while executing perl script. Global symbol "@repl1" requires explicit package name at ch_repl_name.pl line 24. can anybody please help me. Regards Irfan.

Re: array help

2006-04-13 Thread Tom Phoenix
On 4/13/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > I am executing following command. > > my @activity = system "cleartool lsactivity -short -view > Admin_Irfan_Project_int"; You seem to want backticks, also known as qx// . You can find it in the perlop manpage, in the section on "Quote and Qu

RE: array help

2006-04-13 Thread Ankur Gupta
Irfan J Sayed scribbled on Thursday, April 13, 2006 9:46 AM: > Hi, > > I am executing following command. > > my @activity = system "cleartool lsactivity -short -view > Admin_Irfan_Project_int"; > > but the output of this command is not storing in the array. array is

RE: array help

2006-07-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Sayed, Irfan (Irfan) wrote: > Hi, > > I have written following line. but i am getting error > > my @test = ("/test" , "/playground"); > print @test; > > i am getting output as follows > > /test/playground > > i need the output in following fasion > > /test > /playground > > can you please t

Re: array help

2006-07-20 Thread Hal Wigoda
you have to add a "\n" between the 2 elements in the array. On Jul 20, 2006, at 9:51 AM, Sayed, Irfan ((Irfan)) wrote: Hi, I have written following line. but i am getting error my @test = ("/test" , "/playground"); print @test; i am getting output as follows /test/playground i need the o

Re: array help

2006-07-20 Thread Hal Wigoda
#!/usr/bin/perl my @test = ("/test" , "/playground"); print @test; print "\n"; print @test[0],"\n"; print @test[1],"\n"; you must print each array item with a \n On Jul 20, 2006, at 9:33 AM, Sayed, Irfan ((Irfan)) wrote: Hi, I have written following line. but i am getting error my @test =

Re: array help

2006-07-20 Thread Maxim
Hi, Use foreach smth like foreach $i (@test) { print "$i\n"; } On Thu, Jul 20, 2006 at 10:51:58PM +0800, Sayed, Irfan (Irfan) wrote: > Hi, > > I have written following line. but i am getting error > > my @test = ("/test" , "/playground"); > print @test; > > i am getting

Re: array help

2006-07-20 Thread Chad Perrin
On Thu, Jul 20, 2006 at 10:51:58PM +0800, Sayed, Irfan (Irfan) wrote: > Hi, > > I have written following line. but i am getting error > > my @test = ("/test" , "/playground"); > print @test; > > i am getting output as follows > > /test/playground > > i need the output in following fasion

Recall: array help

2006-07-20 Thread Sayed, Irfan \(Irfan\)
Sayed, Irfan (Irfan) would like to recall the message, "array help".

Re: array help

2006-07-20 Thread Dr.Ruud
"Sayed, Irfan (Irfan)" schreef: > I have written following line. but i am getting error Which error? > my @test = ("/test" , "/playground"); > print @test; > > i am getting output as follows > > /test/playground > > i need the output in following fasion > > /test > /playground > > can you plea

RE: array help

2006-07-20 Thread Timothy Johnson
-Original Message- From: Dr.Ruud [mailto:[EMAIL PROTECTED] Sent: Thursday, July 20, 2006 4:18 PM To: beginners@perl.org Subject: Re: array help >> my @test = ("/test" , "/playground"); >> print @test; >> >> >> >> i need t

Re: array help

2006-09-20 Thread Igor Lopes
Global symbol "@repl1" requires explicit package name at ch_repl_name.pl line 24. It seems you are using strict, but not declaring @repl1 anywhere. If you post your code will be easier to help. -- Igor Lopes <[EMAIL PROTECTED]>

RE: array help

2006-09-20 Thread Sayed, Irfan \(Irfan\)
lice(my @repl1, -50); print @vob_rep; #close FILE1; I already declared the @repl1 in foreach loop. Please help Regards Irfan _ From: Igor Lopes [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 11:02 PM To: Sayed, Irfan (Irfan) Cc: beginners@perl.org Subject: R

RE: array help

2006-09-21 Thread Lee Goddard
> if i use one array in foreach loop then can i use same array > in another part of the code. What do you think? Have you actually tried to do this? Perhaps you could submit the smallest possible piece of code illustrate your prediciment? -- http://www.bbc.co.uk/ This e-mail (and any attachm

Re: array help

2006-09-21 Thread John W. Krahn
Sayed, Irfan (Irfan) wrote: > Here is my code > > # Perl script to change the replica name > > use strict; > use warnings; > > > # my $fname = "/tmp/vob_list1"; > # open FILE,">",$fname or die $!; > # my $fname1 = "/tmp/repl_list1"; > # open FILE1,">",$fname1 or die $!; > > my $CT = '/

Unique Array Help?

2012-05-17 Thread Omega -1911
Hello all - While trying to create a script that generates a graph, I am at a loss for a workable solution. What I need to be able to do in the code below is add the results from the select statement before pushing the data into an array. For example, the database contains the following data: EMP

Array help needed please

2004-05-26 Thread William Kolln
This is a previous message from April left unanswered. Can Anyone Help...thanks if you can! I have an array called group_vals. This array can be populated by any combination of values e.g. /sp|lp|ep12|ffp|vid|dvd|bx|bkk|cd|csd/ I want to be able to say that: if the array contains any c

Re: Unique Array Help?

2012-05-17 Thread jbiskofski
The easiest thing would be to rewrite your sql with an aggregate statement : SELECT employee_id,date,SUM(hours_wrkd) FROM data WHERE date >= $date_then AND date <= $date_now GROUP BY empoyee_id,date ORDER BY 3 cheers. - Jose from Mexico On Thu, May 17, 2012 at 6:46 PM, Omega -1911 <1911...@

Re: Unique Array Help?

2012-05-17 Thread Omega -1911
On Thu, May 17, 2012 at 7:58 PM, jbiskofski wrote: > The easiest thing would be to rewrite your sql with an aggregate statement : > > SELECT employee_id,date,SUM(hours_wrkd) >  FROM data WHERE date >= $date_then AND date <= $date_now > GROUP BY empoyee_id,date > ORDER BY 3 > > cheers. > > - Jose f

Re: Unique Array Help?

2012-05-18 Thread Rob Dixon
On 18/05/2012 02:09, Omega -1911 wrote: On Thu, May 17, 2012 at 7:58 PM, jbiskofski wrote: On Thu, May 17, 2012 at 6:46 PM, Omega -1911<1911...@gmail.com> wrote: While trying to create a script that generates a graph, I am at a loss for a workable solution. What I need to be able to do in th

Re: Unique Array Help?

2012-05-18 Thread Omega -1911
On Fri, May 18, 2012 at 5:07 AM, Rob Dixon wrote: > On 18/05/2012 02:09, Omega -1911 wrote: >> >> On Thu, May 17, 2012 at 7:58 PM, jbiskofski  wrote: >>> >>> On Thu, May 17, 2012 at 6:46 PM, Omega -1911<1911...@gmail.com>  wrote: While trying to create a script that generates a grap

Re: Array help needed please

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 12:05, William Kolln wrote: > This is a previous message from April left unanswered. > > > Can Anyone Help...thanks if you can! > > > > I have an array called group_vals. > > This array can be populated by any combination of values > e.g. /sp|lp|ep12|ffp|vid|dvd|bx|

Re: Array help almost correct

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 15:07, willy.k wrote: > Jose > > Many thanks for replying so quickly. > I will explain again, sorry but is complicated. > > > > ### > I have an array called group_vals. > > This array can be populated by any combination of values > e.g. /sp|lp|e

Re: Array help almost correct

2004-05-26 Thread Chris Charley
[snip] > my $acceptable = qr/^(?:sp|lp|ep12|ffp|vid|dvd|bx|bkk|cd|csd)$/; > > and then using $acceptable to do the matchings, such as > > grep /$acceptable/, @array > > > it would be faster and more readable :-) If the acceptable list is that large, using a hash would be TMTOWTDI :-) #!/usr

Re: Array help needed please

2004-05-26 Thread John W. Krahn
William Kolln wrote: > > This is a previous message from April left unanswered. > > Can Anyone Help...thanks if you can! > > I have an array called group_vals. > > This array can be populated by any combination of values > e.g. /sp|lp|ep12|ffp|vid|dvd|bx|bkk|cd|csd/ > > I want to be able

Match and split on array help with output

2009-04-14 Thread perl
Hi all, I have some basic code that I want to pull out the web addresses from web pages. Would like to keep it as basic as possible for easy reading. The line to replace http with newline seems to work ok. however the "match" line doesnt seem to pull out the required lines and I'm not to sure abo

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
p...@highdeck.com wrote: Hi all, Hello, I have some basic code that I want to pull out the web addresses from web pages. Would like to keep it as basic as possible for easy reading. The line to replace http with newline seems to work ok. however the "match" line doesnt seem to pull out the r

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
p...@highdeck.com wrote: Hi john, Hello, thanks for the prompt reply. Ok, here's what I'd like it to do. #!/usr/bin/perl # # Build Initial list and put into array. @serverlist = `/usr/bin/wget -q -O - http://www.amazon.co.uk`; for ($index = 0; $index <= $#serverlist; $inde

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
John W. Krahn wrote: p...@highdeck.com wrote: Hi john, Hello, thanks for the prompt reply. Ok, here's what I'd like it to do. #!/usr/bin/perl # # Build Initial list and put into array. @serverlist = `/usr/bin/wget -q -O - http://www.amazon.co.uk`; for ($index = 0; $index

Re: Match and split on array help with output

2009-04-15 Thread Dr.Ruud
p...@highdeck.com wrote: /:\/\// Alternative: m~://~ > print( ( split /\// )[ 2 ] ); print +( split m~/~ )[ 2 ]; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Match and split on array help with output

2009-04-15 Thread Chas. Owens
On Tue, Apr 14, 2009 at 13:58, Dr.Ruud wrote: > p...@highdeck.com wrote: > >> /:\/\// > > Alternative: > >  m~://~ snip What drove your choice of tildas here? Normally I would go for once of the matched delimiters (i.e. (), {}, [], or <>). -- Chas. Owens wonkden.net The most important skill a

Re: Match and split on array help with output

2009-04-16 Thread Dr.Ruud
Chas. Owens wrote: Dr.Ruud: p...@highdeck.com: /:\/\// Alternative: m~://~ What drove your choice of tildas here? Normally I would go for once of the matched delimiters (i.e. (), {}, [], or <>). The tilde just happens to be one of my favourite regex delimiters. I see "#" being used

Loading results of pattern match into an array - help please

2009-01-23 Thread jeffqtate
I am trying to split a very long fixed lenght record into its constituents, and then load them into an array. I have patterns like '^ (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I am stumped however as to how to get them into an array in a general way. With 'use strict' turne

Re: Loading results of pattern match into an array - help please

2009-01-23 Thread Mr. Shawn H. Corey
On Fri, 2009-01-23 at 11:57 -0800, jeffqt...@gmail.com wrote: > I am trying to split a very long fixed lenght record into its > constituents, and then load them into an array. I have patterns like '^ > (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I > am stumped however as to h

Re: Loading results of pattern match into an array - help please

2009-01-23 Thread Gunnar Hjalmarsson
jeffqt...@gmail.com wrote: I am trying to split a very long fixed lenght record into its constituents, and then load them into an array. I have patterns like '^ (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. my @array = $record =~ /^(.{3})(.{24})(.{6}).../; I havebasic

Re: Loading results of pattern match into an array - help please

2009-01-23 Thread Owen
> I am trying to split a very long fixed lenght record into its > constituents, and then load them into an array. I have patterns like > '^ > (.{3})(.{24})(.{6})...' which gets teh fields into $1, $2, $3 etc. I > am stumped however as to how to get them into an array in a general > way. With 'use s

RE: Loading results of pattern match into an array - help please

2009-01-24 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: jeffqt...@gmail.com [mailto:jeffqt...@gmail.com] > Sent: Friday, January 23, 2009 12:58 > To: beginners@perl.org > Subject: Loading results of pattern match into an array - help please > > I am trying to split a very long fixed l