Re: RE unfriendly error

2005-04-11 Thread Peter Rabbitson
> brackets; it does not _capture_ 3 times. Only literally present/countable > brackets capture. Geee... I guess you are right :) Furthermore the following works without complaining about ?: perl -e "print 'ouch' unless ('123456-123256' =~ /^(\d{2})(\d{2})(\d{2})(?:-(\d{2})(\d{2})(\d{2}))?$/ );

Re: Regex against a scalar

2005-04-11 Thread M. Kristall
Offer Kaye wrote: On Wed, 23 Mar 2005 17:41:31 -0800, Perl wrote: Hi. I would like to search a scalar variable and have the output to another scalar. For example: $test = "This is some test data"; I want another scalar, $regex to hold the output of a regular expression lookup against $test. So some

pointers - references ??

2005-04-11 Thread Brent Clark
Hi all If anyone has the time and / or the will to help me understand. I know how to create / use references for perl. But would why would you use it. And I think more importantly when. Im busy reading / learning the Oreilly Advanced Perl Programming book. But for the likes of me I cant undertand

RE: pointers - references ??

2005-04-11 Thread Ankur Gupta
> If anyone has the time and / or the will to help me understand. > > I know how to create / use references for perl. But would why would you > use it. > And I think more importantly when. > > Im busy reading / learning the Oreilly Advanced Perl Programming book. > But for the likes of me I cant

Re: RE unfriendly error

2005-04-11 Thread John W. Krahn
Peter Rabbitson wrote: I am getting this: [EMAIL PROTECTED]:~$ perl -e "'123456-123456' =~ /^ (\d{2}){3} (?: - (\d{2}){3} )? $/x ? print 'yep' : print 'nope';" Panic opt close in regex m/^ (\d{2}){3} (?: - (\d{2}){3} )? $/ at -e line 1. It looks like the regular expression engine does not like the

Re: multidimensional arrays

2005-04-11 Thread John W. Krahn
Seamus Abshere wrote: dear Perl experts, my @array; $array[0] = split(' ','apples trucks'); $array[1] = split(' ','cars oranges'); i want to get "apples" from print $array[0][0] or print $array[0]->[0] but they don't work. If you had had warnings enabled then perl would have warned you abou

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: Brett Williams wrote: Hi :) Hello, I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" char

Errors while inserting into long data type

2005-04-11 Thread Mallik
Hi Friends, I am using oracle database and I have column of long data type. I insert the data into this column thru perl script. If the inserted data exceeds 4000 chars, it is giving me the following error. DBD::Oracle::st execute failed: ORA-01704: string literal too long (DBD ERROR: OCIStmtExec

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise that putting a space betwee

Re: pointers - references ??

2005-04-11 Thread John Doe
Am Montag, 11. April 2005 10.20 schrieb Brent Clark: > Hi all Hi Brent Here's my way to explain it from an "abstract" perspective more or less "outside" of the world of perl: [...] > I know how to create / use references for perl. But would why would you > use it. > And I think more importantly

Re: apache log parsing

2005-04-11 Thread Michele Ouellet
-- There exist some apps to make statistics from apache logs, -- e.g. awstats (awstats.sourceforge.net), analog, Webalizer and more. -- But don't know which one is the best, sorry. I don't know which is best either but I have been using awstats for an Intranet; it is reasonably easy to configure

system trouble

2005-04-11 Thread Jan Eden
Hi, I have to do some log processing with webalizer and tried to do the following: #!/usr/bin/perl use strict; use warnings; opendir(DIR, "/Users/jan/Sites/apache_logs") or die "Cannot open directory"; while (defined(my $file = readdir(DIR))) { if ($file =~ /^www/) { print "Processi

Re: system trouble

2005-04-11 Thread Robin
On Tuesday 12 April 2005 00:31, Jan Eden wrote: > system ("webalizer", "-c ./webalizer.conf", > "/Users/jan/Sites/apache_logs/$file"); } > } > closedir(DIR); > > webalizer complains that it cannot find the configuration file > (provided via the -c parameter). Try: system ("webalizer", "-c",

Re: system trouble

2005-04-11 Thread Jan Eden
Robin wrote on 12.04.2005: >On Tuesday 12 April 2005 00:31, Jan Eden wrote: >> system ("webalizer", "-c ./webalizer.conf", >> "/Users/jan/Sites/apache_logs/$file"); } >> } >> closedir(DIR); >> >> webalizer complains that it cannot find the configuration file >> (provided via the -c paramet

GUI

2005-04-11 Thread Octavian Rasnita
Hi, I would like to create Windows applications with a standard Windows GUI. I have seen that the applications created using ActiveState PerlTray use a standard Win32 GUI, but I would like to create a common Windows program that also has other simple controls like input boxes, radio buttons, lists

Re: GUI

2005-04-11 Thread Chris Devers
On Mon, 11 Apr 2005, Octavian Rasnita wrote: > I would like to create Windows applications with a standard Windows GUI. Check out WxWindows / WxPerl:

perl.beginners Weekly list FAQ posting

2005-04-11 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: nested replace string

2005-04-11 Thread Dave Gray
> Please help me in where I am going wrong and suggest me the solution. Since you have the data in nice XML format, why not use an XML parser instead of parsing it yourself? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

"gost" content in CGI param()

2005-04-11 Thread Fernando Villar
I get a strange error in one of my cgi's. The cgi works fine "almost" always, but from time to time I get an error: The cgi collect information from a wap (WML) form and sends it into params using the HTTP POST method. Well, the problem is that from time to time the server receives "gost" conte

Re: pointers - references ??

2005-04-11 Thread Jonathan Paton
> I know how to create / use references for perl. But would why would you > use it. Perl uses references for multidimensional/complex datastructures. Also used when doing OO in perl. > And I think more importantly when. Whenever appropriate. :) I probably make the greatest use of references w

Re: pointers - references ??

2005-04-11 Thread Jay Savage
On Apr 11, 2005 4:20 AM, Brent Clark <[EMAIL PROTECTED]> wrote: > Hi all > > If anyone has the time and / or the will to help me understand. > > I know how to create / use references for perl. But would why would you > use it. > And I think more importantly when. > > Im busy reading / learning

AutoIncrement Database Fields for MySQL and PostGreSQL

2005-04-11 Thread Siegfried Heintze
If I use the auto-increment feature for a couple of normalized relations, how do I insert into them? Specifically, when I insert into a relation with the autoincrement feature on the primary key, how do I get the value of the index on the newly created row so I can use that the value of a foreign

Re: AutoIncrement Database Fields for MySQL and PostGreSQL

2005-04-11 Thread toolscripts
"SELECT MAX(id)+1 as lastid FROM table" (It's not +1 if you already said INSERT etc) I'm not sure what normalized relations are, but I think this will help anyway. --t - Original Message - From: "Siegfried Heintze" <[EMAIL PROTECTED]> To: "'Perl Beginners'" Sent: Monday, April 11, 200

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise th

Re: AutoIncrement Database Fields for MySQL and PostGreSQL

2005-04-11 Thread Bob Showalter
Siegfried Heintze wrote: If I use the auto-increment feature for a couple of normalized relations, how do I insert into them? Specifically, when I insert into a relation with the autoincrement feature on the primary key, how do I get the value of the index on the newly created row so I can use that

RE: AutoIncrement Database Fields for MySQL and PostGreSQL

2005-04-11 Thread Siegfried Heintze
Thanks. I see that works for mysql. "my $lastid = $dbh->{mysql_insertid};" Is this a feature of MySQL or DBI? If it is not a feature of DBI, will it work for PostGreSQL? Thanks, Siegfried -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: As long as you realise that putting a space between the operator name and the left parenthesis may trigger a warning when warnings are enabled. (And you DO have warnings enabled, don't you?) $ perl -le'use warnings; print( 1,2,3,4,5 )' 12345 $ perl -le'us

Re: AutoIncrement Database Fields for MySQL and PostGreSQL

2005-04-11 Thread Bob Showalter
Siegfried Heintze wrote: Thanks. I see that works for mysql. "my $lastid = $dbh->{mysql_insertid};" Is this a feature of MySQL or DBI? It's a feature of MySQL, via the DBD::mysql driver. If it is not a feature of DBI, will it work for PostGreSQL? No, but there is a similar feature. Read the docs fo

RE: Errors while inserting into long data type

2005-04-11 Thread Mallik
Hi Philip, Thanks for your reply. It worked with bind_param. I have one more question, how to set the LongReadLen parameter in a perl script? Thanks, Mallik. -Original Message- From: Philip Mikal [mailto:[EMAIL PROTECTED] Sent: Monday, April 11, 2005 11:36 PM To: 'Mallik'; [EMAIL PR