Re: assigning hash key to reference of array question

2011-02-28 Thread charley
On Feb 28, 2:47 pm, rich.j...@gmail.com (steve park) wrote: > I have a below program and I am not doing it right. > Currently, only last ip pool is going in since I am putting them w/ key to > values(so only last one shows up when I print). Hello Steve, The reason you only get the last value for

Re: Perl Hash Comparison and concatenate result from %hash2 compared to %hash1 into %hash3

2011-04-03 Thread charley
On Apr 3, 2:31 pm, crypt...@gmail.com (Wernher Eksteen) wrote: > > I suggest you reduce your tab size from eight characters, which leave > > your code spread out and less readable. Four or two is more usual > > nowadays. > > Thank you, I will do so from now on. > > > Meaningful variable names are a

Re: Perl Hash Comparison and concatenate result from %hash2 compared to %hash1 into %hash3

2011-04-04 Thread charley
On Apr 4, 3:03 am, wekst...@gmail.com (Wernher Eksteen) wrote: > > Hello Wernher, > > Hi Chris, > > > Rob's code could be reconfigured slightly to do so, but requires a > > different approach.  I will paste it below. > > Ok, thanks. > > > One change I made was to make the *values* of %hash1 an arra

Re: How to test for 2 words from a list in a form field?

2011-04-08 Thread charley
On Apr 8, 9:06 pm, sono...@fannullone.us wrote: >         Three hours later, I finally had a brainstorm, and came up with the > idea to count the number of occurrences of the words I'm looking for.  Here's > what I came up with: > > my $str = "PO Box 6545 / 3546 Termbo Street"; > my $address_coun

Re: How to test for 2 words from a list in a form field?

2011-04-08 Thread charley
On Apr 8, 9:06 pm, sono...@fannullone.us wrote: >         Three hours later, I finally had a brainstorm, and came up with the > idea to count the number of occurrences of the words I'm looking for.  Here's > what I came up with: > > my $str = "PO Box 6545 / 3546 Termbo Street"; > my $address_coun

Re: How to test for 2 words from a list in a form field?

2011-04-08 Thread charley
On Apr 8, 10:59 pm, char...@pulsenet.com wrote: > On Apr 8, 9:06 pm, sono...@fannullone.us wrote: > > >         Three hours later, I finally had a brainstorm, and came up with the > > idea to count the number of occurrences of the words I'm looking for.   > > Here's what I came up with: > > > my $

Re: how to parse complex table

2011-04-25 Thread charley
On Apr 23, 11:56 am, abuali...@gmail.com (galeb abu-ali) wrote: > thank you for the advice Shawn, I'll try what you suggest! > BTW, it's not homework, It's supporting metadata for my research and I'm > trying to parse it in a format that will be easier to lookup later. > > thanks again > > galeb H

Re: split & re

2011-05-15 Thread charley
On May 15, 12:28 pm, mike.j...@cox.net (Mike McClain) wrote: > In reading in a file of space separated columns of numbers > and stuffing them into an array, I used: >     while( my $line = <$FH> ) >     {   my @arr = split /\s+/, $line; >         push @primes_array, @arr; >     } > > but kept getti

Re: How to avoid using the slow array subscripting operator?

2011-05-26 Thread charley
On May 26, 5:44 am, jason.li...@gmail.com (Xi Liu) wrote: > I know I am doing the repetitive and useless summing again and again. What > confuses me is that using the same algorithm, I mean > >  for my $i (99 .. 6) > { >       my $sum; >       map {$sum += $_->{foo_value}} @lines[$i - $n + 1 ..

Re: Using Heap::Elem

2009-06-30 Thread Chris Charley
- Original Message - From: "Ankit Singla" Hi, I'm trying to use Fibonacci heaps to keep type of objects sorted. I require the sorting to be over the key. I've only started out with Perl and can't figure out how to extend the Heap::Elem class to make this kind of pair objects for u

Re: mkdir in the mounted partition,please h elp me,thanks

2009-11-18 Thread Chris Charley
- Original Message - From: ""gaochong"" Newsgroups: perl.beginners To: Sent: Tuesday, November 17, 2009 6:41 AM Subject: mkdir in the mounted partition,please help me,thanks #!/usr/bin/perl -w #Auther:gaochong use strict; my @list = (3 .. 9); my @FA=("FA0001".."FA

Re: mkdir in the mounted partition,please h elp me,thanks

2009-11-18 Thread Chris Charley
- Original Message - From: ""Chris Charley"" Newsgroups: perl.beginners To: Sent: Wednesday, November 18, 2009 12:39 PM Subject: Re: mkdir in the mounted partition,please help me,thanks - Original Message - From: ""gaochong""

Re: a simple question about the line

2009-11-27 Thread Chris Charley
- Original Message - From: "Dermot" Newsgroups: perl.beginners To: "John W. Krahn" Cc: "Perl Beginners" Sent: Friday, November 27, 2009 12:29 PM Subject: Re: a simple question about the line 2009/11/27 John W. Krahn : Hello, $ echo "12 23 34 45 56 67 78" | perl -lpe'$\=--$|?

Re: Saturdays in a month

2009-12-23 Thread Chris Charley
- Original Message - From: Venkat Saranathan Newsgroups: perl.beginners To: Johnson, Reginald (GTS) Cc: beginners@perl.org Sent: Tuesday, December 22, 2009 10:27 AM Subject: Re: Saturdays in a month You can code a simple time logic to calculate this. Here is a sample code. (Bugs incl

Re: Regex problem

2009-12-26 Thread Chris Charley
- Original Message - From: "Owen" Newsgroups: perl.beginners Hello Owen To check the date passed with a script, I first check that the date is in the format 20dd (20 followed by 6 digits exactly) But the regex is wrong, tried /^20\d{6}/,/^20\d{6,6}?/,/^20\d{6,}?/ and while a

Re: hash of Arrays

2010-01-18 Thread Chris Charley
- Original Message - From: ""Johnson, Reginald (GTS)"" Newsgroups: perl.beginners To: Sent: Sunday, January 17, 2010 2:42 PM Subject: hash of Arrays I am trying to place the date of each day of the week for each month that has 5 weeks into a hash. For instance my hash key 'Monday' w

Re: Searching First Array in Second Array

2010-01-19 Thread Chris Charley
- Original Message - From: "Parag Kalra" Sent: Tuesday, January 19, 2010 6:45 AM Subject: Searching First Array in Second Array Hello All, I have 2 arrays. I have written a script that searches each and every value of first array in the second array. Each & every value of Source

Re: Getting the text from a PDF file

2010-02-28 Thread Chris Charley
- Original Message - From: ""Ion Pop"" Newsgroups: perl.beginners To: Sent: Sunday, February 28, 2010 7:57 AM Subject: Getting the text from a PDF file Hello, I would like to extract the whole text from a PDF document. Can you recommend a perl module that can do this under Window

Re: \1 in character class?

2010-07-14 Thread Chris Charley
- Original Message - From: "Bryan R Harris" Subject: \1 in character class? I'm trying to temporarily deal with simple quoted strings by turning: data: "this is a string" more: "this is another" into... data: "this is a string" more: "this is another" TIA. - Bryan Here

Re: PPM Repository

2008-04-04 Thread Chris Charley
- Original Message - From: "Jim" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, April 04, 2008 6:04 AM Subject: PPM Repository Hi all, I am looking to easily install some modules, like for example Win32::Clipboard, but they don't show with teh standard modules on

Re: comparing two binary numbers

2008-05-11 Thread Chris Charley
- Original Message - From: ""Johnson Lau"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Sunday, May 11, 2008 1:09 AM Subject: comparing two binary numbers Dear all, I need to compare two binary numbers and need perl to return the number of matching bits. For example:

Re: Debug Help Please

2008-07-09 Thread Chris Charley
- Original Message - From: "Andy" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, July 08, 2008 9:31 PM Subject: Re: Debug Help Please On Jul 7, 2:16 pm, [EMAIL PROTECTED] (Andy) wrote: On Jul 7, 11:53 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > Andy wrote: > >

Re: Handling ignore case and single line in pattern matchin

2008-07-11 Thread Chris Charley
- Original Message - From: ""Manasi Bopardikar"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, July 11, 2008 4:23 AM Subject: Handling ignore case and single line in pattern matchin Hi, Does anyone know how to handle ignore case(i) and single line(s) on a regula

Re: rand()

2008-07-28 Thread Chris Charley
- Original Message - From: "Bobby" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, July 28, 2008 10:54 AM Subject: rand() Hi all, How do I use the rand function to print out more than one random number for an array? In the example script below i have an array @nums

Re: rand()

2008-07-30 Thread Chris Charley
From: ""Chris Charley"" From: "Bobby" Newsgroups: perl.beginners Subject: rand() Hi all, How do I use the rand function to print out more than one random number for an array? In the example script below i have an array @nums with a list of numbers; ho

Re: question about text operation using regex.

2008-08-05 Thread Chris Charley
- Original Message - From: ""Remy Guo"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Beginners" Sent: Tuesday, August 05, 2008 10:14 PM Subject: question about text operation using regex. hi all, i have a txt log file and i want to delete the 9th character of each line.

Re: question about text operation using regex.

2008-08-05 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> To: Sent: Tuesday, August 05, 2008 10:45 PM Subject: Re: question about text operation using regex. - Original Message - From: ""Remy Guo"" <[EMAIL PROTECTED]> News

Re: question about text operation using regex.

2008-08-06 Thread Chris Charley
- Original Message - From: ""Remy Guo"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Beginners" Sent: Tuesday, August 05, 2008 10:14 PM Subject: question about text operation using regex. hi all, i have a txt log file and i want to delete the 9th character of each line.

Re: date info

2008-08-06 Thread Chris Charley
- Original Message - From: ""michael wang"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Wednesday, August 06, 2008 9:00 AM Subject: date info Hi, if I have something like 20080503, how can I get the date a year ago, such as 20070503 in perl? Thanks, michael

Re: Extracting data from log and reformating

2008-08-15 Thread Chris Charley
On Wed, Aug 13, 2008 at 10:05 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: Kashif Salman wrote: Greetings, Hello, I have a log file like so, and I am trying to get the date on the next line after "Start..." line. So for the log below I'd like to get the output 04/06/05 05/06/05 06/06/05

Re: local var with no assignment

2008-09-10 Thread Chris Charley
- Original Message - From: "oldyork90" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Wednesday, September 10, 2008 10:19 AM Subject: local var with no assignment True or false. (Trying to figure out why this would be done with no assignment). The reason is that $/ is in

Re: Processing multiple line

2008-09-17 Thread Chris Charley
- Original Message - From: ""Aali Naser"" Hello All, I have a file with the info in the following format; Start of File= Server Name: ABCDEF Manufacturer: Dell Model: Some Model Number Of Processors (Includes MultiThread): 2 Maximum Clock Speed: 3

Re: reference question

2008-09-29 Thread Chris Charley
From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @arrayref, [EMAIL PROTECTED

Re: reference question

2008-09-29 Thread Chris Charley
From: ""Chris Charley"" From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = ma

Re: Using a variable in a =~ match??

2008-10-21 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Hi all, Serious noob here (one week into llama 5th ed.). I'm trying to write a script to pull a specific file from a directory and search that file for specific phrases. I am having a problem searching for the file in the directory. If I ty

Re: date math

2004-03-29 Thread Chris Charley
"Andrew Gaffney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > R. Joseph Newton wrote: > > Andrew Gaffney wrote: [snip] > I didn't do it this way because there is a "first" pay period. If there are only 2 pay > periods from the starting date, you can't build a list of 6. My way t

Re: Spliting some path

2004-04-13 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Saturday, April 10, 2004 12:56 PM Subject: Spliting some path > How can I split some path to directories > for example if my $path is "/home/ftp/some/file" > how can I get elements /h

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Jan Eden" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Lists" <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 1:29 PM Subject: Date calculation Hi, I need to find the number of days between two dates. The Perl Cookbook provides this solution:

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 6:48 PM Subject: Re: Date calculation > > - Original Message - > From: "Jan Eden" <[EM

Re: Date calculation

2004-04-23 Thread Chris Charley
- Original Message - From: "Jan Eden" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Chris Charley" <[EMAIL PROTECTED]>; "Perl Lists" <[EMAIL PROTECTED]> Sent: Thursday, April 22, 2004 3:56 AM Subject: Re: Date calculation Hi Chr

Re: Finding missing numbers in sequence

2004-05-13 Thread Chris Charley
- Original Message - From: "Larry Wissink" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Wednesday, May 12, 2004 6:39 PM Subject: Finding missing numbers in sequence I have a problem that I thought would be perfect for Perl, except that I seem to be using

Re: Find closest value

2004-05-16 Thread Chris Charley
- Original Message - From: "Mike Blezien" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl List" <[EMAIL PROTECTED]> Sent: Sunday, May 16, 2004 12:50 PM Subject: Find closest value > Hello, > > is it possible, with perl, to find the closest numerical value to a set value. > IE.

Re: Finding a string in a file

2004-05-25 Thread Chris Charley
- Original Message - From: "Debbie Cooper" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Tuesday, May 25, 2004 12:11 PM Subject: Finding a string in a file > I need to search for the occurrence of a string in a file that is buried in > directories. So, fo

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: printing contents between lines

2004-06-03 Thread Chris Charley
- Original Message - From: "Sidharth" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 03, 2004 3:44 PM Subject: printing contents between lines hi all , consider the contentes of file as below [snip file contents] how to print all the li

Re: printing contents between lines

2004-06-03 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 03, 2004 7:09 PM Subject: Re: printing contents between lines > > - Original Message - > From: "Sidhar

Re: reading commandline parameters and <>

2004-06-07 Thread Chris Charley
> I am sorry I did not give the real situation before, I want to execute > this on command line like > > perl -pe 's/$ARGV[1]/$ARGV[2]/' filename OLDSTR NEWSTR > > Is this possible ? > > Thanks > Ram Why not perl -pe 's/OLDSTR/NEWSTR/' filename -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: reading commandline parameters and <>

2004-06-07 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Monday, June 07, 2004 2:07 PM Subject: Re: reading commandline parameters and <> > > I am sorry I did not give the real situation

Re: Date and time calculation

2004-06-17 Thread Chris Charley
> Hi there, > > I've got a date field and a time field, how can I effectively subtract the > field ($date $time) - ($date2 $time2) from each other. I am using these > two fields to determine a server's uptime according to my database in > days,hours,minutes,seconds. > Kind Regards, > Werner Otto P

Re: regex in perl.

2004-06-17 Thread Chris Charley
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=slrnbnjntp.7er.xx087%40smeagol.ncf.ca The link above shows an array of patterns being used. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&q=%22array+of+patterns%22+group%3Acomp.lang.perl.misc&meta=group%3Dcomp.lang.perl.misc The link a

Re: regex in perl.

2004-06-18 Thread Chris Charley
- Original Message - From: "Rod Za" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Thursday, June 17, 2004 6:15 PM Subject: regex in perl. > Hello, > > Someone know how can i search this in a file using regex? Hello Rod, My head must've been in the clouds

Re: puzzled

2004-06-19 Thread Chris Charley
- Original Message - From: "Pedro Antonio Reche" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Friday, June 18, 2004 9:43 AM Subject: puzzled > Hi there, I am puzzled by the 'build_seq' subroutine in following code. > #!/usr/sbin/perl -w > use strict; > us

Re: Re:seach a number in a file

2004-06-19 Thread Chris Charley
- Original Message - From: "Jorge Goncalves" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Friday, June 18, 2004 4:35 AM Subject: Re:seach a number in a file > Hi, I have a text file like this: [snip file contents, they're posted below] > How can i do in

Re: Pattern match

2004-06-21 Thread Chris Charley
- Original Message - From: "Naser Ali" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Monday, June 21, 2004 3:52 PM Subject: Pattern match > Hello, > > I have an array which was created by slurrping a whole text file. There are > certain element in the arra

Re: Dates are killing me..

2004-07-07 Thread Chris Charley
Like Luke's solution, but using Date::Simple which comes with the standard distro of Perl. #!/usr/bin/perl use strict; use warnings; use Date::Calc qw/ Day_of_Week Add_Delta_Days /; my @days = (undef, qw/ Mon Tue Wed Thur Fri Sat Sun /); if ($ARGV[0] !~ /^\d{4}-\d{2}-\d{2}$/) { die "Date given

Re: sort of previously ask, but it really a newie

2004-07-13 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Tuesday, July 13, 2004 6:13 PM Subject: sort of previously ask, but it really a newie > All, > > the data below is my end result from my code below, but I am wondering and > trying to

Re: Is the var recreated in a foreach loop using `my`?

2004-07-16 Thread Chris Charley
- Original Message - From: "Rod Za" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Friday, July 16, 2004 10:58 AM Subject: Is the var recreated in a foreach loop using `my`? > Hi, > > I have a doubt. If i create an array inside a foreach loop using `my`, is

Re: pattern matching question

2004-12-23 Thread Chris Charley
- Original Message - From: "John McCormick" i'm trying to figure out how to split a file delimited by commas and newlines. @data = split (/\n|\,/, ) the only problem is that some of the data fields are strings enclosed in double quotes, and within some of those double quotes are more com

Re: complex data structure

2005-01-10 Thread Chris Charley
I hope someone can explain this related question. When I run the code below on Brano's data structure, 'each' gives me false results but 'keys' gives me correct results. I'm kind of stumped! #!/usr/bin/perl use strict; use warnings; my $hash = { 'test1' => [ {

Re: complex data structure

2005-01-10 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Chris Charley" <[EMAIL PROTECTED]> Cc: Sent: Monday, January 10, 2005 1:23 PM Subject: Re: complex data structure - Original Message ----- From: Chris Charley <[EMAIL PROTECTE

Re: Variable-sized hash of booleans

2005-02-04 Thread Chris Charley
You can use grep. my %hash = (ONE => 1, TWO => 0, THREE => 1); if (grep {! $hash{$_}} keys %hash) { print "false\n"; } else { print "true\n"; } Prints 'false'. Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Variable-sized hash of booleans

2005-02-04 Thread Chris Charley
You can use grep. my %hash = (ONE => 1, TWO => 0, THREE => 1); if (grep {! $hash{$_}} keys %hash) { print "false\n"; } else { print "true\n"; } Prints 'false'. Guess it would be helpful to explain how grep works here. From the perlfunc man page: Evaluates the BLOCK or EXPR for each element of LIST

Re: Question on sorting file

2005-02-14 Thread Chris Charley
Hello Vishal, File::Sort does external sorting for large files. http://search.cpan.org/~cnandor/File-Sort-1.01/Sort.pm Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: inplace editing

2005-03-16 Thread Chris Charley
- Original Message - From: "Hendrik Maryns" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Wednesday, March 16, 2005 5:35 PM Subject: inplace editing Hi, some time ago I asked for some help to eliminate certain lines from a file. Someone suggested a solution with { local ( $

Re: Determining standard perl modules

2005-03-17 Thread Chris Charley
- Original Message - From: "Gavin Henry" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Thursday, March 17, 2005 4:05 AM Subject: Determining standard perl modules Dear all, How/where do I find out the standard bundled perl modules Hello Gavin, perldoc perlmodlib and then scro

Re: Match filename and attach

2005-04-08 Thread Chris Charley
I think a hash is what I need to be doing but I'm not sure how to load the keys and the values. I'm sure I want the keys to be the files in the .html directory and the values to be the item numbers in all the .txt files. This way I can create the hash to function as a table lookup.. Right? Cou

Re: Copy and rename files

2005-04-20 Thread Chris Charley
- Original Message - From: "Brian Milbrandt" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, April 19, 2005 6:22 PM Subject: Copy and rename files I am trying to convert a unix script to perl. The script takes 2 command line arguments, source and target. I am unable

Re: Copy and rename files

2005-04-20 Thread Chris Charley
A correction to the code for 1 line below :-( Chris Hello Brian, I did what you wanted to do on my computer, (Windows XP). The code is pasted below, followed by some explanations. You should be able to get the same results by plugging in abc and xyz where I had html and txt. Also, with source a

Cannot get CPAN module working - cannot install

2005-05-03 Thread Chris Charley
Hope someone may know how to fix this, :-) (The cpan run is pasted in below) cpan> force install List::PowerSet Running install for module List::PowerSet Running make for N/NI/NIKC/List-PowerSet-0.01.tar.gz Checksum for \.cpan\sources\authors\id\N\NI\NIKC\List-PowerSet-0.01.tar.gz ok List-PowerSe

Re: sorting a hash

2005-05-09 Thread Chris Charley
Hi Teddy This works :-) for (sort byname keys %$ref) { print "$_ has the name $ref->{$_}{name} and has $ref->{$_}{age} years\n"; } sub byname { {$ref->{$a}{name} cmp $ref->{$b}{name}} } Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sorting a hash

2005-05-09 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Octavian Rasnita" <[EMAIL PROTECTED]>; Sent: Monday, May 09, 2005 4:30 PM Subject: Re: sorting a hash - Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> To: Sent: Monday, May 09, 2005

Re: Two Dimensional Array Problem

2005-06-03 Thread Chris Charley
[snip] Hi Brian, I usually deal with multidimensional arrays this way: $i = 0; while (@results = $sth->fetchrow_array ()) { $x = $results[0]; $y = $results[1]; @points = ($x, $y); $data[$i] = [EMAIL PROTECTED]; $i++; } Just a note about a possible problem with the statement:

Re: Searching problem in list of lists

2006-05-17 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "David Romano" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, May 17, 2006 8:02 AM Subject: Re: Searching problem in list of lists Hello, On 5/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I'm n

Re: split doubt

2006-05-25 Thread Chris Charley
- Original Message - From: ""Saurabh Singhvi"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl FAq" Sent: Thursday, May 25, 2006 3:38 PM Subject: split doubt Hi the format of split() defines that one can split a string into a fixed number of specifies strings. for eg ($lo

Re: parsing a CSV file with more fields than column names

2006-06-08 Thread Chris Charley
- Original Message - From: ""RICHARD FERNANDEZ"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Thursday, June 08, 2006 11:17 AM Subject: parsing a CSV file with more fields than column names Hello All, I'm just trying to get some ideas for the best way to approach this...

Re: Regex find and replace - delete line

2006-07-24 Thread Chris Charley
- Original Message - From: ""John W. Krahn"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Beginners" Sent: Sunday, July 23, 2006 4:33 PM Subject: Re: Regex find and replace - delete line James Turnbull wrote: Hi all Hello, This feels like a really dumb question but

Re: passing a list as a variable

2006-07-24 Thread Chris Charley
- Original Message - From: ""Ryan Moszynski"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, July 24, 2006 12:40 PM Subject: passing a list as a variable Is there a way to make my commented 'foreach" line act the same as the line above it? Can I pass a list as a v

Re: String or numbers in AoA?

2006-08-20 Thread Chris Charley
- Original Message - From: "chen li" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Sunday, August 20, 2006 2:20 PM Subject: String or numbers in AoA? Dear all, I try to read some records in one file. Each record consists of several column which are separated by tab and e

Re: Parsing HEX Snoop Dump

2006-10-05 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, October 02, 2006 10:33 AM Subject: Parsing HEX Snoop Dump I'm trying to parse a huge (~2-5MB) Snoop dump from our servers. The output is below: 15:44:14.57313 199.117.205.249 -> s31

Re: saving surrounding text in substitution

2006-10-10 Thread Chris Charley
- Original Message - From: "Kathryn Bushley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, October 10, 2006 3:17 PM Subject: saving surrounding text in substitution Hi, I've written the following script to substitute names for codes into a phylogenetic tree (new

Re: saving surrounding text in substitution

2006-10-10 Thread Chris Charley
- Original Message - From: ""John W. Krahn"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Beginners" Sent: Tuesday, October 10, 2006 4:43 PM Subject: Re: saving surrounding text in substitution Chris Charley wrote: (I've re-wri

Re: count the characters between the matches

2006-10-23 Thread Chris Charley
- Original Message - From: ""zhihua li"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, October 23, 2006 9:05 PM Subject: count the characters between the matches hi netters, I'm curious if there's any smart code to calculate the "distance" between the matches in

Re: run script on multiple files

2006-12-23 Thread Chris Charley
- Original Message - From: "Kirk Wythers" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "John W. Krahn" <[EMAIL PROTECTED]> Cc: "Perl Beginners" Sent: Saturday, December 23, 2006 1:32 PM Subject: Re: run script on multiple files Thanks or the reply John. I have a couple of ques

Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-01 Thread Chris Charley
#!/usr/bin/perl use strict; use warnings; $_ = "[][12/21/10 18:39:22] [oasetup] [oasetup] [INFO] Installing the HPOvXpl package..."; for my $re (qw{ ^\[(.+?)\] ^\[(.*?)\] }) { my ($dt) = /$re/ or die "Horrible death\n";; print $re, ' ', "'$dt'", "\n"; } __END__ C:\Old_Data\perlp>perl t5

Re: Behavior of minimal when applied to - {1,}? ot to - {0,}?

2011-02-02 Thread Chris Charley
"Rob Dixon" wrote in message news:4d48bdc7.6050...@gmx.com... On 01/02/2011 02:30, Chris Charley wrote: #!/usr/bin/perl use strict; use warnings; $_ = "[][12/21/10 18:39:22] [oasetup] [oasetup] [INFO] Installing the HPOvXpl package..."; for my $re (qw{ ^\[(.+?)\] ^\[

Re: rmdir

2011-06-24 Thread Chris Charley
"Irfan Sayed" wrote in message news:1308908614.88998.yahoomail...@web125518.mail.ne1.yahoo.com... hi, i need to delete some directories recursively which are present at some shared location i tried file::path perl module but the issue with that module is , it is not deleting the root/p

Re: understanding adding numeric accumulator

2011-07-08 Thread Chris Charley
""J. S. John"" wrote in message news:caahf0rkhyip680xk9kz+3q4uvw79s2dh8denulob_2gxlyf...@mail.gmail.com... Hi all, I'm teaching myself perl. Right now, I am stuck with this script. I don't understand how it works. I know what it does and how to do it by hand. $n = 1; while ($n < 10) { $s

Re: regex negative looking up a backtrace

2011-08-24 Thread Chris Charley
Assume I have to find the first unique character in a string $string = "abtable"; # t is the first unique string I tried using a negative backtrace lookup to get the answer in a single regex ... But something is missing. /(.).(?!\1)/ && print $1; it seems fine ... But doesn't work -- Sent fr

Re: parsing script removing some lines help please

2011-09-30 Thread Chris Charley
John W. Krahn wrote: Mariano Loza Coll wrote: Hi John, Hello, I'm trying to learn a little bit more of Perl everyday, and I was intrigued about your earlier suggestion in a thread. my $bad_chromosomes = qr/^(?:6|8|14|16|18|Y)\t/; while (<$IN> ) { print $OUT $_ if !/$bad_chromosomes/

Re: regex help

2011-10-10 Thread Chris Charley
"Chris Stinemetz" wrote in message Any help is appreciated. Once I match HEH how can alter the program to print the contents that are in the two lines directly above the match? For example in this case I would like the print results to be: **01 REPT:CELL 983 CDM 1, CCU 1, CE 5, HEHTimest

Re: Manipulating reference to array of array references

2011-11-20 Thread Chris Charley
"Mohan L" wrote in message news:cadihtmt4rqntknjlgsimpgqv9xuc89dryhtx00ctwbknxwd...@mail.gmail.com... Dear all, #!/usr/bin/env perl #dummy.pl use strict; use warnings; use Data::Dumper; my $ref_to_AoA = [ [ "fred", "barney",undef,"pebbles", "bambam", "dino", ], [ "homer",und

Re: comparing arrays

2012-01-11 Thread Chris Charley
"Chris Stinemetz" wrote in message news:ca+hbpzhw7scz2dnabxd0j1bqfcj3vpo7xm_dvrbqmpwrnul...@mail.gmail.com... I have a script where I have captured the value on the left side of the "=" as the header for my table. Now I want to take the value on the right side of the "=" sign and populate a

Re: Use of SFTP::Foreign with backend processing and having problems ( not apparent within the code ) in getting remote SFTP to quit it's processes

2012-04-09 Thread Chris Charley
""Wagner, David --- Sr Programmer Analyst --- CFS"" wrote in message I am running AS 5.10.1 on Windows XP SP3 and attempting to use sFTP within my processing communicating to MVS/IBM. What I am trying to do is to do so many gets, then undef the variable and re-login and to continue on to end

Re: Help needed created this data structure

2007-07-09 Thread Chris Charley
- Original Message - From: "klute" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, July 09, 2007 4:20 PM Subject: Help needed created this data structure Hi All, I am new to Perl and was hoping to get advice on creating the following data structure: I have an Affi

Fw: Help needed created this data structure

2007-07-10 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> To: "klute" <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2007 7:17 PM Subject: Re: Help needed created this data structure - Original Message - From: "klute" <[EMA

Re: comparing elements of arrays

2007-08-10 Thread Chris Charley
- Original Message - From: ""Tony Heal"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Friday, August 10, 2007 4:23 PM Subject: comparing elements of arrays There has got to be a better way (or more elegant way) to do this. I have 2 DNS files from bind9. I have removed e

Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Chris Charley
- Original Message - From: ""Wagner, David --- Senior Programmer Analyst --- WGO"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, August 14, 2007 1:06 PM Subject: Ability to do numeric and alpha sort in one pass on data which is compirsed of both I am attempting

Re: modification

2007-08-20 Thread Chris Charley
- Original Message - From: "Ken Foskey" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "beginners perl" Sent: Monday, August 20, 2007 10:47 AM Subject: modification I have a piece of code that I am assured works and I cannot see why it would. Code is supposed to force undefine

Re: working with 3-dimensional array

2007-09-13 Thread Chris Charley
- Original Message - From: "Tim McGeary" <[EMAIL PROTECTED]> Hi all, I'm trying to read in two file sets of library records, compare a regex that I find in different lines of each set of records, and then copy one whole line over to the other when a match is found. ? To do this

Re: working with 3-dimensional array

2007-09-13 Thread Chris Charley
- Original Message - From: ""Chris Charley"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Thursday, September 13, 2007 11:55 PM Subject: Re: working with 3-dimensional array - Original Message - From: "Tim McGeary" <[EMAI

  1   2   >