Re: Compare to multiple numbers

2005-05-17 Thread Zeus Odin
"Christopher L Hood" <[EMAIL PROTECTED]> wrote ... > Why doesn't this work to check the until it is one of the numbers > "1 2 3 4 5" ?? I have tried multiple variations of this with different > brackets ie. [ ] , and ( ) . Chris, this doesn't work because you didn't write valid code. ;-) I thin

Re: Finance::Bank::Wachovia Message

2005-05-15 Thread Zeus Odin
Although you can do that, it seems like you didn't investigate why the line was present to begin with. I assume that it had some use initially. As Wiggins suggested, I would look at the source of the actual web page that is being submbitted. Occasionally, I automate web page submissions via LWP

Re: very new - need help with regular expressions

2005-03-27 Thread Zeus Odin
"Brett Williams" <[EMAIL PROTECTED]> wrote in message ... > > That was a big help. I now have another problem however. I had assumed > that adding a line number preceding the prices would be a trivial > matter, however what i thought would work is not doing so. Here is the > code ive tried. > > [sn

Re: Perl Analyzing Maillog

2005-03-16 Thread Zeus Odin
"Nick Chettle" <[EMAIL PROTECTED]> wrote in message ... > Hi All, Hi, Nick. > #!/usr/bin/perl This is a very good start. Never forget: use warnings; use strict; These are two of the most important lines in the script :-) If you had used these simple two lines, you would have found a ma

Test.

2005-03-02 Thread Zeus Odin
Do not read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Accessing elements of an array passed by reference

2004-11-15 Thread Zeus Odin
"Colin Johnstone" <[EMAIL PROTECTED]> wrote ... > Gidday all, Hello. > I wish to access the elements of an array passed by reference > #get deploy list > my @$deployList = $task->GetVariable('deployList'); > foreach( @$deployList ){ > > } If $task->GetVariable('deployList') returns a referenc

Re: Need help with creating a web forwarding site.

2004-11-14 Thread Zeus Odin
"Philipp Traeder" <[EMAIL PROTECTED]> wrote in message... > Hi Zeus, Hello. Thanks for the quick reply. > I guess LWP::UserAgent might be interesting in this context, but I wouldn't > try to parse the responses you get. Why don't you pass the resulting

RE: Why doesn't this work?

2004-11-13 Thread Zeus Odin
> Good morning, Zeus. Good morning. > Your codes is so neat and clean. I appreciate your help. Why thank you. Everyone loves compliments. :-) > I have one question to you though. You are more than welcome to cc me via email. However, please post to perl.beginners in case I am awa

Need help with creating a web forwarding site.

2004-11-13 Thread Zeus Odin
I would like to create a site that does nothing but forward requests to a destination site, say mydest.com. This is for nothing illicit, I am simply trying to circumvent a firewall's list of banned sites. :-) For instance, if I were to go to http://www.mysite.com, it would send a request to GET ht

Re: Why doesn't this work?

2004-11-11 Thread Zeus Odin
"Aiguo Li" <[EMAIL PROTECTED]> wrote in message ... > Probe id Treat1 Treat2 > AffX-BioB-5_at (2p +M)/4 =2 (2*3+0)/3=2 > FFX-BioB-M_at (2*3+0)/4 =1.7 (2*3+0)/3=2 > AFFX-BioB-3_at (2*2+0)/4 =1 (2*2+0)/3=1.3 > AFFX-BioC-5_at (2*2+1)/4 =1.25 (2*1+1)/3=1 > AFFX-BioC-3_at (2*1+1)/4 = 0.75 (2*2+1)/3=1.

Re: Why doesn't this work?

2004-11-11 Thread Zeus Odin
"Aiguo Li" <[EMAIL PROTECTED]> wrote in message... > Hello, Hello. > I have the following dataset and want to calculate a P/A ratio for each > replicates in the dataset. In this case, treatment 1 has 4 replicats and > treatment2 has 3 replicates. The P/A = [((#of P)*2) + (# of M)]/# of > replicat

Re: position data

2004-11-07 Thread Zeus Odin
"Michael S. Robeson II" <[EMAIL PROTECTED]> wrote ... > use warnings; > use strict; Excellent. Make sure all your programs inlude these line. Three of the lines below have problems. > while () { >if (/>(\w+)/) { > $animal = $1; >} else { > while (/(-+)/g) { >my $gap_

Re: using 'my' problem

2004-11-06 Thread Zeus Odin
Two small mistakes: "Zeus Odin" <[EMAIL PROTECTED]> wrote in message ... > $ perl -mstrict -MData::Dumper -we "my $; print Dumper $s;" ^^^ $s > $VAR1 = undef; > $ perl -mstri

Re: using 'my' problem

2004-11-06 Thread Zeus Odin
rinting an empty list (undefined array). However, printing an undefined hash in any fashion, outputs nothing. I did not expect that. Hope that helps, ZO "JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message ... > > Zeus Odin wrote: > > To see the code that is actually gett

Re: using 'my' problem

2004-11-03 Thread Zeus Odin
To see the code that is actually getting compiled, try: $ perl -MO=Deparse -mstrict -we 'my @foo;print @foo;' "JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message ... > Correct, except I still think @ ans % don't get uninitialized value > warnings while $ does: > > $perl -mstrict -we 'my $foo

Re: using 'my' problem

2004-10-31 Thread Zeus Odin
The reason why you don't get the uninitialized warning in the 2nd and 3rd examples below is that your print is within the for loop. Since both @files and keys %files contain nothing, the innards of the for loop NEVER get executed. Therefore, the print is not attempted at all for examples 2 and 3.

Re: Printing to a file

2004-10-29 Thread Zeus Odin
my $hero = 'John Krahn'; $hero =~ s/John Krahn/Jenda Krynicky/; >:-) I can't believe I wrote what I thought was a thoughtful post that would hopefully make perl.beginners a better place to frequent (good luck!) and all I get is: Dude, Randal is spelled with one L not two. Pay attention. I'm John

Re: regex matching in a nested loop

2004-10-29 Thread Zeus Odin
Jason, You state your question, and practically give the answer in the solution. :-) You have a for loop inside a while loop. Both loops set $_. You state that you can not properly do your match within the for loop because you need the $_ value set by the while loop. Well ... why don't you just "

Re: easy way to add element to array

2004-10-29 Thread Zeus Odin
Also look at perldoc -q duplicate and Perl Cookbook 4.6. Extracting Unique Elements from a List "Brian Barto" <[EMAIL PROTECTED]> wrote in message ... > Though about using a hash but I don't have a need for a Key/Value > combination. I just need a list without duplicates. I suppose I can def

Re: Printing to a file

2004-10-29 Thread Zeus Odin
I could see this thread coming 2 months ago. Does anyone have any pent-up frustrations? :-) I think this list is the BEST list I have ever read ... not that I have read many lists. However, any list can be improved. The improvements I would suggest have to do with editorializing and patience: Fir

Re: Recursively counting a matching pattern on a single line.

2004-10-27 Thread Zeus Odin
What I think you are actually saying is that you want to know when you encounter two <'s or two >'s in a row You then want the program to alert and exit. The following accomplishes this. Apologies if I misunderstood. -ZO - #!/usr/bin/perl use warnings; use strict; my $count; my $text = 'http

Re: Counting gaps in sequence data revisited.

2004-10-26 Thread Zeus Odin
"Michael S. Robeson II" <[EMAIL PROTECTED]> wrote in message ... > open(DNA_SEQ, $dna_seq) Due to precedence, the parens are optional here. > open(OUTFILE, ">indel_list_"."$dna_seq") ^ ">indel_list_$dna_seq" or ">indel_list_".$dna_seq > foreach (keys

Re: array of references

2004-10-25 Thread Zeus Odin
push @array, [] while @array < 10; also works. "Ed Christian" <[EMAIL PROTECTED]> wrote... push (@array,[]) for (1..$num_child_arrays); For more info: perldoc -f push -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: counting gaps in sequence data

2004-10-24 Thread Zeus Odin
This is a really cool problem. See solution below. Michael, next time post some code please. Thanks, ZO -- #!/usr/bin/perl use warnings; use strict; use Data::Dumper; my(%gap, $animal); while () { if (/>(\w+)/) { $animal = $1; } else { while (/(-+)/) { $gap{$animal

RE: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
The following should do what you want. @print is an array of array references. You have to read the documentation, learn what it is, and how to use it. Now would be a good time to learn the Perl debugger so you can step through my code. Your assignment is to print @print in your DoChat() routine. (

RE: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
thing wrong regards Sreedhar -Original Message- From: Zeus Odin [mailto:[EMAIL PROTECTED] Sent: 23 October 2004 17:17 To: Kalkunte-Venkatachala, Sreedhar; [EMAIL PROTECTED] Subject: RE: How to store the out put in StringBuffer If you want to print to a handle, you must print CHAT "

RE: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
e how to store in one variable called $var (the result of print $_ foreach @tail;). because I can print the complete output in one shot. Regards Sreedhar -----Original Message- From: Zeus Odin [mailto:[EMAIL PROTECTED] Sent: 23 October 2004 14:36 To: Kalkunte-Venkatachala, Sreedhar Subject: R

Re: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
What I think you are saying is that you are searching a log file for an error. If you find an error, you want to print out the last 10 lines (that would be the error line and The previous 9 lines) and the next 10 lines (total of 20 lines). Is this correct? You have to state the entire problem more

RE: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
ED] Subject: RE: How to store the out put in StringBuffer Hi thank you very much for the mail. but just tme how store print $_ foreach @tail; this in a variable. So when I do DoChat($variable). it will print the complete information in one shot. Regards Sreedhar -Original Message- Fro

RE: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
ep(1); seek(LOGFILE, $cursorposition, 0); } -Original Message- From: Zeus Odin [mailto:[EMAIL PROTECTED] Sent: 23 October 2004 12:29 To: Kalkunte-Venkatachala, Sreedhar Subject: Re: How to store the out put in StringBuffer F

RE: how the print the first 7 letter of file name

2004-10-23 Thread Zeus Odin
Please reply to the group so that others may answer also. :-) Your solution will return only the first 7 characters of the filename. My solution solution returns all characters after the last slash (first you used \ now you are using /) and before the first _ (underscore). Just keep this in mind.

Re: how the print the first 7 letter of file name

2004-10-23 Thread Zeus Odin
I'm assuming you want the word after the last \ but before the first _. Right? If so: #!/usr/bin/perl use warnings; use strict; my $FILENAME='C:\Developer\view_local\local_nt\FDAFDSAFDSASDFA\ASDFDAFSASDF\New Process_date_22-oct-2004.log'; my $file = (split /_/, (split /\\/, $FILENAME)[-1])[0]; pr

Re: How to store the out put in StringBuffer

2004-10-23 Thread Zeus Odin
First, always use warnings; use strict; at the top of each program you write. Second, what are you trying to do exactly? Third, some observations: 1) You use $j and $pos exactly one time. Why are they present? 2) You seem to be looping to 10 using $i. Why not instead use for my $i(1 .. 10) {

Re: Parsing multiline data

2004-10-23 Thread Zeus Odin
Make sure each section is separated by a new line, including the last section. If there is no new line at the end of the file, the last record will be omitted. The following puts each field in %data with the field name being the key and the field value as the key's value, and it splits each line o

Re: What search string do I use on google or perldoc so that I know how to display a specified range of lines from a file (like sed -n 24, 48p filename)?

2004-10-23 Thread Zeus Odin
The following prints lines 24-48 of filename: prompt> perl -ne "print if 24..48" filename "Ken Wolcott" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A fishing pole question rather than a fish question :-) > > What search string do I use on google or perldoc so that I know how to

Re: get last record in a file

2004-08-26 Thread Zeus Odin
The following solution isn't as short as the other solutions, but it will allow you to maintain the order of the original file: #!/usr/bin/perl use warnings; use strict; my($last, $last_rec); while () { my @data = split; if ($last and $data[0] != $last) { print $last_rec; } elsif (eof)

Re: date calculations

2004-08-18 Thread Zeus Odin
One small thing. How can today and yesterday have the same date? Their very definitions denote that these two days are different (except for specific calendar changes, like the readjustment of the calendar to increate precision). If you stick with "Today" and "Yesterday", it might be worth conside

Re: Counting characters in a thread

2004-08-15 Thread Zeus Odin
The fastest would probably be: $text = '' if $text =~ tr/%// > 10; -ZO <[EMAIL PROTECTED]> wrote ... > How would I empty $string if it contained more than ten % characters? In > other words -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Checking if URL is on a list.

2004-08-14 Thread Zeus Odin
"Wiggins d Anconia" <[EMAIL PROTECTED]> wrote in message ... > if ($siteurl2 =~ /^(?:www.)?$FORM{'siteurl'}\/?$/) { ^^^ Keep in mind that this solution requires that the URL does not begin with "http://";. The . above needs to be backslashed; including "www.", it also OP

Re: Checking if URL is on a list.

2004-08-13 Thread Zeus Odin
Hi, J77, Your question is not exactly clear, but I will try to answer what *I* think you are asking. First, I will assume that you have a list of web sites with and without "http://www."; that you want to index like so: http://www.microsoft.com http://ibm.com www.ebay.com yahoo.com Second, I wil

Re: Choosing only numbers from the output

2004-08-04 Thread Zeus Odin
You are correct. I did not properly look at the regex you passed to split. "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> wrote > > The data as posted had white space trailing some of the digits > > after the colons. > > Yes, but how would that matter? Please read the second sentence in > "perldoc -f sp

Re: Choosing only numbers from the output

2004-08-04 Thread Zeus Odin
I think a hash is more apt for this problem, but changing to (an) array(s) is not difficult at all. The data as posted had white space trailing some of the digits after the colons. I found this worked better for me. Your results may vary. ;-) #!/usr/bin/perl use warnings; use strict; my %tag; w

Re: Searching and replacing text

2004-08-02 Thread Zeus Odin
Could you post the code you have written thus far? It would be a great help. -ZO "Chris Richards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi Everyone, This is my first post to the list Please be gentle :) Just so we are all clear... I am completely lost right from the st

Re: Regular Expressions - multiplelines

2004-08-01 Thread Zeus Odin
Another alternative: #!/usr/bin/perl use warnings; use strict; my $eol = '[\n\r\x0A\x0D]'; $/ = ''; while () { print /^(.*):$eol([^ ]*)/ ? "$1/$2\n" : $_; } __DATA__ $/Dev/something/something.com/blah1: default.asp userExc 26/07/04 1:42p [TEST-DEV]F:\content\blah\wwwroot\bla

Re: getting list of all .html files in a directory and its directories

2004-07-30 Thread Zeus Odin
In DOS: > perl -n0 -e "push @b, $ARGV unless /<%(?:perl|init)>/; END{print \"@b\"}" file1.html file2.html file3.html In *nix (untested): > perl -n0 -e 'push @b, $ARGV unless /<%(?:perl|init)>/; END{print "@b"}' *.html "Andrew Gaffney" <[EMAIL PROTECTED]> wrote in message That still doesn't appear

RE: [SOLUTION] how can i generate 10 unique (non repeating) numbers

2004-07-27 Thread Zeus Odin
lto:[EMAIL PROTECTED] Sent: Tuesday, July 27, 2004 5:37 AM To: Zeus Odin; [EMAIL PROTECTED] Subject: RE: [SOLUTION] how can i generate 10 unique (non repeating) numbers Hi Zeus, Your code and explanation are good. Incase I want 10 non repeated random numbers between 0 and 1 what needs

RE: [SOLUTION] how can i generate 10 unique (non repeating) numbers

2004-07-27 Thread Zeus Odin
ssage- From: Randy W. Sims [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 27, 2004 6:21 AM To: Zeus Odin Cc: [EMAIL PROTECTED] Subject: Re: [SOLUTION] how can i generate 10 unique (non repeating) numbers Hmm, I may be wrong, but I don't think this is as random as it could be. The probl

Re: [SOLUTION] how can i generate 10 unique (non repeating) numbers

2004-07-26 Thread Zeus Odin
If you want to do it without the use of a module, you could (1) add the 15 numbers to an array (the deck) (2) choose a random number from the deck (3) remove that random element and add it to another array (your hand) (4) repeat until done (your hand has 10 numbers) This sounds exactly like the s

RE: How efficient is this permutation algorithm?

2004-07-09 Thread Zeus Odin
t;[$i], @circular), "\n"; # Is this efficient? push @circular, splice @circular, 1, 1; } # Is this efficient? push @circular, shift @circular; } } } -Original Message- From: David J Kirol Sent: Sunday, June 27, 2004 9:30 PM To: Zeus Odin S

Test. Please ignore.

2004-07-01 Thread Zeus Odin
This is test. Outlook Express gives the annoying warning, 'A program is trying to access e-mail addresses stored in Outlook. Do you want to allow this?' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Perl RPM X binary

2004-06-28 Thread Zeus
(URI) is needed by mrtg-2.9.17-13 perl(vars) is needed by mrtg-2.9.17-13 Any idea ? []s Zeus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

How efficient is this permutation algorithm?

2004-06-27 Thread Zeus Odin
Hello, group! I had a little free time today and was re-reading parts of "Perl Cookbook." I came across section "4.19. Program: permute" and thought it would be interesting to write my own version of permute before reading the Cookbook's recipe. Of course, I had just read "4.16. Implementing a Cir

RPM perl X binary perl

2004-06-26 Thread Zeus
perl(vars) is needed by mrtg-2.9.17-13 Any idea ? []s Zeus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Printing outside of foreach...

2004-06-26 Thread Zeus Odin
"Daniel Falkenberg" <[EMAIL PROTECTED]> wrote: > Hello again, Hi. *Always* put the following at the top of your code: use strict; # requires declaration of all variables use warnings; # gives warnings on mistakes and suggestions These two lines will save you countless hours of debugging

Re: printing array elements in columns

2004-06-21 Thread Zeus Odin
"Guruguhan N" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, Hello. Please read Charles K. Clarkson's comments. They are spot on. I will not repeat them here. > In reply to my own posting, I have written a code like the one given below. > @X = (1 .. 30) > $n_el = scala

Why are timelocal() and localtime() not exactly opposite?

2004-06-20 Thread Zeus Odin
Hello, group! It is, like all other days, a great day to be a Perl programmer. Can anyone shed some light on the following? #!/usr/bin/perl use warnings; use strict; use Time::Local; # localtime cannot handle year 1903, but timelocal can print scalar timelocal(0,0,0, 31, 11, 2003), "\n"; print s

Re: getting online information....

2004-06-18 Thread Zeus Odin
This email follows this format: 1. Suggestions and items you need to read in order to understand the code are listed first. 2. Suggestions about properly posting a question are next. 3. Finally, the code that does all that you ask is at the bottom. 1. Please read or do the following: (a) ALWAYS

Re: getting online information....

2004-06-14 Thread Zeus Odin
This is an update if you have been following this thread. From: aditi gupta [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 12:48 AM To: Zeus Odin Subject: RE: getting online information hi, there are following 12 fields: 1 gi|37182815|gb|AY358849.1| 2

Re: getting online information....

2004-06-13 Thread Zeus Odin
Your code can be simplified quite a bit if I correctly understand what you were actually trying to do. I have taken a stab at it but had to guess at your intent with the layout of the fields. Let's clear up the field layout. Your data have 9 fields (at least to the untrained eye), separated by the

Re: Elegant quoted word parsing

2004-06-12 Thread Zeus Odin
But this output is not at all similar to the output desired in the original post by Beau E. Cox. Your solution merely splits on all delimiters. -ZO "David Storrs" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Personally, I would do this: > > #!/usr/bin/perl > use Text::ParseWords

Re: Elegant quoted word parsing

2004-06-11 Thread Zeus Odin
This is certainly shorter, but I doubt it fully adheres to your intent. It produces the same output as your procedure for this string, but it is possible that I changed some of the meaning of what you were trying to do: ---BEGIN CODE--- #!/usr/bin/perl use warnings; use strict; print joi

Re: Concatenating line into array problem

2004-06-11 Thread Zeus Odin
This works: ---BEGIN CODE--- #!/usr/bin/perl use warnings; use strict; $/ = '>'; while () { s/(.*?\n.*?)\n/$1/s; print; } __DATA__ > YNL331C CAATATGCGAGGGACCTACATGTTGA CATGACAATGAATTCTATTGAA > YKL071W ATAATTATTCCTGTTTCTTTAACCTG GTGTACAAACACTTAAGC ---END CODE---

Re: Loading Scalar Vars with Text - Readability

2004-06-03 Thread Zeus Odin
If "Clause" is literal and the numbers are in numerical order from A to N (where both A and N are known), I would use: my $longlist = join '|', map { "Clause$_" } (1..20); If "Clause" is literal and the numbers are not numerical: my $longlist = join '|', map { "Clause$_" } qw(5 20 3 6 9 11 7 13

Re: How to call / push an elem to a hash of array ?

2003-07-18 Thread Zeus Odin
What are you trying to do? If you could include a brief example, it would be nice. Li Ngok Lam wrote: > my (%LIST, @other_list); > > @other_list = ( Unknown Length Data Elems ); > > foreach my $col (@lists) > { > for (@other_list) > { > if ( exist $LIST{$col}[0] ) { Do_smth_2 }

Command line interface for http://www.m-w.com.

2003-07-07 Thread Zeus Odin
I have written an interface for m-w.com. I found some scripts on the web but nothing really robust. Please have a look, make comments, request functionality, make suggestions, make changes, or anything else you feel useful. If I have enough time, I will make this fully object-oriented. I welcome a

Re: Printing fields in Perl without the use of AWK

2003-02-26 Thread Zeus Odin
How is $worker_hour populated? Post a sample of the data. Brady Jacksan wrote: HI all, I am doing an assignment. I am writing a script to access a file and print the first and last name of workers whose hours worked exceeded 300hours. In the file, the last name is the first field and the first n

Re: REPACE CHARS

2003-02-14 Thread Zeus Odin
This is one way: A) Save script.pl use strict; while(@ARGV){ my $text = shift; $text =~ s/[^a-z0-9]//ig; # 1 # $text =~ s/[^a-z0-9_@.-]//ig;# 2 print "$text\n"; } B) usage: script.pl am13-+km9 am13-+km9_@.-$#!%^&*() 1. comment out #2 above 2. comment out #1 above "A

The email format of this list.

2003-02-13 Thread Zeus Odin
Why is it that the beginners-digest emails are properly displayed ONLY by MS Outlook? If I look at the digest email in Outlook, it comprises a number of attachments who are themselves the actual email postings. I open an attachment and can reply to the original sender. This is not the case in linu

Re: very novice "date" question

2003-02-11 Thread Zeus Odin
> I am trying to extract last month's date from today's date as in "Jan" > or "Feb"is there a switch to enable that ? Assuming you actually meant "extract last month's name based on today's date": @months = qw(Jan Feb Mar Apr May Jun July Aug Sep Oct Nov Dec); print $months[(localtime)[4]-1];

RE: A very annoying regex question.

2003-01-30 Thread Zeus Odin
o not emit 'a'; whereas, 'a' should be part of the split result in the latter case. Thanks again. -Original Message- From: Robert Citek [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 11:21 PM To: Zeus Odin Cc: [EMAIL PROTECTED] Subject: Re: A very anno

Re: A very annoying regex question.

2003-01-29 Thread Zeus Odin
riteria make the regex a bit more complex. The entity ^(?:[^=]+)= should split lines containing any equals on the first equals. Everything I've read agrees, but it does not work. C'est la vie. On Wed, 2003-01-29 at 10:52, Robert Citek wrote: > > Hello Zeus, > > At 09:49

A very annoying regex question.

2003-01-29 Thread Zeus Odin
I have spent a very LONG time trying to determine why this script is not splitting properly only on lines that have equals marks and only on the first equals. This would be very easy if I didn't slurp in the entire file at once, but hey life usually isn't easy. The array @a should always have an eq

For loop aliasing AND changing an array within a loop.

2003-01-22 Thread Zeus Odin
When you loop through an array for(@array){ ... } should not each array element be aliased into $_: if you change $_, you also change the element? This is what I remembered. However, a problem I just encountered shook this recollection. I think I read somewhere that you should NOT delete arra

RE: If statement

2002-03-31 Thread Zeus Odin
Please note the error (WRONG) below. Apologies. -- #!D:\perl\bin\perl -w use strict; my %data; # fill in 11 other states my @state = qw(MA CI DE IN OH); # Make each element of @state a key of hash %data # Set each value equal to 1 (true) # Refer to Perl Cookbook # Recipe 4

RE: If statement

2002-03-31 Thread Zeus Odin
#!D:\perl\bin\perl -w use strict; my %data; # fill in 11 other states my @state = qw(MA CI DE IN OH); # Make each element of @state a key of hash %data # Set each value equal to 1 (true) # Refer to Perl Cookbook # Recipe 4.7: Finding Elements in One Array but Not Another $data{ @state } = (