Re: Fwd: Win32::OLE merge rtf files - table structure missing

2022-06-15 Thread perl kamal
Hi Mike, Gratitude for coming forward to refine the solution. Please find the attached file which is considered as the source file where I am trying to extract the 2D measurements data and format those results in a table and would like to keep them inside the "comments:" section at the

Re: Fwd: Win32::OLE merge rtf files - table structure missing

2022-06-15 Thread Mike
Thank you.  I received a small file: "source.rtf" and a larger 1.9 MB file: "source.RTF". "source.RTF" has a table and graphic graphs - 2 pages total. "source.rtf" is just 2

Re: Win32::OLE merge rtf files - table structure missing

2022-06-14 Thread perl kamal
ent from a > paragraph,construct a table with the processed data and update it at the > "Comments:'' table which is at the end of the file. > My expected table structure is not updated while merging the contents. > Your comments/suggestions will be much appreciated.Thanks. >

Fwd: Win32::OLE merge rtf files - table structure missing

2022-06-14 Thread perl kamal
so far , 1. Parses the rtf file, writing the raw content into a temp file. 2. Extracting the required data into a temp file1. 3. Formatting the required data ( table structure) into a temp file2 4. Merges the formatted data from temp2 into the source rtf file at the end(expectation

Re: Win32::OLE merge rtf files - table structure missing

2022-06-14 Thread Mike
There are a bunch of steps there. When you say "construct a table" - in what format? Is the finished product an html file? Do you know how to parse the rtf file already? If not, send an rtf file to me at te...@mflan.com I have attached a file to see if the list accepts attachment

Win32::OLE merge rtf files - table structure missing

2022-06-13 Thread perl kamal
Hi, Greetings!!! I am trying to process an rtf file , get the content from a paragraph,construct a table with the processed data and update it at the "Comments:'' table which is at the end of the file. My expected table structure is not updated while merging the contents. Your comme

Re: DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name

2013-10-09 Thread mailing lists
The error is the comma before AUTO_INCREMENT. Sorry for the noise. - Mensaje original - De: mailing lists Para: "beginners@perl.org" CC: Enviado: Miércoles 9 de octubre de 2013 11:10 Asunto: DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no co

DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name

2013-10-09 Thread mailing lists
, attribute_params, share_parents) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name at ./test.pl line 49. DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name at ./test.pl line 49. and

Re: Tell me how to use CGI.pm in table

2013-05-18 Thread Masayoshi Fujimoto
help me. > > I can only see Hilary Duff. > > I can not see Taylor Momsen. > > I would like to use table for that. > > How should I do? > > > > ## Here is my script. > > #!/usr/bin/perl > > use Modern::Perl; > > use autodie; > > use CGI;

Re: Tell me how to use CGI.pm in table

2013-05-18 Thread timothy adigun
Hi Masayoshi, On Sat, May 18, 2013 at 12:51 AM, Masayoshi Fujimoto < m.fujim...@rocketmail.com> wrote: > Hi > Please help me. > I can only see Hilary Duff. > I can not see Taylor Momsen. > I would like to use table for that. > How should I do? > > ## Here is my s

Tell me how to use CGI.pm in table

2013-05-17 Thread Masayoshi Fujimoto
Hi Please help me. I can only see Hilary Duff. I can not see Taylor Momsen. I would like to use table for that. How should I do? ## Here is my script. #!/usr/bin/perl use Modern::Perl; use autodie; use CGI; my $q = CGI->new; my %label = ( celeb => 'Who d

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: > On Thu, 5 Jul 2012 09:30:01 -0400 > Phil Pinkerton wrote: >> ok using the example input file I got errors >> >> Use of uninitialized value $current_resource in string eq >> at /Library/Perl/5.12/SVN/Access.pm line 70, line 3. > [...] >> Inva

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: > On Thu, 5 Jul 2012 09:30:01 -0400 > Phil Pinkerton wrote: >> ok using the example input file I got errors >> >> Use of uninitialized value $current_resource in string eq >> at /Library/Perl/5.12/SVN/Access.pm line 70, line 3. > [...] >> Inva

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 5, 2012, at 10:46 AM, David Precious wrote: > On Thu, 5 Jul 2012 09:30:01 -0400 > Phil Pinkerton wrote: >> ok using the example input file I got errors >> >> Use of uninitialized value $current_resource in string eq >> at /Library/Perl/5.12/SVN/Access.pm line 70, line 3. > [...] >> Inva

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread David Precious
On Thu, 5 Jul 2012 09:30:01 -0400 Phil Pinkerton wrote: > ok using the example input file I got errors > > Use of uninitialized value $current_resource in string eq > at /Library/Perl/5.12/SVN/Access.pm line 70, line 3. [...] > Invalid resource format in ! (format 'repo:/path')! Ah, I recall no

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 4, 2012, at 5:46 PM, Chris Charley wrote: > > > "Phil Pinkerton" wrote in message > news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... >> Very nice to know about CPAN. >> >> got a syntax error though with your script >> >> syntax error at ./getACLinfo.pl line 51, near "say join"

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-05 Thread Phil Pinkerton
On Jul 4, 2012, at 6:02 PM, David Precious wrote: > On Wed, 4 Jul 2012 17:01:35 -0400 > Phil Pinkerton wrote: > >> Very nice to know about CPAN. > > IMO, CPAN is one of Perl's strongest features :) > > >> got a syntax error though with your script >> >> syntax error at ./getACLinfo.pl line

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
> > "Phil Pinkerton" wrote in message > news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... >> Very nice to know about CPAN. >> >> got a syntax error though with your script >> >> syntax error at ./getACLinfo.pl line 51, near "say join" >> Execution of ./getACLinfo.pl aborted due to compil

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
Wow I am impressed on the 4th of July no-less I have revision 5 version 14 subversion 2 on linux and v5.12.3 on my mac On Jul 4, 2012, at 5:46 PM, Chris Charley wrote: > > > "Phil Pinkerton" wrote in message > news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... >> Very nice to know about

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread David Precious
On Wed, 4 Jul 2012 17:01:35 -0400 Phil Pinkerton wrote: > Very nice to know about CPAN. IMO, CPAN is one of Perl's strongest features :) > got a syntax error though with your script > > syntax error at ./getACLinfo.pl line 51, near "say join" > Execution of ./getACLinfo.pl aborted due to com

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Chris Charley
"Phil Pinkerton" wrote in message news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com... Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near "say join" Execution of ./getACLinfo.pl aborted due to compilation errors. [code]

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-04 Thread Phil Pinkerton
Very nice to know about CPAN. got a syntax error though with your script syntax error at ./getACLinfo.pl line 51, near "say join" Execution of ./getACLinfo.pl aborted due to compilation errors. [code] #!/usr/bin/perl use strict; use SVN::Access; my $acl = SVN::Access->new( acl_file => 'data' );

Re: Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-03 Thread David Precious
On Tue, 3 Jul 2012 09:47:00 -0400 Phil Pinkerton wrote: > I was given a project that seems to require Perl > > I could use a sample just to extract a list of names associated with > a group or repo and print them. > > 1) Assigned a task to extract data fron a text file. > 2) Output file needs t

Newbie Where to start perhaps a hash-table is what I need to learn about ?

2012-07-03 Thread Phil Pinkerton
I was given a project that seems to require Perl I could use a sample just to extract a list of names associated with a group or repo and print them. 1) Assigned a task to extract data fron a text file. 2) Output file needs to be very specific, and created monthly 3) tried doing in korn shell to

Re: PDF::Table

2012-02-22 Thread washide
On 22 Lut, 08:57, artur.ad...@gmail.com (washide) wrote: > I look for metod or variable which can give me information about > position of the bottom corner of the table. > I want to put text after table object in PDF. Rows in Table are > creataind in dynamic way so i do not konw how

PDF::Table

2012-02-22 Thread washide
I look for metod or variable which can give me information about position of the bottom corner of the table. I want to put text after table object in PDF. Rows in Table are creataind in dynamic way so i do not konw how many i will have. -- washide -- To unsubscribe, e-mail: beginners-unsubscr

Re: DBIx::Class add rows to table, confusion in perldoc example....

2012-02-05 Thread Dermot
um->year('1975'); $new_album->update; > > But the tables album has only three columns which are: "album" table with > three columns: "albumid", "artist", and "title" > > so what does year and label stand for? sorry i am confused. do

DBIx::Class add rows to table, confusion in perldoc example....

2012-02-04 Thread Rajeev Prasad
tle => 'Wish You Were Here', artist => 'Pink Floyd' }); Now you can add data to the new record: $new_album->label('Capitol'); $new_album->year('1975'); $new_album->update; But the tables album has only three columns which are: "album&quo

Re: dinamic table creation with cgi.pm

2011-10-28 Thread Pau Marc Munoz Torres
chrow_array()){ > > Well, ignoring the mis-spellings here and the fact that "$q" should be > "$query". > > > > >print "$data[0]$data[1]\n"; > > Make sure you avoid HTML injection / Cross-site scripting (XSS) attacks > here: > > htt

Re: dinamic table creation with cgi.pm

2011-10-28 Thread Shlomi Fish
and the fact that "$q" should be "$query". > >print "$data[0]$data[1]\n"; Make sure you avoid HTML injection / Cross-site scripting (XSS) attacks here: http://en.wikipedia.org/wiki/Cross-site_scripting Regards, Shlomi Fish > > } > > p

Re: dinamic table creation with cgi.pm

2011-10-28 Thread Pau Marc Munoz Torres
; >> >> $query->execute(); >> >> print ""; >> > > print $h->start_table(); > > > while(my @data=Sq->featchrow_array()){ >> >>print "$data[0]$**data[1]\n"; >> > > print $h->Tr( td($data[0]), td($d

Re: dinamic table creation with cgi.pm

2011-10-28 Thread Shawn H Corey
), td($data[1]) ); } print ""; print $h->end_table(); print $h->end_html; How do you would script the table part on cgi.pm, please, notice that the table could be really hugh and take a long time to be compleatly written, so , i would like to be printed as long as i'm reciving t

dinamic table creation with cgi.pm

2011-10-28 Thread Pau Marc Munoz Torres
ot;select name, age from student"); $query->execute(); print ""; while(my @data=Sq->featchrow_array()){ print "$data[0]$data[1]\n"; } print ""; print $h->end_html; How do you would script the table part on cgi.pm, please, notice that the t

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: Fwd: how to parse complex table

2011-04-25 Thread galeb abu-ali
thanks Peter, code looks elegant now! "like chiseling away everything that is not David from a block of marble :-) " very cool reference!

Re: Fwd: how to parse complex table

2011-04-24 Thread Peter Scott
On Sun, 24 Apr 2011 18:14:52 -0400, galeb abu-ali wrote: > I revised the code to the following: [...] > for my $file( @ARGV ) { > open( my $IN, "<", $file ) or die "Failed to open: $!\n"; > > my( %cog_cat, %cog_id, @cogs, $oid, $locus, $source, $cluster_info > ); > > while( my $li

Fwd: how to parse complex table

2011-04-24 Thread galeb abu-ali
rase/DNA polymerase involved in DNA repair Many thanks again! Must've spent ~ 4 days on this. I've been flirting with Perl less than a year, it's so seductive I find myself debating whether to go back to school. cheers galeb On Sat, Apr 23, 2011 at 3:30 PM, Mike McCl

Re: how to parse complex table

2011-04-23 Thread Mike McClain
On Sat, Apr 23, 2011 at 10:27:07AM -0400, galeb abu-ali wrote: > Hi, > > I'm trying to parse a table containing information about genes in a > bacterial chromosome. Below is a sample for one gene, and there's about 4500 > such blocks in a file: > My problem is that s

Re: how to parse complex table

2011-04-23 Thread Shawn H Corey
On 11-04-23 02:54 PM, galeb abu-ali wrote: using it do homework is considered abuse Using to do your homework is abuse. Using it to ask about homework isn't. The difference how much effort you put in. Some guidelines: 1. Say it's homework from the start. 2. Include the code you have so

Re: how to parse complex table

2011-04-23 Thread galeb abu-ali
i guess the sensitivity stemmed from reading random snippets from the thread 'the nature of this list' and how using it do homework is considered abuse, so i didn't want to fall in that category. thanks again galeb On Sat, Apr 23, 2011 at 12:51 PM, shawn wilson wrote: > On Sat, Apr 23, 2011 at

Re: how to parse complex table

2011-04-23 Thread shawn wilson
On Sat, Apr 23, 2011 at 11:56 AM, galeb abu-ali wrote: > 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. > it was a joke. i figured you were either a graduate student, researcher, or hacking around wit

Re: how to parse complex table

2011-04-23 Thread galeb abu-ali
te: > now, here's a homework question!! :) > > On Sat, Apr 23, 2011 at 10:27 AM, galeb abu-ali > wrote: > > Hi, > > > > I'm trying to parse a table containing information about genes in a > > bacterial chromosome. Below is a sample for one gene, and there&#

Re: how to parse complex table

2011-04-23 Thread shawn wilson
now, here's a homework question!! :) On Sat, Apr 23, 2011 at 10:27 AM, galeb abu-ali wrote: > Hi, > > I'm trying to parse a table containing information about genes in a > bacterial chromosome. Below is a sample for one gene, and there's about 4500 > such blocks in

how to parse complex table

2011-04-23 Thread galeb abu-ali
Hi, I'm trying to parse a table containing information about genes in a bacterial chromosome. Below is a sample for one gene, and there's about 4500 such blocks in a file: gene_oidLocus TagSourceCluster InformationGene InformationE-value 642745051

Fwd: parse complicated table

2011-04-23 Thread galeb abu-ali
Hi, I'm trying to parse a table containing information about genes in a bacterial chromosome. Below is a sample for several genes, and there's about 4500 such blocks in a file: gene_oidLocus TagSourceCluster InformationGene InformationE-value 642745051

Fwd: parse complicated table

2011-04-23 Thread galeb abu-ali
Hi, I'm trying to parse a table containing information about genes in a bacterial chromosome. Below is a sample for several genes, and there's about 4500 such blocks in a file: gene_oidLocus TagSourceCluster InformationGene InformationE-value 642745051

parse complicated table

2011-04-23 Thread galeb abu-ali
Hi, I'm trying to parse a table containing information about genes in a bacterial chromosome. Below is a sample for several genes, and there's about 4500 such blocks in a file: gene_oidLocus TagSourceCluster InformationGene InformationE-value 642745051

Re: need help designing a database table (or tables) to hold a hash ( %config) and ( %group)

2011-04-22 Thread shawn wilson
hat i want to do is , my deployment script should > only allow users who are logged in  to deploy a particular website ( > eg website_auto_1 )  if they belong to the group . > ok, now we might be getting somewhere, you want user groups and object groups? so give your objects gids. i general

need help designing a database table (or tables) to hold a hash ( %config) and ( %group)

2011-04-22 Thread Agnello George
Hi All i am creating a script for deployment of websites and i need to create hash%config ( which stores a lot of configurations setting for each type of website ) ... i have been manually eaditing this hash but now the hash has to now be generated from a a database ( mysql ) ... i have

Template Toolkit for HTML Table with variable number of columns

2010-12-04 Thread Ramprasad Prasad
I have to show report from a database of a daily report of ids. I have simplified the code here Pasted at http://pastebin.com/v0XmMuZP #!/usr/bin/perl use strict; use Template; use CGI; # Everyday report from DB for each id # my %report = ( '2010-12-01' => { 1 => 'OK' , 2 => 'FAIL' , 4 => 'F

Re: Database table load utility

2010-11-09 Thread Chandrashekar Bhat
27;m in the thinking stages of creating a table-load utility, which reads > a > tab-separated CSV file and inserts or updates rows in a >>relational table > (probably Oracle). I don't think that will be too hard, having used Perl > DBI/DBD modules in the past. > > Sin

Re: Database table load utility

2010-11-08 Thread Parag Kalra
>>I'm in the thinking stages of creating a table-load utility, which reads a tab-separated CSV file and inserts or updates rows in a >>relational table (probably Oracle). I don't think that will be too hard, having used Perl DBI/DBD modules in the past. Since you are plann

Re: Database table load utility

2010-11-07 Thread Chap Harrison
On Nov 7, 2010, at 11:15 PM, shawn wilson wrote: > Ooh, I didn't know about inotify. Yeah, this is much more appealing. Looks like Linux::Inotify2 is better-supported than Linux::Inotify. > It would seem that you can either use it > within perl (just keep the script running like a service) or

Re: Database table load utility

2010-11-07 Thread shawn wilson
Ooh, I didn't know about inotify. It would seem that you can either use it within perl (just keep the script running like a service) or from a command line. I think it really comes down to how often you're expecting new files. And I don't know how the perl module works - its possible you might have

Re: Database table load utility

2010-11-07 Thread shawn wilson
ple concurrent instances of a cron job. Sorry, I realize that this is not specifically a Perl problem at this point, so I guess I'll need to research some Unix-y ways of handling this. > > > > > > >> On Nov 7, 2010 7:17 PM, "Chap Harrison" wrote: >>> H

Re: Database table load utility

2010-11-07 Thread Ishwor Gurung
Hi. On 8 November 2010 15:46, Chap Harrison wrote: > > On Nov 7, 2010, at 6:47 PM, shawn wilson wrote: > >> its Unix, I'd use cron as its probably already running. And do something >> like: script.pl $(find -type f -print0) Every few seconds. > > That looks plenty straightforward enough, except

Re: Database table load utility

2010-11-07 Thread Chap Harrison
Sorry, I realize that this is not specifically a Perl problem at this point, so I guess I'll need to research some Unix-y ways of handling this. > On Nov 7, 2010 7:17 PM, "Chap Harrison" wrote: >> Hi folks, >> >> I'm in the thinking stages o

Re: Database table load utility

2010-11-07 Thread shawn wilson
at. Loop through the files, use the csv module to separate your input (or 'split("\t", ...) ) and use dbo and insert your stuff. On Nov 7, 2010 7:17 PM, "Chap Harrison" wrote: > Hi folks, > > I'm in the thinking stages of creating a table-load utility, which read

Database table load utility

2010-11-07 Thread Chap Harrison
Hi folks, I'm in the thinking stages of creating a table-load utility, which reads a tab-separated CSV file and inserts or updates rows in a relational table (probably Oracle). I don't think that will be too hard, having used Perl DBI/DBD modules in the past. What's di

Re: how to arrange a default action in a dispatch table

2010-05-10 Thread Harry Putnam
"John W. Krahn" writes: > Because /\A\d+\z/ has less ambiguity then /^\d+$/. "Dr.Ruud" writes: > And /\A[0-9]+\z/ is probably what was really meant. Got it, and thank you both. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.or

Re: how to arrange a default action in a dispatch table

2010-05-10 Thread Dr.Ruud
John W. Krahn wrote: /\A\d+\z/ has less ambiguity then /^\d+$/. And /\A[0-9]+\z/ is probably what was really meant. -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
o get rid of some of the worst of the bad stuff below but how to make iteration happen at A and N? L and q are the only choices that shouldn't cause iteration One way I thought of is to just go with `if/elsif/else' and ditch the hash table. `if/elsif/else' seems to be more versatile.

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread John W. Krahn
ve ); ## This name represents a file from a different directory. my $r1name = "r1fname"; for ( my $i = 0; $i <= $#ar1; $i += 3 ) { dispt( $r1name, @ar1[ $i .. $i + 2 ] ); } ## dispatch table to handle file names sub dispt { ## This element will never be acted on. It is for display

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread John W. Krahn
Harry Putnam wrote: Philip Potter writes: I was asking, not suggesting one over the other. Â And was not offering an opinion on it don't now enough. You've trimmed the context I was referring to. But you said: But there are no trailing new lines.. guaranteed by: [example snipped] which

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Uri Guttman
> "HP" == Harry Putnam writes: HP> "Uri Guttman" writes: >> yes, i disable syntax coloring since it makes it HARDER for me to >> see HP> [...] HP> I'm terrible about leaving out one of "" '' () {} [] etc.. Emacs catches HP> them and leads me to them pretty quickly with syntax

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Philip Potter writes: >> I was asking, not suggesting one over the other.  And was not offering >> an opinion on it don't now enough. > > You've trimmed the context I was referring to. But you said: > >> But there are no trailing new lines.. guaranteed by: [example snipped] > > which looks li

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
en r2eight r2nine r2ten r2eleven r2twelve ); ## This name represents a file from a different directory. my $r1name = "r1fname"; for ( my $i = 0; $i <= $#ar1; $i += 3 ) { dispt( $r1name, @ar1[ $i .. $i + 2 ] ); } ## dispatch table to handle

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Philip Potter
On 8 May 2010 15:43, Harry Putnam wrote: > Philip Potter writes: > >> You are quite correct - there is no practical difference in this situation. >> >> [nitpick: actually, if $/ has been set to something other than "\n", >> $chosen may have a trailing "\n" character.] > > I was asking, not sugges

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Philip Potter writes: > You are quite correct - there is no practical difference in this situation. > > [nitpick: actually, if $/ has been set to something other than "\n", > $chosen may have a trailing "\n" character.] I was asking, not suggesting one over the other. And was not offering an op

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Philip Potter
On 8 May 2010 14:47, Harry Putnam wrote: > Philip Potter writes: >> On 8 May 2010 13:35, Harry Putnam wrote: >>> I'm curious about one thing I see there: >>> >>>  `/\A\d+\z/ ' as opposed to `/^\d+$/' >>> >>> in this snippet: >>> >>>        if ( $chosen =~ /\A\d+\z/ && $chosen >= 1 && $chosen <=

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Harry Putnam writes: > You mentioned once being an emacs user. > I notice when I write arrays qw like suggested... It confuses the > syntax highlight in cperl-mode and throws the highlight completely out > the window. Emacs is apparently using the quotes as part of how it > finds what to highli

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Shawn H Corey writes: > Harry Putnam wrote: >> Steve Bertrand writes: >> >>> use vi(m). >> >> Oh my god... the `V' word. I'll have to gouge my eyes out now, just >> from looking. >> >> > Then use cream :D I just meant I'm a dedicated emacs user for coding. I do

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Philip Potter writes: > On 8 May 2010 13:35, Harry Putnam wrote: >> I'm curious about one thing I see there: >> >>  `/\A\d+\z/ ' as opposed to `/^\d+$/' >> >> in this snippet: >> >>        if ( $chosen =~ /\A\d+\z/ && $chosen >= 1 && $chosen <= @h ) { >>            print "Taking some action on $

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Philip Potter
On 8 May 2010 13:35, Harry Putnam wrote: > I'm curious about one thing I see there: > >  `/\A\d+\z/ ' as opposed to `/^\d+$/' > > in this snippet: > >        if ( $chosen =~ /\A\d+\z/ && $chosen >= 1 && $chosen <= @h ) { >            print "Taking some action on $h[$chosen - 1]\n"; >            la

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
"John W. Krahn" writes: > Much simpler as: > > for ( my $i = 0; $i <= $#ar1; $i += 3 ) { > dispt( $r1name, @ar1[ $i .. $i + 2 ] ); > } [...] Man, that is a heck of a lot tidier. I was completely unfamiliar with that way of getting at parts of an array (though now I remember seeing some

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Philip Potter
On 8 May 2010 13:09, Harry Putnam wrote: > "Uri Guttman" writes: > >> yes, i disable syntax coloring since it makes it HARDER for me to >> see > > [...] > > I'm terrible about leaving out one of "" '' () {} [] etc.. I always enter them in pairs. eg I first type if (condition) {} then put the c

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
"Uri Guttman" writes: > yes, i disable syntax coloring since it makes it HARDER for me to > see [...] I'm terrible about leaving out one of "" '' () {} [] etc.. Emacs catches them and leads me to them pretty quickly with syntax hilight. my @ar = ( "one", "two". "three",

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Shawn H Corey
Harry Putnam wrote: Steve Bertrand writes: use vi(m). Oh my god... the `V' word. I'll have to gouge my eyes out now, just from looking. Then use cream :D -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and

Re: how to arrange a default action in a dispatch table

2010-05-08 Thread Harry Putnam
Steve Bertrand writes: > use vi(m). Oh my god... the `V' word. I'll have to gouge my eyes out now, just from looking. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Uri Guttman
> "HP" == Harry Putnam writes: HP> "Uri Guttman" writes: >> i haven't looked at the previous code but why is that being cleared here >> and pushed above? i don't get the purpose of the mod counter either. it >> just seems very odd but maybe there is a purpose. i won't delve to find

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Steve Bertrand
On 2010.05.07 21:09, Harry Putnam wrote: > "Uri Guttman" writes: > >> i haven't looked at the previous code but why is that being cleared here >> and pushed above? i don't get the purpose of the mod counter either. it >> just seems very odd but maybe there is a purpose. i won't delve to find >> o

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread John W. Krahn
Harry Putnam wrote: Summary: How to arrange for a default action in a dispatch table, along with several single Letter choics and numeric choices. Details: This script is a mock up of something I'm trying to do, and is way pared down from a much larger script... mostly its the dispatch

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Harry Putnam
Steve Bertrand writes: > Although I've expanded this out of a dispatch table and modified it to > prevent wrap, it is extremely understandable, even without further context: > > my $v4glue = $dns->v4glue(); > my $v6glue = $dns->v6glue(); > > $self->data(

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Harry Putnam
"Uri Guttman" writes: > i haven't looked at the previous code but why is that being cleared here > and pushed above? i don't get the purpose of the mod counter either. it > just seems very odd but maybe there is a purpose. i won't delve to find > out. The mod counter being cleared was just stupi

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> On 2010.05.07 19:37, Steve Bertrand wrote: >> (fwiw, and I don't have time to get into the rest of the code right now, >> I prefer whitespace, so I'd write that as): >> >> my @ar1 = qw ( >> r2one >> r2two >> r2three # comment, reader needs

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Steve Bertrand
On 2010.05.07 19:37, Steve Bertrand wrote: > (fwiw, and I don't have time to get into the rest of the code right now, > I prefer whitespace, so I'd write that as): > > my @ar1 = qw ( > r2one > r2two > r2three # comment, reader needs info for this var >

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Steve Bertrand
On 2010.05.07 19:58, Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > SB> (fwiw, and I don't have time to get into the rest of the code right now, > SB> I prefer whitespace, so I'd write that as): > > SB> my @ar1 = qw ( > SB> r2one > SB> r2two

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> On 2010.05.07 19:02, Harry Putnam wrote: >> It looks pretty awkward, the way I just kind of wedged the default >> action in there... is there a more canonical way of doing that? SB> I have to be honest ;) SB> There was a time a little while bac

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Steve Bertrand
es *mean*, it's too hard to tell. > > It may be all well and good when it's confined like this, but even in a > 50 line script, I'm continuously having to scroll back up to find out > what it means, and/or where it came from. > > I'd recommend a simpler example (as yo

Re: how to arrange a default action in a dispatch table

2010-05-07 Thread Steve Bertrand
o scroll back up to find out what it means, and/or where it came from. I'd recommend a simpler example (as your code screams example... even in examples, I found that following your coding practices even in examples is *very* beneficial), but use very descriptive names. Although I've ex

how to arrange a default action in a dispatch table

2010-05-07 Thread Harry Putnam
Summary: How to arrange for a default action in a dispatch table, along with several single Letter choics and numeric choices. Details: This script is a mock up of something I'm trying to do, and is way pared down from a much larger script... mostly its the dispatch table I'm workin

Re: Dispatch table using Tie::RegexpHash

2010-04-29 Thread Uri Guttman
races), it can be removed. that code is the same as: $dt{ a }->( 'uri' ); this same thing is used to simplify deep data accesses: $foo{ xx }->{ yy }->{ zz } becomes $foo{ xx }{ yy }{ zz } since i usually call code refs via a scalar that i have assigned, y

Re: Dispatch table using Tie::RegexpHash

2010-04-29 Thread Steve Bertrand
On 2010.04.29 23:23, Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > SB> use Tie::RegexpHash; > > SB> my $number = qr/^\d+$/; > SB> my $alpha = qr/^\w+$/; > > SB> tie my %dt, 'Tie::RegexpHash'; > > that sounds like an insane idea for a module. but that is IMO. you can >

Re: Dispatch table using Tie::RegexpHash

2010-04-29 Thread Uri Guttman
much less effort with a list of regexes paired with code refs. and if that fails or you can control the order, you can then try a regular dispatch table. there is no way this module can do anything else but a linear search through all the regexes and then it won't allow ordering which can be v

Dispatch table using Tie::RegexpHash

2010-04-29 Thread Steve Bertrand
Hi all, Given the threads on dispatch tables recently, I was writing a bit of a whitepaper on how dts are useful for consolidating code. I've run into an issue that I've been working on for some time (while also performing my job function ;), and I'm hoping that extra eyeballs will notice the pro

Re: prepare(SELECT ... FROM TABLE) error

2010-02-13 Thread Dr.Ruud
Jay Savage wrote: Dr.Ruud: Because $@ is a global, it is best practice to act on the return value of eval itself: [snip] $@ is also *guaranteed*--in the words of perlfunc--to be set correctly. I believe that historically this may not have been the case: $@ may have only been set on failure

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Jeff Peng
On Thu, Feb 11, 2010 at 2:03 AM, Jay Savage wrote: > > $@ is also *guaranteed*--in the words of perlfunc--to be set > correctly. I believe that historically this may not have been the > case: $@ may have only been set on failure and not flushed on success, > but in recent Perls it should be reliab

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Jay Savage
On Tue, Feb 9, 2010 at 8:05 PM, Dr.Ruud wrote: > Jay Savage wrote: > [snip] > Because $@ is a global, it is best practice to act on > the return value of eval itself: [snip] $@ is also *guaranteed*--in the words of perlfunc--to be set correctly. I believe that historically this may not have be

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Dr.Ruud
Jay Savage wrote: Wrap the call in an eval block. Then check $@ to see if there was a fatal error, which you can ignore if you want to or do something along the lines of: eval { my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); }; if ($@) {

Re: prepare(SELECT ... FROM TABLE) error

2010-02-09 Thread Jay Savage
On Wed, Feb 3, 2010 at 9:22 PM, Tony Esposito wrote: > This question has never been answered.  To out it another way, given the code > ... > >  foreach my $mytable (@mytables) { >  my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); >  # report error but move

  1   2   3   4   >