Re: sprintf format question

2008-06-06 Thread April
On Jun 4, 8:00 am, [EMAIL PROTECTED] (Rob Dixon) wrote: April wrote: sprintf( %s%$Fmt%s, (%$Fmt=|, $TestStr, |)) This is in Perl for Dummies, 4th ed, p160. I'm trying to understand this ... the first part, %s%$Fmt%s, my understanding is the format part, which specifies the formats

sprintf format question

2008-06-04 Thread April
sprintf( %s%$Fmt%s, (%$Fmt=|, $TestStr, |)) This is in Perl for Dummies, 4th ed, p160. I'm trying to understand this ... the first part, %s%$Fmt%s, my understanding is the format part, which specifies the formats for the second part, thelist part, (% $Fmt=|, $TestStr, |): %s for %$Fmt=|, %$Fmt

Re: sprintf format question

2008-06-04 Thread Rob Dixon
April wrote: sprintf( %s%$Fmt%s, (%$Fmt=|, $TestStr, |)) This is in Perl for Dummies, 4th ed, p160. I'm trying to understand this ... the first part, %s%$Fmt%s, my understanding is the format part, which specifies the formats for the second part, thelist part, (% $Fmt=|, $TestStr, |):

Re: Format Question

2007-08-16 Thread Mathew Snyder
Tom Phoenix wrote: On 8/15/07, Mathew Snyder [EMAIL PROTECTED] wrote: How would I go about sub-listing something. For instance, if I have a work order that has been worked on during different days, I want to list the work order once and each day below it. It would look like this: Ticket

Re: Format Question

2007-08-16 Thread Chas Owens
On 8/16/07, Mathew Snyder [EMAIL PROTECTED] wrote: snip Would you recommend straight Perl to handle the formatting or is there another method that can handle this? snip There are many template modules in CPAN that might make your life easier, but in general I stick to printf. -- To

Format Question

2007-08-15 Thread Mathew Snyder
How would I go about sub-listing something. For instance, if I have a work order that has been worked on during different days, I want to list the work order once and each day below it. It would look like this: Ticket ID SubjectDate hh:mm

Re: Format Question

2007-08-15 Thread Tom Phoenix
On 8/15/07, Mathew Snyder [EMAIL PROTECTED] wrote: How would I go about sub-listing something. For instance, if I have a work order that has been worked on during different days, I want to list the work order once and each day below it. It would look like this: Ticket ID

Re: FORMAT question

2006-07-05 Thread Offer Kaye
On 7/5/06, Jeff Peng wrote: Hello, I think there are not relation between your implement and the filehandle. As far as I can tell, a format must have the same name as the filehandle to which you want to print it, and once you define a format you cannot change it. So these 2 facts mean you

Re: FORMAT question

2006-07-05 Thread Jeff Peng
Here a script that illustrates my current workaround: #! /usr/bin/env perl use strict; use warnings; my $outfile = file_with_tables.txt; open(OUT,$outfile) or die Couldn't open $outfile for writing: $!\n; print OUT Table 1:\n; _print_format1(1,15,foo); _print_format1(2,8,bar); close(OUT) or

Re: FORMAT question

2006-07-05 Thread Mumia W.
Offer Kaye wrote: Hi, Can anyone tell me if it is possible to define 2 different formats for the same filehandle? The reason I am asking is that I want to print 2 different tables to the same text file and I don't want to use printf statements. For me at least, code that uses printf to print

Re: FORMAT question

2006-07-05 Thread John W. Krahn
Offer Kaye wrote: Hi, Hello, Can anyone tell me if it is possible to define 2 different formats for the same filehandle? The reason I am asking is that I want to print 2 different tables to the same text file and I don't want to use printf statements. For me at least, code that uses

Re: FORMAT question

2006-07-05 Thread Offer Kaye
On 7/5/06, John W. Krahn wrote: #!/usr/bin/perl use warnings; use strict; sub _print_format1 { # output table 1, with 3 columns $^A = ''; formline 'FORMAT', @_; @ @ @ FORMAT $^A; } Wow. That's... impressive. Very perl-foo-ish :) A simple and nice solution,

Re: FORMAT question

2006-07-05 Thread Mumia W.
Offer Kaye wrote: On 7/5/06, Jeff Peng wrote: Hello, I think there are not relation between your implement and the filehandle. As far as I can tell, a format must have the same name as the filehandle to which you want to print it, and once you define a format you cannot change it. So these 2

Re: FORMAT question

2006-07-05 Thread Mr. Shawn H. Corey
Offer Kaye wrote: Hi, Can anyone tell me if it is possible to define 2 different formats for the same filehandle? Yes. Use the select command to select the filehandle of the file. Then use the special variables $~ and $^ to change the format. The format name can be anything you want but if

FORMAT question

2006-07-04 Thread Offer Kaye
Hi, Can anyone tell me if it is possible to define 2 different formats for the same filehandle? The reason I am asking is that I want to print 2 different tables to the same text file and I don't want to use printf statements. For me at least, code that uses printf to print something as complex

RE: FORMAT question

2006-07-04 Thread Jeff Peng
The reason I am asking is that I want to print 2 different tables to the same text file and I don't want to use printf statements. For me at least, code that uses printf to print something as complex as a text table is hard to both write and read, hard to understand and hard to debug. It's also

Quick table format question

2004-09-14 Thread Sean Davis
All, Slightly off-topic, but I have a script that dynamically generates a table. Within this outer table, I have in each cell another table with 1 row, with each cell having a background color and containing only nbsp entity. I would like to make each of these inner cells a fixed width,

Re: Quick table format question

2004-09-14 Thread Gunnar Hjalmarsson
Sean Davis wrote: Slightly off-topic, but I have a script that dynamically generates a table. Within this outer table, I have in each cell another table with 1 row, with each cell having a background color and containing only nbsp entity. I would like to make each of these inner cells a

Re: Quick table format question

2004-09-14 Thread Chris Devers
On Tue, 14 Sep 2004, Gunnar Hjalmarsson wrote: The width attribute for cells is deprecated. Try setting table width for the inner tables instead. Or, better still, learn how to do layout with CSS and stop using tables for everything except (as originally intended) tabular data. On a modern

Re: Quick table format question

2004-09-14 Thread Sean Davis
Thanks Chris and Gunnar. Setting the inner table width worked, but I can see that using CSS would offer significant benefits and I will need to migrate that direction at some point. It seems like the table version seems to work on many browsers--is the [envisioned] CSS solution also

Re: Quick table format question

2004-09-14 Thread Chris Devers
On Tue, 14 Sep 2004, Sean Davis wrote: Thanks Chris and Gunnar. Setting the inner table width worked, but I can see that using CSS would offer significant benefits and I will need to migrate that direction at some point. It seems like the table version seems to work on many browsers--is

Re: Quick table format question

2004-09-14 Thread Gunnar Hjalmarsson
Sean Davis wrote: It seems like the table version seems to work on many browsers--is the [envisioned] CSS solution also generally compatible across browsers these days? It seems that browser layout engines are still suboptimal for some particulars of CSS. It depends on what you mean by these

Code Format Question

2002-01-25 Thread Darryl Schnell
This may not be the place to ask this question so forgive me. I know a few people who are obsessed with the way their perl code is formatted and I was wondering what does actual good readable perl code and bad formatted perl code look like? I usually have my code looking something like this:

Re: Code Format Question

2002-01-25 Thread Jon Molin
Darryl Schnell wrote: This may not be the place to ask this question so forgive me. I know a few people who are obsessed with the way their perl code is formatted and I was wondering what does actual good readable perl code and bad formatted perl code look like? I usually have my code

Re: Code Format Question

2002-01-25 Thread Jenda Krynicky
From: Darryl Schnell [EMAIL PROTECTED] This may not be the place to ask this question so forgive me. I know a few people who are obsessed with the way their perl code is formatted and I was wondering what does actual good readable perl code and bad formatted perl code look