Re: the only difference is the 'x' after '/g'

2006-03-31 Thread Hans Meier (John Doe)
tching. Look at the beginning of perldoc perlre hth! Hans [bottom post order:] > On Thursday 30 March 2006 05:15 am, Hans Meier (John Doe) wrote: > > tom arnall am Donnerstag, 30. März 2006 12.36: > > > the following code: > > > > > > my (@main); > >

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Bob Showalter am Donnerstag, 30. März 2006 23.32: > Chas Owens wrote: > > If we are going to pick nits then it should be > > > > grep -c "" fn > > Note that grep -c counts matching *lines*. There is no formal > requirement that these elements appear on separate lines. Dave, my first one-liner su

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Chas Owens am Donnerstag, 30. März 2006 22.35: > > > cat fn | grep | wc [...] > > grep fn | wc [...] > If we are going to pick nits then it should be > > grep -c "" fn too much work. c "" fn But your alias may be different ;-) Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Gavin Bowlby am Donnerstag, 30. März 2006 21.45: > How about: > > cat fn | grep | wc When I posted a "cat | grep" the first (and last) time, several people got a well known heart attack :-) grep fn | wc > as a non-Perl approach to the problem... [...] Agreed, but OT here ;-) Hans -- To uns

Re: Counting specific elements in a XML object

2006-03-30 Thread Hans Meier (John Doe)
Dave Adams am Donnerstag, 30. März 2006 21.12: > If I have a xml file like the following: > > > > John Doe > 43 > M > Recieving > > > Bob Gordon > 50 > M > Shipping > > > > Is

Re: the only difference is the 'x' after '/g'

2006-03-30 Thread Hans Meier (John Doe)
tom arnall am Donnerstag, 30. März 2006 12.36: > the following code: > > my (@main); > $_=" > From a > From: b > From: c > From: d > "; > @main = /From [^\n]*?\n.*?(From: .*?\n).*?/gx; > print "@main"; > print "

Re: Does this script have the efficiency problems?

2006-03-09 Thread Hans Meier (John Doe)
Practical Perl am Donnerstag, 9. März 2006 09.50: > Hello, > > I have a script,which run well at most time.This day I use it to analyse > the files of 1.7G,it become very slow and can't get executed continuely > anymore.When I run 'strace -p ' (here is this script's PID),there > is no outp

Re: counting scalar array elements question

2006-03-09 Thread Hans Meier (John Doe)
John W. Krahn am Donnerstag, 9. März 2006 03.36: > Hans Meier (John Doe) wrote: [...] > > my @array; > > #or: > > my @array=(); [v--- this sidenote is wrong] > > (sidenote: the second form must be used in contexts where the code is > > persistent/preloaded and u

Re: counting scalar array elements question

2006-03-08 Thread Hans Meier (John Doe)
> > From: Graeme McLaren [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, March 08, 2006 3:57 PM > > To: beginners@perl.org > > Subject: counting scalar array elements question > > > > Hi all, I have an array question: > > > > If I have a variable, $var, and it contains an array how would I be able >

Re: multistring replacement

2006-03-08 Thread Hans Meier (John Doe)
Eugeny Altshuler am Mittwoch, 8. März 2006 11.35: > Hello! > > I have such problem, I need to make multistring replacement... How can > I do this? > > I tried to make perl script which acquires file form STDIN and prints > result into STDOUT > > cat file.html | ./myscript That's one way to pass th

[OT] sanitize/sanitise ? [was: [regexp] Speaking of the /s modifier...]

2006-03-08 Thread Hans Meier (John Doe)
Adam W am Mittwoch, 8. März 2006 02.10: > Hans Meier (John Doe) wrote: > > Adam W am Mittwoch, 8. März 2006 00.49: > >>Sorry, I'm relatively new to programming in general (perl is my first > >>programming language), so I'm not sure what you mean by "sani

Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
Adam W am Mittwoch, 8. März 2006 00.49: > Hans Meier (John Doe) wrote: > > Adam W am Dienstag, 7. März 2006 23.16: > >>Hans Meier (John Doe) wrote: [...] > > (this dies on empty lines etc. too, and of course the input file's lines > > should be sanitizes before

[getting OT?] Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
JupiterHost.Net am Mittwoch, 8. März 2006 00.29: > >> - "\(" instead of "[(]": more readable > > not according to "best practices Hi JupiterHost.Net I think there are more than one "best practices", although not several books carrying this title. I can't - and don't want to - diskuss based on "

Re: [regexp] Speaking of the /s modifier...

2006-03-07 Thread Hans Meier (John Doe)
Adam W am Dienstag, 7. März 2006 23.16: > Hans Meier (John Doe) wrote: > > just to sum up: > > > > $test =~ s{ (.*?) \( (.*?) \) } > > {$1}xsg; > > > > - "\(" instead of "[(]": more readable > > - no /m modifier :

Re: Directory issue

2006-03-07 Thread Hans Meier (John Doe)
DiGregorio, Dave am Dienstag, 7. März 2006 19.30: > Ok, I am trying to run another perl script from a perl script and have > had little luck in doing so. The main script is in one directory and > the one it is controlling is in another directory. the main script > starts and calls the other scrip

Re: [regexp] Warnings on Backreferences

2006-03-06 Thread Hans Meier (John Doe)
John W. Krahn am Dienstag, 7. März 2006 00.12: > Adam W wrote: > > JupiterHost.Net wrote: > $text =~ s!(.*?)\((.*?)\)!$1!g; [...] > >> Same exact regex as above: > >> > >> $test =~ s{ (.*?) [(] (.*?) [)] } > >> {$1}xmsg; [...] > > Can you tell me what the function of the squar

Re: How to display database records in a web page !!!!

2006-03-06 Thread Hans Meier (John Doe)
Madhu Kumar am Montag, 6. März 2006 09.57: > Hi , Hi Madhu Kumar your problem is not perl, but html related, see below: > I want to display database records as web page my database > contains some entries and which i wanna write as a report in web > page. > > I have written a code for it which

Re: hash of hashes & arrays

2006-03-04 Thread Hans Meier (John Doe)
regatta am Freitag, 3. März 2006 21.29: > Good morning/evening everyone, > > I have a hash of data , this hash is very big with dynamic elements > (strings, numbers, hashes, arrays) > > Here is an example > > $info{'system'}{'load'}{'1'} > $info{'system'}{'load'}{'5'} > $info{'system'}{'load'}{'15'

Re: problems with logical && (and) statement

2006-03-04 Thread Hans Meier (John Doe)
Angus am Freitag, 3. März 2006 17.40: > Yes, I did have that typo in my script. I fixed it but I am still never > seeing anything print out that says "I have a match" as the first if > control should do. Have you ensured that the compared data structures meet the conditions for a match? The com

Re: problems parsing a DHCP.leases file.

2006-02-27 Thread Hans Meier (John Doe)
Angus am Montag, 27. Februar 2006 08.25: > Hi all, > > > > I am having some problems filling a variable based on the contents of a > dhcpd.leases file. All I want at this time is the hostname and ip address. > My eventual goal is to create hash of hashes with this information but for > now I just

[rather OT] Re: alternating bgcolor in rows

2006-02-25 Thread Hans Meier (John Doe)
henry chen am Samstag, 25. Februar 2006 07.07: > I can't seem to figure out how to alternate the bgcolor for each row that > i'm printing from arrayref. Is there a 'foreveryother' function that would > allow me to put two lines in the loop? Or is there someway I can put two > rows of information

Re: alternating bgcolor in rows

2006-02-25 Thread Hans Meier (John Doe)
Bob Showalter am Samstag, 25. Februar 2006 15.03: > henry chen wrote: > > I can't seem to figure out how to alternate the bgcolor for each row > > that i'm printing from arrayref. Is there a 'foreveryother' function > > that would allow me to put two lines in the loop? Or is there someway I > > c

Re: alternating bgcolor in rows

2006-02-24 Thread Hans Meier (John Doe)
Chas Owens am Samstag, 25. Februar 2006 08.18: [...] > Aye, I am an idiot. No, your help on this list is very valuable, and, imho, typos are not proof for idiocy... Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: alternating bgcolor in rows

2006-02-24 Thread Hans Meier (John Doe)
Chas Owens am Samstag, 25. Februar 2006 07.17: [...] > Use the module operator (%) with an if statement to do different > things in a loop: > > my $rows = $dbhandle->selectall_arrayref($sql) || die $dbhandle->errstr; > if (@$rows) { > print " width='70%'>" . > > "TitleDescriptionPriceEm

Re: tar command

2006-02-24 Thread Hans Meier (John Doe)
Irfan J Sayed am Freitag, 24. Februar 2006 19.13: > Hi , > > I already tested with /vobstg.tar in the gzip command but still it's > hanging and i am executing this perl script from / partition only. > > Main thing is that it's creating /vobstg.tar.gz file but not coming to > shell prompt or not exe

Re: tar command

2006-02-24 Thread Hans Meier (John Doe)
Irfan J Sayed am Freitag, 24. Februar 2006 16.36: > Hi All, > > I need to execute unix tar command thru perl file > can somebody helps me out in this regard http://search.cpan.org/~kane/Archive-Tar-1.28/lib/Archive/Tar.pm hth Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: simple references question

2006-02-24 Thread Hans Meier (John Doe)
Bryan R Harris am Donnerstag, 23. Februar 2006 19.30: > Responding to your references to modules, we haven't used them because we > can't count on them being there. Obviously my problem, not yours. =) [...] There is no must to have them installed in default locations. You can install them in an

Re: simple references question

2006-02-23 Thread Hans Meier (John Doe)
Bryan Harris am Donnerstag, 23. Februar 2006 16.41: Hi Bryan It's a bit lengthy, but I hope it motivates you a bit to look around... > You mention larger projects, and I've heard about "reusable code"... Is > that generally done by copy/paste into the script you're working on? Code copied&pas

Re: Extract multiple lines

2006-02-23 Thread Hans Meier (John Doe)
Hans Meier (John Doe) am Donnerstag, 23. Februar 2006 13.07: [...] sorry for replying to myself... > > The script is only extracting the first line of the heading.. > > Yes, with every loop trough @lines, you overwrite your variables $title to > $dewey. this doesn't matter

Re: Extract multiple lines

2006-02-23 Thread Hans Meier (John Doe)
Jack Daniels (Butch) am Donnerstag, 23. Februar 2006 10.30: > It's driving me bonkers and can't afford any more psychiatic bills. The > data is a saved .txt file when viewing from a website. The vendor will not > give us an actual file even though we payed a montly fee for use of the > database. I

Re: simple references question

2006-02-22 Thread Hans Meier (John Doe)
Bryan Harris am Donnerstag, 23. Februar 2006 03.46: > Thanks! > > Regarding your "note", out of curiosity, how will it help a lot in the end? > I've been scripting for almost 5 years now, and have produced >100 scripts > that are used in data analysis work by ~15 people, and have never used "use >

Re: Why does my inheritance hierarchy get screwed up?

2006-02-22 Thread Hans Meier (John Doe)
Johannes Ernst am Donnerstag, 23. Februar 2006 00.19: > [Blogged about it here: http://netmesh.info/jernst/Technical/perl- > inheritance-problem.html ] > > There are three very simple classes in the following code: C is a > subclass of B, which is a subclass of A. > > If I try to instantiate B (see

Re: A problem with apache installation http://localhost issue

2006-02-22 Thread Hans Meier (John Doe)
zhou jian am Mittwoch, 22. Februar 2006 22.40: > Hello perl fellows: Hi Paul This is the wrong list for this question (see your subject) but: > I encountered a problem when I was installing a perl > module. The httpd server related module was hanging > overnight when it was trying to test > http

Re: Type globs of subroutines?

2006-02-22 Thread Hans Meier (John Doe)
Angerstein am Mittwoch, 22. Februar 2006 11.05: > Short Question: > > Is type globbing of subroutines possible or not? yes, perl -le 'use warnings; use strict; \ sub sub1{1}; \ *sub2=\&sub1; \ warn sub2(); \ ' > for something like &supersub(\&smallsub); This (passing a subroutine reference as ar

Re: Repeated Regex over a line with double quotes

2006-02-21 Thread Hans Meier (John Doe)
Wagner, David --- Senior Programmer Analyst --- WGO am Dienstag, 21. Februar 2006 23.55: > here is a small snippet of code(LABEL1) which appears to remove a comma > which lies between two double quotes. I run it and and display output and > the one line of code which does have the comma is c

Re: Net::Server

2006-02-19 Thread Hans Meier (John Doe)
Tom Allison am Samstag, 18. Februar 2006 21.27: > I am trying to set up a server using Net::Server. > Mostly this is out of curiousity more than anything else. > But following the man pages I got stuck. > > I was trying to set up a server to connect to port 8081, > but none of the configuration opt

[OT] Re: perl with databases

2006-02-19 Thread Hans Meier (John Doe)
Owen Cook am Sonntag, 19. Februar 2006 22.21: > I suggest you use Matt Sergeant's DBD::SQLite a Self Contained RDBMS in a > DBI Driver. > > It rocks Owen, thanks a lot for this tip!!! The aggregate function feature looks very promising :-) Hans -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Error in the "if" block

2006-02-19 Thread Hans Meier (John Doe)
Ron Smith am Sonntag, 19. Februar 2006 21.27: > I changed this too. Thanks, Hans! > > > [irrelevant parts snipped away] The "irrelevant" was not quite true... As always, John W. Krahn looked closer into the code, finds simpler solutions and does not miss to point to the appropriate documentation

Re: Error in the "if" block

2006-02-19 Thread Hans Meier (John Doe)
Ron Smith am Sonntag, 19. Februar 2006 18.47: > Hi all, Hi Ron > This page accepts a series of numbers, separated by spaces, and gives the > values listed bellow. > I'm getting the following error, No information about the input that causes the error; are there also inputs not causing an e

Re: populating a Hash

2006-02-18 Thread Hans Meier (John Doe)
David Gilden am Samstag, 18. Februar 2006 16.29: > Good morning, Good evening here ;-) > I would like to populate a hash from a csv text file, then test for the > existence of a value in the hash. If not found return an error message and > exit. > ithe text file will have the format of: > # whit

Re: Process large file with hash

2006-02-18 Thread Hans Meier (John Doe)
Andrej Kastrin am Samstag, 18. Februar 2006 14.08: > Dear Perl users, > > I try to parse 20.000.000 records file but... To solve my recent Perl > problem I collect my previous posts on this list. > > I have bar separated file (FILE_A): > name1|10 > name2|20 > name3|5 > name4|30 > etc. > > I process

Re: property definition

2006-02-17 Thread Hans Meier (John Doe)
Kenneth Moeng am Freitag, 17. Februar 2006 07.21: > Hello there, I have a problem with property definition of this code, > please have a look. > > #!/usr/bin/perl -w Hello, What is the property definition in your code and what problems do you have with it? Hans -- To unsubscribe, e-mail: [EMA

Re: :: and ->

2006-02-17 Thread Hans Meier (John Doe)
Ken Perl am Freitag, 17. Februar 2006 02.34: > what is the difference of :: and -> in this statements? > > $authInstance = > Operation::Auth::getInstance($session,$u->authMethod,$u->userId) > > $authInstance = > Operation::Auth->getInstance($session,$u->authMethod,$u->userId) The first '::' is par

Re: [RESOLVED (workaround?)] Re: Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-15 Thread Hans Meier (John Doe)
Tom Phoenix am Mittwoch, 15. Februar 2006 01.59: > On 2/14/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote: > > I'm fine with that, but still don't understand how a path present in @INC > > is ignored. > > It sure looks like it's in @INC, from the

Re: Stopping a Service with cgi

2006-02-14 Thread Hans Meier (John Doe)
nishanth ev am Dienstag, 14. Februar 2006 17.56: > hello Friends, > > Have anyone tried stopping a service say httpd usng a > cgi script ? > I have set a setuid for the cgi script and the script > is in the root cgi-bin directory namely > /var/www/cgi-bin/ with ownership root and have the > followi

Re: regexpressions help

2006-02-14 Thread Hans Meier (John Doe)
Hans Meier (John Doe) am Dienstag, 14. Februar 2006 21.35: > if (/^\s*([A-Z][a-z])+\s*([A-Z][a-z])+\s*$/) { > # input is ok, so now we format: > my $formatted="$1 $2"; > do_something_with($formatted); > } Sorry, this is completely bullshit, shuld have tested b

Re: regexpressions help

2006-02-14 Thread Hans Meier (John Doe)
Gerald Wheeler am Dienstag, 14. Februar 2006 21.03: > I am trying to allow input of a person's first and last name in one form > field, nothing more, nothing less > > There should be only one uppercase A-Z character followed by one or > more lowercase a-z characters followed by one space followed b

[RESOLVED (workaround?)] Re: Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-14 Thread Hans Meier (John Doe)
Hans Meier (John Doe) am Dienstag, 14. Februar 2006 19.08: > It's very strange: > > My apache doesn't start with > > [error] Can't locate SMF/Config.pm in @INC (@INC contains: /opt/smf/lib > [...]) at /opt/smf/apconf/backend/httpd_startup_smf.pl line 228. > &g

Strange "Can't locate Module.pm in @INC" error after chaning from 'use lib' to PERL5LIB

2006-02-14 Thread Hans Meier (John Doe)
Dear list It's very strange: My apache doesn't start with [error] Can't locate SMF/Config.pm in @INC (@INC contains: /opt/smf/lib [...]) at /opt/smf/apconf/backend/httpd_startup_smf.pl line 228. But why? The file is there: # ls /opt/smf/lib/SMF/Config.pm /opt/smf/lib/SMF/Config.pm and the pa

Re: BerkeleyDB

2006-02-13 Thread Hans Meier (John Doe)
Tom Allison am Dienstag, 14. Februar 2006 02.28: > I was trying out some jobs with the Berkeley DB and decided to move up from > DB_File to BerkeleyDB. I don't need a lot of features, just speed. > > But I keep running into a "dumb" error that doesn't make any sense to me. > untie attempted while

Re: single step - debug mode

2006-02-13 Thread Hans Meier (John Doe)
Stephen Mayer am Montag, 13. Februar 2006 17.25: > Bruce, > > What you want to use is `perl -d file.pl ` ...and especially the manuals provided with every perl installation, which is a very valuable source for information. Some tips: $ perldoc perl # lists manuals. # search if a manual exist

Re: substitution

2006-02-13 Thread Hans Meier (John Doe)
Bowen, Bruce am Sonntag, 12. Februar 2006 22.31: > I have a text string = "^0176 ^0176" > > I have set $a = "^0176 ^0176"; > I have set $b = "^0176 "; > > I'm using text =~ s/$a/$b/g; > > And the text string doesn't change. I expected it to come out as "^0176 " > after the substitution. What

Re: Checking a list for a value

2006-02-11 Thread John Doe
David Gilden am Samstag, 11. Februar 2006 21.54: > I would like to loop through 'all' acceptable values in an array (my white > list) then assign a pass or fail value. > > In the following code does not accomplish this, it needs to go through the > entire list before assigning a value. > > > #!/usr

Re: text file to xml to database

2006-02-11 Thread John Doe
I BioKid am Samstag, 11. Februar 2006 20.39: > Dear All, Hi again > We have a text based database, now we want to implement web services for > the for people around the world for a programmatic access to our server. This is a quite general task. I think the people on this perl list would help

Re: text file to xml to database

2006-02-11 Thread John Doe
I BioKid am Samstag, 11. Februar 2006 17.47: > hi all, Hi There are reasons why you didn't get answers you like. > I need technical advice from all perlbuddies, There are quite a lot of perlbuddies... > I have 2 text files and I want to convert it to XML and then to a > database. It will b

Re: array iteration problem

2006-02-08 Thread John Doe
JupiterHost.Net am Mittwoch, 8. Februar 2006 15.51: > > use strict; # forces declaring variables > > use warnings; > > yep yep :) > > >>@cpv_codes=('a','a','a','a','b','b','b','c','c','d'); > > > > my @letters=(qw{ a a a a b b b c c d }); > > No neeed for the (), which also make sit easier to write

Re: array iteration problem

2006-02-08 Thread John Doe
Graeme McLaren am Mittwoch, 8. Februar 2006 14.53: > Hi all, I have the following code: Hi Graeme > # code use strict; # forces declaring variables use warnings; > @cpv_codes=('a','a','a','a','b','b','b','c','c','d'); my @letters=(qw{ a a a a b b b c c d }); # qw (

Re: how to get filehandle-lock effective accross multi-process

2006-02-07 Thread John Doe
Jeff Pang am Dienstag, 7. Februar 2006 10.47: > hello,lists, Hello Jeff > I open a file and obtained a filehandle.then I fork a child and access this > file in child (via the duplicate filehandle from parent).If both parent and > child are writting to the file at the same time,the things should bec

Re: Fwd: Re: dbm again

2006-02-06 Thread John Doe
docs, and won't, and have never used dbmopen. It's deprecated. I think as a beginner you should not use deprecated things. Please read perldoc -f dbmopen and follow the advice there :-) hth, joe [top post history:] > >>>John Doe <[EMAIL PROTECTED]> 02/06/06 1

Re: dbm again

2006-02-06 Thread John Doe
Anders Stegmann am Montag, 6. Februar 2006 12.30: > Hi! Hi Anders > Can anyone tell me why this script doesn't work? > > > use strict; > use warnings; > > my %hash = (); > > my $key1 = 'nul'; > my $en = 'en'; > my $to = 'to'; > my $tre = 'tre'; > > > $hash{$key1} = [$en, $to, $tre]; > > dbmopen(m

Re: Duplicates elements in an array

2006-02-06 Thread John Doe
anand kumar am Montag, 6. Februar 2006 08.34: > Hi all > > I have an array with hundreads of elements in it. Can anyone > suggest the easiest way to keep only the duplicate elements in the array. Hi Anand Depends a bit if you want to keep all duplicates of a duplicate element or jus

Re: On Focus

2006-02-06 Thread John Doe
> On 2/5/06, Ron Smith wrote: > > Hi all, > > > > I've been looking for this all over, but can't seem to find a link. Is > > there a Perl or PerlScript equivalent to the JavaScript or vbscript > > on-focus function? If there is, could someone please, point me in the > > right direction. > > > > O

Re: Saving Content of HTTP::Response Directly To Disk

2006-02-04 Thread John Doe
Stephen Le am Sonntag, 5. Februar 2006 04.09: > I'm writing a download manager in Perl and using the LWP library of > Perl modules. > > Is there any way I can save the contents of a HTTP::Response object > directly to disk? I don't want particularly large requests to be > cached into memory. Stora

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-03 Thread John Doe
Angus am Freitag, 3. Februar 2006 10.13: > Joe, > > Thank you for taking the time to explain this bit of code. I have spent > some time trying to understand the ternary operator (?:) this evening and I > think it is making more sense. In the past I have seen this operator and > moved on in favor

Re: Closing and Re-Opening the Same File Problem

2006-02-02 Thread John Doe
[EMAIL PROTECTED] am Donnerstag, 2. Februar 2006 19.35: > Here's my problem: > > I am writing a program that opens one file (pricedata.csv) as input, does > some processing, and opens a new file (PriceDataRfrmtd1.txt) for ouput. > Subsequently I close both files. So far so good. Now, within th

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-02 Thread John Doe
n the two different values (means: the two different IPs) within an arrayref." I hope this helps and my english was not too confusing. Just play around with map to get the feeling. I remember that it is not easy to understand at the beginning, but if you get the idea, you won't miss it

Re: Escaping large chunk of text for insertion into mysql

2006-02-01 Thread John Doe
Kevin Old am Mittwoch, 1. Februar 2006 13.44: > Hello everyone, > > I have a large chunk of data that I need to insert into a text or blob > field in mysql. I've tried all the usually escaping it, but nothing > seems to work. I'm even using dbh->quote as I thought it might help. > > Here's my cod

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread John Doe
Sorry for another mail, but there are too many typos: > Also untested: > > # If no conflict, value is hostname. > # If conflict, value is arrayref with the two different IPs > # > my @res = map { > ($actual{$_} eq $register{$_}) > ? $_ > : [$actual{$_}, $register{$_}] > > } sort keys %regist

Re: How to compare hashes to find matching keys with conflicting values.

2006-02-01 Thread John Doe
Angus am Mittwoch, 1. Februar 2006 10.04: > Hello, > > > > I am trying to write a little script that will compare two hashes with the > same keys but conflicting values. I have found some great examples of how > to compare hashes and locate common keys or missing keys (in the cookbook). > I have a

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 16.50: > John Doe wrote: > >Andrej Kastrin am Montag, 30. Januar 2006 10.14: > >>Dear all, > >> > >>I have bar separated file: > >>name1|345 > >>name2|201 > >>... > >> > >>I

Re: Hash problem

2006-01-30 Thread John Doe
Andrej Kastrin am Montag, 30. Januar 2006 10.14: > Dear all, > > I have bar separated file: > name1|345 > name2|201 > ... > > I store it into a hash; > while () { >chomp; >($name,$score) = split (/\|/,$_); >$hash{$name} = $score; > } Let's assume the resulting hash is %scores. > Then

Re: Simple RegEx expresion

2006-01-25 Thread John Doe
George Homorozeanu am Mittwoch, 25. Januar 2006 16.12: > I need it with RegEx, that's my problem. > > Thanks, > > George. > > "Xavier Noria" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > > > On Jan 25, 2006, at 12:23, George Homorozeanu wrote: > >> I am very new in RegEx and

Re: Quick regex question

2006-01-24 Thread John Doe
Chris am Dienstag, 24. Januar 2006 22.35: > Hi list, > > I am not sure if there is a proper name for this but was having some > difficulty searching for it. > > Basically I have data in a file that is between two different > characters, for example: > > # data data > data > data data data * > # mor

Re: Array problem

2006-01-22 Thread John Doe
Andrej Kastrin am Montag, 23. Januar 2006 07.55: > I wrote simple script, which have to concatenate multiple lines into > array and then print each element of tihis array: > > I don't know where is the problem, Please, help! The basic problem is that you try to print the result within the (while)

Re: File Parsing

2006-01-22 Thread John Doe
William Black am Sonntag, 22. Januar 2006 15.33: > Hello, > > I'm reading from a file. I'm trying to read in five lines at a time where > each line has a newline and then process the lines into separare variables. > For example, > > Input File > - > Stevens, > Craig A Triangle Family C

Re: problems with subroutine prototype checking

2006-01-20 Thread John Doe
Hello Gavin Gavin Bowlby am Freitag, 20. Januar 2006 01.43: [...] > I probably wasn't clear in my original posting, the problem I'm having > is that the code sample I gave *does* compile successfully, I don't think so, because you try to use packages that are not declared. > without > errors.

Re: Using XML::Simple [SORRY - correction]

2006-01-19 Thread John Doe
John Doe am Donnerstag, 19. Januar 2006 12.43: > $VAR1->{LayerList}->{LayerDetails}= >[ map {%$_} @{$VAR1->{LayerList}->{LayerDetails}} ]; This should be: $VAR1->{LayerList}->{LayerDetails}= [ map {values %$_} @{$VAR1->{LayerList}->{LayerDetails}} ]; (T

Re: Using XML::Simple

2006-01-19 Thread John Doe
Bjorn Van Blanckenberg am Donnerstag, 19. Januar 2006 09.33: > I have some elements in my xml that are empty but have attributes. > I would like that I can group the element in function of Attribute Name. > > Status="Available"> > > > > >

Re: Transform column into row

2006-01-19 Thread John Doe
Dr.Ruud am Donnerstag, 19. Januar 2006 00.49: > John Doe schreef: > > In constrast to the other presented solutions using a a hash slurping > > all data from the intput file, the advantage of my solution is that > > it is *capable to handle 300GB input files* even with 1

Re: Transform column into row

2006-01-18 Thread John Doe
Andrej Kastrin am Mittwoch, 18. Januar 2006 10.49: > Dear Perl users, > > what's the best way to transform column table in row format. I know how > to split each line according to delimiter and than put it separately > into array, but I have more complicated problem (with multiple equal > records

Re: Transform column into row (correction)

2006-01-18 Thread John Doe
John Doe am Mittwoch, 18. Januar 2006 15.30: [...] > Another way (I don's say a better :-) ) could be not using a data > structure, but doing the transformation on the fly: > > - read a line of the input data > - record the first or a new field name while scanning (id001 et

Re: Transform column into row

2006-01-18 Thread John Doe
Paul Johnson am Mittwoch, 18. Januar 2006 13.53: > On Wed, Jan 18, 2006 at 01:34:01PM +0100, John Doe wrote: > > Andrej Kastrin am Mittwoch, 18. Januar 2006 10.49: > > > Dear Perl users, > > > > > > what's the best way to transform column table in row fo

Re: Transform column into row

2006-01-18 Thread John Doe
Andrej Kastrin am Mittwoch, 18. Januar 2006 10.49: > Dear Perl users, > > what's the best way to transform column table in row format. I know how > to split each line according to delimiter and than put it separately > into array, but I have more complicated problem (with multiple equal > records

Re: interpolation

2006-01-16 Thread John Doe
Shawn Corey am Montag, 16. Januar 2006 16.55: > John Doe wrote: > > The Ghost am Montag, 16. Januar 2006 06.34: > >>I am storing text stings in a database. when I have the string: > >> > >>'some perl $variable' > >> > >>which would

Re: Combine multiple lines into one line

2006-01-16 Thread John Doe
Andrej Kastrin am Montag, 16. Januar 2006 14.32: > Hi all, > > I have the file, which looks like: > > *RECORD* > *ID* > 001 > *TITLE* > Here is title number one. > *ABSTRACT* > First sentence of the abstract. Second sentence of the abstract... > Second line of the abstract. > > *RECORD* > *ID* > 00

Re: about the var's scope

2006-01-16 Thread John Doe
Shawn Corey am Montag, 16. Januar 2006 04.12: [...] > > Ok, it would be interesting to look deeper into the mess of different > > variables all named with the same name $q, exported across the modules, > > overwritten by several imports... > > > > What do you want to achieve with your code? It look

Re: interpolation

2006-01-15 Thread John Doe
The Ghost am Montag, 16. Januar 2006 06.34: > I am storing text stings in a database. when I have the string: > > 'some perl $variable' > > which would print as: > > some perl $variable > > how can I force interpolation of '$variable'? > > one idea I thought of was: > #!/usr/bin/perl > my $var='va

Re: about the var's scope

2006-01-15 Thread John Doe
Shawn Corey am Montag, 16. Januar 2006 04.12: > John Doe wrote: > > [reordered to bottom style posting] > > > > Jeff Pang am Montag, 16. Januar 2006 01.59: > >>Thanks for Shawn.The main script can see the global var $q coming from > >>module,since the mai

Re: about the var's scope

2006-01-15 Thread John Doe
[reordered to bottom style posting] > -Original Message- > > >From: Shawn Corey <[EMAIL PROTECTED]> > >Sent: Jan 15, 2006 10:58 PM > >To: beginners@perl.org > >Subject: Re: about the var's scope > > > >Jeff Pang wrote: > >> Hello,lists, > >> > >> Seeing these code below please.I can't know

Re: interpolation

2006-01-15 Thread John Doe
The Ghost am Freitag, 13. Januar 2006 21.23: > I know I could do that, but what if I don't know the variable names > in the string? > > > $sql=~s/\$Status/$Status/; > > could I do: > $sql=~s/\$(\S+)/${$1}/; > > On Jan 10, 2006, at 5:57 PM, John Doe wrote: > &g

Re: the 'tail' problem

2006-01-14 Thread John Doe
Jeff Pang am Samstag, 14. Januar 2006 12.52: > Thanks for Adriano.I have tried the way that mentioned by you,and found > it's no use for me. should the '-F' option have no effect for symlinks > maybe? > > -Original Message- > > >From: Adriano Ferreira <[EMAIL PROTECTED]> > >Sent: Jan 14,

Re: Matching the first string

2006-01-13 Thread John Doe
[EMAIL PROTECTED] am Freitag, 13. Januar 2006 18.28: [...] > > i`ve written a script whose purpose is to put files in different > > directories by its first later, the problem is that every file begins > > with different chars for example "01 - Eminem Encore.mp3" > > my question is how can i get to

Re: Matching the first string

2006-01-12 Thread John Doe
alex litvak am Donnerstag, 12. Januar 2006 21.11: > Hello all > im new in perl and i need some help > > i`ve written a script whose purpose is to put files in different > directories by its first later, the problem is that every file begins > with different chars for example "01 - Eminem Encore.mp3

Re: Help with my thought process...parsing a log

2006-01-11 Thread John Doe
Robert Hicks am Mittwoch, 11. Januar 2006 17.00: > "John Doe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > Robert Hicks am Dienstag, 10. Januar 2006 18.16: > > > I have an application log that shows the "time", "id

Re: interpolation

2006-01-10 Thread John Doe
The Ghost am Dienstag, 10. Januar 2006 21.57: > I want to pull some text from a database: > > RxNumber in (select RxNumber FROM restoreReports WHERE Status in > $Status) > > then I want perl to use this string and interpolate the variables > ($Status). > > so: > > my $Status= "('New','Old')"; > my

Re: string interpolation when reading from a file

2006-01-10 Thread John Doe
Dan Huston am Dienstag, 10. Januar 2006 21.40: > Greetings -- > > I am reading text sql commands) from a file, chopping it into sections > and then writing each section out to a different file. Within the text > are perl variables that I had expected to be interpolated as they were > written out to

Re: Add comment to a pattern matched file line

2006-01-10 Thread John Doe
Vincent Li am Dienstag, 10. Januar 2006 19.59: > Hi List: Hi Vincent > I have two files like this: > > file1: > score CN_SUBJ_PROMOTE3.100 # [0.000..3.100] > score CN_SUBJ_PROMOTION 3.600 # [0.000..3.600] > score CN_SUBJ_PROVIDE3.000 # [0.000..3.000] >

Re: Understanding Benchmark results

2006-01-10 Thread John Doe
Steve Bertrand am Dienstag, 10. Januar 2006 18.24: > Hi all, Hi Steve > I've a project on the go, where I must compare a single field of more > than 3 million database records, then sort them largest to smallest. The > field will contain up to a 6 digit integer. (I think you must have a reason n

Re: Help with my thought process...parsing a log

2006-01-10 Thread John Doe
Robert Hicks am Dienstag, 10. Januar 2006 18.16: > I have an application log that shows the "time", "id" and "type" for a user > logging in. A short except looks like this: > > 19/12/2005 07:28:37 User (guest) logging in from (LIMS-CIT) - Assigned > Userno (7045) > 19/12/2005 07:32:06 User (guest

Re: Byte array

2006-01-10 Thread John Doe
John Doe am Dienstag, 10. Januar 2006 15.06: > [EMAIL PROTECTED] am Dienstag, 10. Januar 2006 14.08: > > I'm new to Perl and am trying to set a variable length byte array that is > > passed to a socket as a string for output. I have the following which > > works, but the

  1   2   3   4   >