Re: printf

2013-03-04 Thread Nathan Hilterbrand
On 03/04/2013 11:22 AM, Chris Stinemetz wrote: I would like to pass a list of variables to printf. Is there a way to multiply a set printf length instead of righting typing printf for each variable? what I am trying to do is below: printf "%-${longest}s x 27\n", $rp

Re: printf

2013-03-04 Thread Dr.Ruud
On 2013-03-04 20:27, Dr.Ruud wrote: print sprintf +("| %-${wid}s" x @data)." |\n", @data; Rather: print sprintf +("| %-${wid}s " x @data) . "|\n", @data; -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://l

Re: printf

2013-03-04 Thread Dr.Ruud
On 2013-03-04 17:22, Chris Stinemetz wrote: I would like to pass a list of variables to printf. Is there a way to multiply a set printf length instead of righting typing printf for each variable? what I am trying to do is below: printf "%-${longest}s x 27\n", $rp

printf

2013-03-04 Thread Chris Stinemetz
I would like to pass a list of variables to printf. Is there a way to multiply a set printf length instead of righting typing printf for each variable? what I am trying to do is below: printf "%-${longest}s x 27\n", $rptType,$mkt,$timeStamp,$cell,$sector,$carr,$satt,

Re: printf

2012-09-02 Thread Torsten
Am Sun, 02 Sep 2012 13:12:02 +0200 schrieb "Dr.Ruud" : > On 2012-08-31 15:17, Torsten wrote: > > > I found a strange behaviour for printf: If you do for example > > > > printf "%d",29/100*100 > > > > you get 28. But with > > >

Re: printf

2012-09-02 Thread Dr.Ruud
On 2012-08-31 15:17, Torsten wrote: I found a strange behaviour for printf: If you do for example printf "%d",29/100*100 you get 28. But with printf "%d",29*100/100 it's 29. Seems to be related to rounding. The perl version is 5.10.1 on debian. There is nothing s

Re: printf

2012-08-31 Thread Shawn H Corey
On Fri, 31 Aug 2012 15:28:38 +0300 "Octavian Rasnita" wrote: > From: "Torsten" > > > Hey, > > > > I found a strange behaviour for printf: If you do for example > > > > printf "%d",29/100*100 > > > > you get 28.

Re: printf

2012-08-31 Thread Octavian Rasnita
From: "Torsten" > Hey, > > I found a strange behaviour for printf: If you do for example > > printf "%d",29/100*100 > > you get 28. But with > > printf "%d",29*100/100 > > it's 29. Seems to be related to rounding.

printf

2012-08-31 Thread Torsten
Hey, I found a strange behaviour for printf: If you do for example printf "%d",29/100*100 you get 28. But with printf "%d",29*100/100 it's 29. Seems to be related to rounding. The perl version is 5.10.1 on debian. Regards -- To unsubscribe, e-mail: beginners

Re: printf explicitly

2011-03-19 Thread Uri Guttman
e whole thread. >> next unless $line =~ /;/; PJ> Your data is separated by commas, not semicolons. again, follow the whole thread. yes, he put his output at the top. >> $record{dist} = ( length( $record{dist}) > 1 ) ? $record{dist}/6.6/8/2*10/10 : '' ; P

Re: printf explicitly

2011-03-19 Thread Paul Johnson
On Fri, Mar 18, 2011 at 10:43:09PM -0600, Chris Stinemetz wrote: > Hello, > > I would like to explicitly use printf '<%.2g>' for the element in the array > called dist. > Below is the error I am getting and below that is a sample of the output I > can curr

Re: printf explicitly

2011-03-18 Thread Uri Guttman
>>>>> "CS" == Chris Stinemetz writes: CS> I would like to explicitly use printf '<%.2g>' for the element in CS> the array called dist. Below is the error I am getting and below CS> that is a sample of the output I can currently generate

printf explicitly

2011-03-18 Thread Chris Stinemetz
Hello, I would like to explicitly use printf '<%.2g>' for the element in the array called dist. Below is the error I am getting and below that is a sample of the output I can currently generate before I add printf. Thank you Argument "2,1,1,1175,2.58522727272727,1\n&quo

Re: printf

2010-07-12 Thread John W. Krahn
Chas. Owens wrote: On Mon, Jul 12, 2010 at 07:25, Rob Coops wrote: snip In other words you are using a function inside a function. If you split this into two lines. my @split_result = split /:/; print $outfile join(" ", "socks5", @split_result) snip By that logic it should read my @split_res

Re: printf

2010-07-12 Thread Chas. Owens
On Mon, Jul 12, 2010 at 07:25, Rob Coops wrote: snip > In other words you are using a function inside a function. If you split this > into two lines. > my @split_result = split /:/; > print $outfile join(" ", "socks5", @split_result) snip By that logic it should read my @split_result = split /:/

Re: printf

2010-07-12 Thread Rob Coops
On Mon, Jul 12, 2010 at 12:54 PM, Shlomi Fish wrote: > On Monday 12 Jul 2010 11:07:49 newsense wrote: > > This is what i currently have but am not sure how i can use printf > > here instead of print so i can get some nice columns. > > > > #!/usr/bin/perl >

Re: printf

2010-07-12 Thread Shlomi Fish
On Monday 12 Jul 2010 11:07:49 newsense wrote: > This is what i currently have but am not sure how i can use printf > here instead of print so i can get some nice columns. > > #!/usr/bin/perl > use warnings; > use strict; > > open my $list, "<", "pr

printf

2010-07-12 Thread newsense
This is what i currently have but am not sure how i can use printf here instead of print so i can get some nice columns. #!/usr/bin/perl use warnings; use strict; open my $list, "<", "proxylist.txt" or die $!; open my $outfile, ">", "test.txt" or d

Re: printf

2009-11-03 Thread C.DeRykus
On Oct 27, 1:52 pm, aim...@sfbrgenetics.org (Aimee Cardenas) wrote: > Hi, All! > > I need to fix the width of some strings padding with leading spaces if   > necessary.  I wanted to use printf but I don't know if you can put a   > variable in the format part the the printf sta

RE: printf

2009-10-28 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Aimee Cardenas [mailto:aim...@sfbrgenetics.org] > Sent: Tuesday, October 27, 2009 15:53 > To: Perl Beginners > Subject: printf > > Hi, All! > > I need to fix the width of some strings padding with leading > spaces if > n

Re: printf

2009-10-27 Thread Uri Guttman
essions. they may be converted to something else (coercion) but you still can pass anything to about any function. the first arg to sprintf (and same for printf) is just a perl scalar value which will be used as a string format. you can put a function there that returns a string and it will work fine. y

Re: printf

2009-10-27 Thread Aimee Cardenas
Awesome! Thanks, David! :-D Aimee Cardenas On Oct 27, 2009, at 4:56 PM, Wagner, David --- Senior Programmer Analyst --- CFS wrote: -Original Message- From: Aimee Cardenas [mailto:aim...@sfbrgenetics.org] Sent: Tuesday, October 27, 2009 15:53 To: Perl Beginners Subject: printf

printf

2009-10-27 Thread Aimee Cardenas
Hi, All! I need to fix the width of some strings padding with leading spaces if necessary. I wanted to use printf but I don't know if you can put a variable in the format part the the printf statement. For example, if I wanted to use the following format type: printf OFILE &

Re: printf with currency symbols

2009-10-26 Thread Bryan R Harris
> Robert Citek wrote: >> Not sure if there is a better way. My guess is that there is probably >> some module to convert float to currency and then print it as a >> string. But a quick Google didn't turn up anything. > > Here' why (extracted from `perldoc perllocale`): > >Category LC_MONET

Re: printf with currency symbols

2009-10-26 Thread Shawn H Corey
Robert Citek wrote: > Not sure if there is a better way. My guess is that there is probably > some module to convert float to currency and then print it as a > string. But a quick Google didn't turn up anything. Here' why (extracted from `perldoc perllocale`): Category LC_MONETARY: Formattin

Re: printf with currency symbols

2009-10-26 Thread Robert Citek
I see. You want the output to look something like this: $ perl -e 'for(my $total = 24.15; $total <3; $total *= 10) { printf("Total:%10s\n", "\$" . sprintf("%.2f",$total)) ;} ' Total:$24.15 Total: $241.50 Total: $2415.00 Total: $24150.00 Not

Re: printf with currency symbols

2009-10-26 Thread Robert Citek
Is this what you are looking for: $ perl -e '$total = 24.15 ; printf "Total: \$%.2f\n", $total; ' Regards, - Robert On Mon, Oct 26, 2009 at 11:57 AM, Bryan R Harris wrote: > Is there a good way to do printf's with currency symbols? > > I've tried this:

Re: printf with currency symbols

2009-10-26 Thread Jim Gibson
On 10/26/09 Mon Oct 26, 2009 8:57 AM, "Bryan R Harris" scribbled: > > > Is there a good way to do printf's with currency symbols? > > I've tried this: > > printf "Total: \$%10.2f\n", $total; > > But it puts the dollar sign wa

printf with currency symbols

2009-10-26 Thread Bryan R Harris
Is there a good way to do printf's with currency symbols? I've tried this: printf "Total: \$%10.2f\n", $total; But it puts the dollar sign way out front (ugly). I want it to look like: Total:$24.15 Is there a way to do this without getting all messy like this?

AW: Building a fmt line for printf with a carriage return

2009-10-26 Thread Thomas Bätzler
Hi, Wagner, David --- Senior Programmer Analyst --- CFS wrote: > Here is the sample script I was playing with: > #!/usr/bin/perl > > use strict; > use warnings; > > my $MyLine1 = q[%2d %5s %6s]; > my $MyLine2 = q[%2d %5s \n%6s]; The q// operator is equivalent to single quotes, so esc

Re: printf and zero padding

2009-10-24 Thread Harry Putnam
Jim Gibson writes: > At 4:02 PM -0500 10/24/09, Harry Putnam wrote: >>With this little script, how would I manage to get the shorter >>timestamps zero padded using printf? I now how to get padded numbers >>but not when I'm pushing off the right margin too. >>

Re: printf and zero padding

2009-10-24 Thread Jim Gibson
At 4:02 PM -0500 10/24/09, Harry Putnam wrote: With this little script, how would I manage to get the shorter timestamps zero padded using printf? I now how to get padded numbers but not when I'm pushing off the right margin too. cat script.pl #!/usr/local/bin/perl use strict;

printf and zero padding

2009-10-24 Thread Harry Putnam
With this little script, how would I manage to get the shorter timestamps zero padded using printf? I now how to get padded numbers but not when I'm pushing off the right margin too. cat script.pl #!/usr/local/bin/perl use strict; use warnings; while (my $file = shift @ARGV){

Re: Building a fmt line for printf with a carriage return

2009-10-23 Thread Shawn H Corey
Wagner, David --- Senior Programmer Analyst --- CFS wrote: > I thought I had done this before, but I guess not. I build a formt line > for printf like: > q[%-3s%-4s%5s%6s]; > But I want to insert a carriage return after say %-4s( I have a nubmer >

Building a fmt line for printf with a carriage return

2009-10-23 Thread Wagner, David --- Senior Programmer Analyst --- CFS
I thought I had done this before, but I guess not. I build a formt line for printf like: q[%-3s%-4s%5s%6s]; But I want to insert a carriage return after say %-4s( I have a nubmer of fields and depending on the size, it is not a constant after column 2, but could

Re: How does printf able to receive a pointer when passing it a string constant?

2009-05-13 Thread Jim Gibson
On 5/13/09 Wed May 13, 2009 4:48 AM, "Michael Alipio" scribbled: > I have a c code that looks like this: > > #include > > main (){ > char girl[] = "anna"; > char boy[] = "jude"; > stringcopy(boy, girl); /* copy boy to girl */ > printf(

Re: How does printf able to receive a pointer when passing it a string constant?

2009-05-13 Thread Chas. Owens
uments with "jude", "anna" > it compiles fine but i get segmentation fault when running. snip Because they are string constants and you are trying to modify the second string. You aren't allowed to do that. snip > How come printf can accept variable names as well as

How does printf able to receive a pointer when passing it a string constant?

2009-05-13 Thread Michael Alipio
I have a c code that looks like this: #include main (){ char girl[] = "anna"; char boy[] = "jude"; stringcopy(boy, girl); /* copy boy to girl */ printf("%s", girl); } void stringcopy(char *b, char *g){ while ((*g++ = *b++) != '\0') ; } It

Re: how to print % when using printf

2009-02-07 Thread Dr.Ruud
itshardtogetone wrote: > How do I print the % sign when using printf. RTFM. See for example: perldoc -f printf, which should point you to the sprintf doc. It is even the first mentioned conversion there. The doc is on a thingy called "the web" too: http://perldoc.perl.org/functions

Re: how to print % when using printf

2009-02-06 Thread Jeff Peng
2009/2/7 itshardtogetone : > Hi, > How do I print the % sign when using printf. use another % to escape it. -- Jeff Peng Office: +86-20-38350822 AIM: jeffpang www.dtonenetworks.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: begin

how to print % when using printf

2009-02-06 Thread itshardtogetone
Hi, How do I print the % sign when using printf. I did the following which produced the following error "illegal conversion in printf "%)" at line 185" printf ("Total $total_number_of_bets\(%4.2f\%\) times.\n",$percentage_total_number_of_bets); Thanks

Re: using (dot) . with printf does not incur the results I expected

2008-12-24 Thread John W. Krahn
#x27;han1'; my %never = qw(hi how are you today fine i am good and everyday12345678 never12345689); printf "%-.5s %-15s %-.2s\n", $yabal, $never, $noway; for (keys %never) { printf "%.2s %.10s\n", $_, $never{$_}; It looks like you want this instead:

Re: using (dot) . with printf does not incur the results I expected

2008-12-24 Thread Richard
#x27;han1'; my %never = qw(hi how are you today fine i am good and everyday12345678 never12345689); printf "%-.5s %-15s %-.2s\n", $yabal, $never, $noway; for (keys %never) { printf "%.2s %.10s\n", $_, $never{$_}; } r...@myserver ~> ././yahoo2 trunc sai

using (dot) . with printf does not incur the results I expected

2008-12-24 Thread Richard
27;; my %never = qw(hi how are you today fine i am good and everyday12345678 never12345689); printf "%-.5s %-15s %-.2s\n", $yabal, $never, $noway; for (keys %never) { printf "%.2s %.10s\n", $_, $never{$_}; } r...@myserver ~> ././yahoo2 trunc sai

Re: uninitialized value in printf

2008-02-02 Thread obdulio santana
Thaks listers, your comments helped a lot. everything was fixed. regards

Re: uninitialized value in printf

2008-02-02 Thread asmith
= sprintf "vcl%02d%02d%4d.txt",$day,$month,$year; >> open FILEOUT, ">$file"; > > You should *always* verify that the file opened correctly: > > open FILEOUT, '>', $file or die "Cannot open '$file' $!"; > > >> pr

Re: uninitialized value in printf

2008-02-01 Thread John W. Krahn
LEOUT, '>', $file or die "Cannot open '$file' $!"; print FILEOUT "Resumen decadal \n" ; printf FILEOUT "$meses[$month-1]/$year;#%d \n",$dec ; $form = "%13s" x @files ; printf FILEOUT "%23s" . "$form\n",sort keys %textos

Re: uninitialized value in printf

2008-02-01 Thread Gunnar Hjalmarsson
%02d%4d.txt",$day,$month,$year; open FILEOUT, ">$file"; print FILEOUT "Resumen decadal \n" ; printf FILEOUT "$meses[$month-1]/$year;#%d \n",$dec ; $form = "%13s" x @files ; printf FILEOUT "%23s" . "$form\n",sort keys %textos ;

uninitialized value in printf

2008-02-01 Thread obdulio santana
,$day,$month,$year; open FILEOUT, ">$file"; print FILEOUT "Resumen decadal \n" ; printf FILEOUT "$meses[$month-1]/$year;#%d \n",$dec ; $form = "%13s" x @files ; printf FILEOUT "%23s" . "$form\n",sort keys %textos ; for $line (5..50){

Re: printf problem

2007-10-30 Thread Paul Lalli
l\n\n"; > $b1=11; > $b2=2; > $b3=5; > $b4=1; > $b5=12; > $bcol=printf("%02d %02d %02d %02d %02d", $b1, $b2, $b3, $b4, $b5); > > #chop($bcol); > print qq($bcol); > > Can anyone help? printf() prints the string to the screen, and returns a true value (1)

RE: printf problem

2007-10-30 Thread Andrew Curry
try using sprintf instead of printf. i think the extra 1 you are getting on the end it just a true return. -Original Message- From: Julie A. Bolduc [mailto:[EMAIL PROTECTED] Sent: 30 October 2007 00:23 To: beginners@perl.org Subject: printf problem I am trying to format some numbers so

printf problem

2007-10-30 Thread Julie A. Bolduc
add chop($bcol); to the code, it cuts the last digit off but what if I do not need to have that happen? I am not exactly new to perl but this has me stumped. print "Content-type: text/html\n\n"; $b1=11; $b2=2; $b3=5; $b4=1; $b5=12; $bcol=printf("%02d %02d %02d %02d %02d"

Re: printf

2007-01-18 Thread Dermot Paikkos
On 18 Jan 2007 at 16:25, Eugene Kosov wrote: > Beginner wrote: > > Hi all, > > > > Sorry I am sure this is a lame question. > > > > I want to print out some column (with heading) and I want them > > evenly spaced. I know this is a printf but the format

Re: printf

2007-01-18 Thread Beginner
On 18 Jan 2007 at 7:19, Hal Wigoda wrote: > for one thing, you need to add "\n" for newline. > > printf("%c12", $var); # prints $var12$var12 > > > > %s seems to give me no output at all. > > I wouldn't want a newline in the middle of my

Re: printf

2007-01-18 Thread Eugene Kosov
Beginner wrote: Hi all, Sorry I am sure this is a lame question. I want to print out some column (with heading) and I want them evenly spaced. I know this is a printf but the format eludes me. printf("%c12", $var); # prints $var12$var12 Try %12c (or %12s) instead of %c12 abov

Re: printf

2007-01-18 Thread Hal Wigoda
for one thing, you need to add "\n" for newline. On Jan 18, 2007, at 7:12 AM, Beginner wrote: Hi all, Sorry I am sure this is a lame question. I want to print out some column (with heading) and I want them evenly spaced. I know this is a printf but the format eludes me. printf(&q

printf

2007-01-18 Thread Beginner
Hi all, Sorry I am sure this is a lame question. I want to print out some column (with heading) and I want them evenly spaced. I know this is a printf but the format eludes me. printf("%c12", $var); # prints $var12$var12 %s seems to give me no output at all. Any ideas? TIA, Dp

Re: sprintf and printf in Perl

2006-09-14 Thread jeffhua
Hello, The simple difference is,'sprintf' format the strings and pass the result to a variable. $ perl -e 'my $var=sprintf "%30s\n","hello,world";print $var' hello,world While 'printf' print the result directly to

sprintf and printf in Perl

2006-09-14 Thread chen li
Hi all, First of all I want to thank you all for reading and replying my previous posts. Now I come across to another problem: I want to print out a AoA. If I use printf I get what I expect. If I use sprintf for string I get error messages but the remaining still look OK. But If use sprintf

Re: hex conversion to dec - print and printf differences

2006-04-11 Thread Offer Kaye
On 4/11/06, John W. Krahn wrote: > > This is probably trivial, but I couldn't find a mention of this > > anywhere - why do the following 2 code lines produce different > > results? > >>perl -e 'printf "%d\n" ,0x_' > > -1 > &g

Re: hex conversion to dec - print and printf differences

2006-04-11 Thread John W. Krahn
Offer Kaye wrote: > On 4/11/06, John W. Krahn wrote: >>>This is probably trivial, but I couldn't find a mention of this >>>anywhere - why do the following 2 code lines produce different >>>results? >>>>perl -e 'printf "%d\n" ,0x_ff

Re: hex conversion to dec - print and printf differences

2006-04-11 Thread John W. Krahn
Offer Kaye wrote: > Hi, Hello, > This is probably trivial, but I couldn't find a mention of this > anywhere - why do the following 2 code lines produce different > results? >>perl -e 'printf "%d\n" ,0x_' > -1 >>perl -e 'print 0x

hex conversion to dec - print and printf differences

2006-04-11 Thread Offer Kaye
Hi, This is probably trivial, but I couldn't find a mention of this anywhere - why do the following 2 code lines produce different results? > perl -e 'printf "%d\n" ,0x_' -1 > perl -e 'print 0x_ , "\n"' 4294967295 Even stranger:

RE: Replacing printf by print

2005-07-22 Thread pradeep.goel
Thanks a million. Best Regards, Pradeep -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Friday, July 22, 2005 6:00 PM To: Pradeep Goel (WT01 - TELECOM SOLUTIONS) Cc: beginners@perl.org Subject: RE: Replacing printf by print On Jul 22, [EMAIL PROTE

Re: [SPAM DETECT] Re: Replcaing printf by print

2005-07-22 Thread Xavier Noria
On Jul 22, 2005, at 14:00, Jeff 'japhy' Pinyan wrote: On Jul 22, [EMAIL PROTECTED] said: Does replacing printf by print make any difference in the program? Especially at places where there is no format string passed or just $_ is passed? It probably doesn't have a notice

RE: Replacing printf by print

2005-07-22 Thread Jeff 'japhy' Pinyan
, but if you were to change them, for some reason, print()s output would be affected (but printf()s would not). print "a", "b", "c"; # abc $, = "!"; print "a", "b", "c"; # a!b!c $\ = "?"; print "

RE: Replacing printf by print

2005-07-22 Thread pradeep.goel
ugh I don't think it should). Thanks and regards, Pradeep -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Friday, July 22, 2005 5:31 PM To: Pradeep Goel (WT01 - TELECOM SOLUTIONS) Cc: beginners@perl.org Subject: Re: Replcaing printf by print On Jul

Re: Replcaing printf by print

2005-07-22 Thread Jeff 'japhy' Pinyan
On Jul 22, [EMAIL PROTECTED] said: Does replacing printf by print make any difference in the program? Especially at places where there is no format string passed or just $_ is passed? It probably doesn't have a noticeable difference unless you compare the running of it many, MANY times.

Replcaing printf by print

2005-07-22 Thread pradeep.goel
Hi, Does replacing printf by print make any difference in the program? Especially at places where there is no format string passed or just $_ is passed? Regards, Pradeep Confidentiality Notice The information contained in this electronic message and any attachments to this message are

Re: assigning printf statement to an array

2005-06-07 Thread DBSMITH
die "unable to open directory: $hdir $!"; my ($d, $m, $y) = (localtime($now - (map {$_->[0]} * ONE_DAY))) [3..5]; printf ("%02d/%02d/%04d", $m+1,$d,($y % 100)); grep {$_->[0] > 100} map

Re: assigning printf statement to an array

2005-05-26 Thread DBSMITH
Re: assigning printf statement to an array

Re: assigning printf statement to an array

2005-05-25 Thread Jeff 'japhy' Pinyan
On May 25, John Doe said: Am Mittwoch, 25. Mai 2005 04.10 schrieb Jeff 'japhy' Pinyan: Jeff, thanks a lot for taking over. My explanation would not have been so understandable and with this fullness. Glad to be of service. -- Jeff "japhy" Pinyan % How can we ever be the sold short o

Re: assigning printf statement to an array

2005-05-25 Thread John Doe
Am Mittwoch, 25. Mai 2005 04.10 schrieb Jeff 'japhy' Pinyan: [...] Jeff, thanks a lot for taking over. My explanation would not have been so understandable and with this fullness. joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: assigning printf statement to an array

2005-05-24 Thread Jeff 'japhy' Pinyan
On May 24, [EMAIL PROTECTED] said: 1> print 2> map {$_->[1].": ".$_->[0]."\n"} # create entity output 3> grep {$_->[0] > 100} # exclude age <= 100 4> map { [ 5> sprintf ("%.0f",( $now - ( stat("${hdir}$_" ) )[9] ) / ONE_DAY ), 6> $_ 7> ] } # create aref [age, filename] 8> grep {$_ ne "." and $

Re: assigning printf statement to an array

2005-05-24 Thread DBSMITH
To beginners@perl.org 05/24/2005 03:27 cc PM

Re: assigning printf statement to an array

2005-05-24 Thread John Doe
> sub date_manip1 > > { > > my $days = (shift); > > my ($d, $m, $y) = (localtime($now - $days * ONE_DAY)) > > [3..5]; > > sprintf ("%02d/%02d/%02d", $m+1,$d,($y % 100)); > >

Fw: assigning printf statement to an array

2005-05-24 Thread DBSMITH
cc beginners@perl.org Subject Re: assigning printf statement to an array(Document link:

Re: assigning printf statement to an array

2005-05-24 Thread DBSMITH
beginners@perl.org 05/24/2005 01:34 cc AM Subject Re: assignin

Re: assigning printf statement to an array

2005-05-23 Thread John Doe
#my $dmm = &date_manip1(1); > #chomp $dm; > #chomp $dmm; > > > > opendir (DH, $hdir) or die "unable to open directory: $hdir $!"; > > my @a =(); > my $e =0; > foreach my $file (sort re

Re: assigning printf statement to an array

2005-05-23 Thread DBSMITH
r $file eq ".."; print "\n"; print "Days old of HL image files are:\t",$file,":\t"; #printf ("%.0f", ( $now - ( stat( "${hdir}${file}" ) )[9] ) / ONE_DAY ); $a[$e++] = sprintf (&q

Re: assigning printf statement to an array

2005-05-21 Thread Offer Kaye
On 5/21/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Here is my code, but I am not seeing the elements being populated as I say > show me the data in element 1 > Line 28 is not working after executing line 30. > Any ideas? > You probably want to use "sprintf&

Re: using printf on specified fields of record

2004-11-17 Thread Joseph Paish
> 0.0729631667146973 << change to 4 decimal places displayed > > -173.655333717579 << change to 2 decimal places displayed > > sample_note_here > > > > > > the first 9 fields and the last field are output just the way i want > > them using a simple &q

RE: using printf on specified fields of record

2004-11-17 Thread Bob Showalter
e_note_here > > > the first 9 fields and the last field are output just the way i want > them using a simple "print" statement, but the 4 long ones near the > end are not. > > is there some way of using printf formatting on only certain fields > to modify the way

using printf on specified fields of record

2004-11-17 Thread Joseph Paish
e "print" statement, but the 4 long ones near the end are not. is there some way of using printf formatting on only certain fields to modify the way that they are displayed and leave the others alone, since the way they are displayed is ok already? thanks joe -- To unsubscr

Re: problem printf

2004-10-26 Thread deny
Jenda P.S.: What the heck is find.pl? You should be using File::Find! thanks for your help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problem printf

2004-10-26 Thread Flemming Greve Skovengaard
deny wrote: Try to add this lines somewhere the top of the file: use strict; use warnings; and report the errors, if any. Global symbol "$md5" requires explicit package name at ./checksum.pl line 11. Global symbol "@dirs" requires explicit package name at ./checksum.pl line 12. Global symbol "$d

Re: problem printf

2004-10-25 Thread deny
Try to add this lines somewhere the top of the file: use strict; use warnings; and report the errors, if any. Global symbol "$md5" requires explicit package name at ./checksum.pl line 11. Global symbol "@dirs" requires explicit package name at ./checksum.pl line 12. Global symbol "$dir" requires

Re: problem printf

2004-10-25 Thread deny
Owen a écrit : On Mon, 25 Oct 2004 05:17 pm, deny wrote: foreach $name ( sort @files) { ($uid,$gid) = (stat $nane)[4,5]; stat $nane or $name? $name , error for me ,the result is the same if someone want the script for test -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: problem printf

2004-10-25 Thread John W. Krahn
deny wrote: That isn't only perl code, it's incomplete, and it doesn't use 'printf'. Show us more code and explain your problem fully. thanks for your help here is the complete code #!/usr/bin/perl use warnings; use strict; use MD5; use Digest::MD5; require '

Re: problem printf

2004-10-25 Thread Jenda Krynicky
; foreach $name ( sort @files) { > ($uid,$gid) = (stat $nane)[4,5]; > $stat = sprintf "%0o", (stat_)[2]; > unless( -f $name ) { > printf "$stat\t$uid $gid\t\t\t\t\t\t$name\n"; You should either be using print(): print "$stat\t$uid $gid\

Re: problem printf

2004-10-25 Thread Flemming Greve Skovengaard
deny wrote: That isn't only perl code, it's incomplete, and it doesn't use 'printf'. Show us more code and explain your problem fully. thanks for your help here is the complete code #!/usr/bin/perl use MD5; require 'find.pl'; $md5 = new MD5; @dirs = @

Re: problem printf

2004-10-25 Thread Owen
On Mon, 25 Oct 2004 05:17 pm, deny wrote: > foreach $name ( sort @files) { >     ($uid,$gid) = (stat $nane)[4,5]; stat $nane or $name? Owen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problem printf

2004-10-25 Thread deny
That isn't only perl code, it's incomplete, and it doesn't use 'printf'. Show us more code and explain your problem fully. thanks for your help here is the complete code #!/usr/bin/perl use MD5; require 'find.pl'; $md5 = new MD5; @dirs = @ARGV;

RE: problem printf

2004-10-24 Thread Charles K. Clarkson
printf "%Oo", : (stat_)[2];// That isn't only perl code, it's incomplete, and it doesn't use 'printf'. Show us more code and explain your problem fully. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To u

problem printf

2004-10-24 Thread deny
hello i ve found a perl script to calculate the sum of the permissions my principal files the line which is writing in my file is foreach $name ( sort @files) { ($uid,$gid) = (stat $nane)[4,5]; ici la ligne $stat = sprintf "%Oo", (stat_)[2];// and whe

Re: variable FORMAT in printf?

2004-01-19 Thread Bryan Harris
line up). I search through >> the columns finding the longest field with and highest precision level for >> each column, then create a format string for the printf command. The guts >> of it looks like this: >> >> ** >>

Re: variable FORMAT in printf?

2004-01-19 Thread John W. Krahn
lumns so the decimals line up). I search through > the columns finding the longest field with and highest precision level for > each column, then create a format string for the printf command. The guts > of it looks like this: > > ** > $forma

Re: variable FORMAT in printf?

2004-01-19 Thread Tassilo von Parseval
ace-pad the columns so the decimals line up). I search through > the columns finding the longest field with and highest precision level for > each column, then create a format string for the printf command. The guts > of it looks like this: > > >

variable FORMAT in printf?

2004-01-19 Thread Bryan Harris
ng the longest field with and highest precision level for each column, then create a format string for the printf command. The guts of it looks like this: ** $formatstr = ""; $index = 0; foreach (@lwid) { $formatstr .= "%$lwid[$index].$lprec[$

Re: printf sprintf

2004-01-09 Thread david
R. Joseph Newton wrote: > All the use one could imagine. The printf function can print pretty much > anywhere. I believe that it preceded sprintf historically, but I wouldn't > swear > > Many C coders have told me that it is the most efficient way to > write files.

  1   2   >