Re: format output from system command

2011-04-16 Thread Peter Scott
On Fri, 15 Apr 2011 08:53:12 -0700, sono-io wrote: > On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: > >>> open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; >>> >>> Is that O.K.? >> >> You are still using a bareword filehandle. > > Putting single quotes around t

Re: format output from system command

2011-04-15 Thread Shawn H Corey
On 11-04-15 11:22 AM, sono...@fannullone.us wrote: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; Is that O.K.? The problem with not using lexical-scoped file handles is that if a module opens a file using the same name, it closes yours. It's best if you limit the

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: >> open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; >> >> Is that O.K.? > > You are still using a bareword filehandle. Putting single quotes around the filehandle allows it to pass Perl Critic, so I was just cu

Re: format output from system command

2011-04-15 Thread Alan Haggai Alavi
Hello Marc, What about writing it like this: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; Is that O.K.? You are still using a bareword filehandle. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-un

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 2:11 AM, Shlomi Fish wrote: > 1. Don't use bareword file-handles. > > 2. Use the three-args open: > > open (my $file_our, '>>', 'cmdout') or die "Cannot open cmdout: $!"; What about writing it like this: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \

Re: format output from system command

2011-04-15 Thread Shlomi Fish
Hi jet speed, On Friday 15 Apr 2011 00:23:17 jet speed wrote: > Hi, > > I need help in formatting ouput from system command, i could'nt figure out > a way to format output from system command. appreciate your help with > this, the details are below. > > hlis3 is

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and ou

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and ou

Re: Format Output

2007-09-18 Thread Chas Owens
On 9/18/07, VUNETdotUS <[EMAIL PROTECTED]> wrote: snip > I liked Text::Table idea but it is not supported on my machine. > Now I try printf but I came across a few problems. The sample above > produces a good result. However, when I implement according to my > needs, I cannot printf my multidimensi

Re: Format Output

2007-09-18 Thread VUNETdotUS
On Sep 17, 7:57 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 9/17/07, VUNETdotUS <[EMAIL PROTECTED]> wrote:> I print some output in > PERL. It is data in 3 columns. I use \t to add > > a tab space to make a column. > > However, \t may not produce the desired result. If the value is short > > in

Re: Format Output

2007-09-18 Thread Spiros Denaxas
On Sep 18, 12:57 am, [EMAIL PROTECTED] (Chas Owens) wrote: > On 9/17/07, VUNETdotUS <[EMAIL PROTECTED]> wrote:> I print some output in > PERL. It is data in 3 columns. I use \t to add > > a tab space to make a column. > > However, \t may not produce the desired result. If the value is short > > in

Re: Format Output

2007-09-17 Thread Chas Owens
On 9/17/07, VUNETdotUS <[EMAIL PROTECTED]> wrote: > I print some output in PERL. It is data in 3 columns. I use \t to add > a tab space to make a column. > However, \t may not produce the desired result. If the value is short > in length, next column is not aligned correctly in the row. Something >

RE: Format Output

2007-09-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: VUNETdotUS [mailto:[EMAIL PROTECTED] > Sent: Monday, September 17, 2007 12:36 > To: beginners@perl.org > Subject: Format Output > > I print some output in PERL. It is data in 3 columns. I use \t to add > a tab space to make a colum

Format Output

2007-09-17 Thread VUNETdotUS
I print some output in PERL. It is data in 3 columns. I use \t to add a tab space to make a column. However, \t may not produce the desired result. If the value is short in length, next column is not aligned correctly in the row. Something like this: 123 12345 123456 123 12345 1234

Re: format output from Data::Dumper

2006-05-16 Thread Mr. Shawn H. Corey
On Mon, 2006-15-05 at 17:46 -0700, chen li wrote: > Hi all, > > I get data from Data::Dumper in an array format. > I just wonder if there is a means to format the > content in alphabetic order, something like "sort keys > or sort values". Data::Dumper can output hashes sorted by keys: $Data::D

RE: format output from Data::Dumper

2006-05-16 Thread chen li
Hi all, I use the following script to find out the methods available from a class of Bio::Seq. #!c:/Perl/bin/Perl.exe use warnings; use strict; use Bio::Seq; use Data::Dumper; use Class::Inspector; my $methods=Class::Inspector->methods('Bio::Seq', 'full','public'); print Data::Dumper->Dump([$m

Re: format output from Data::Dumper

2006-05-16 Thread Dr.Ruud
Jeff Pang schreef: > print Dumper @sort; I always go for the whole thing: print Data:Dumper->Dump( [EMAIL PROTECTED], [qw(*sort)] ); perl -MData::Dumper -e ' @s = sort( 1, 7, 3, 2, 5 ) ; print Data::Dumper->Dump( [ [EMAIL PROTECTED] ], [ qw(*s) ] ) ' @s = ( 1, 2, 3,

RE: format output from Data::Dumper

2006-05-15 Thread Jeff Pang
>Jeff Pang wrote: > >: my @original=(...); >: my @sort=sort {$a cmp $b} @original; >: print Dumper @sort; > >You might like the results better using an array reference. > >print Dumper [EMAIL PROTECTED]; > Sorry,my mistake.It's right really to use an array reference here. -- Jeff Pang NetEas

RE: format output from Data::Dumper

2006-05-15 Thread Charles K. Clarkson
Jeff Pang wrote: : my @original=(...); : my @sort=sort {$a cmp $b} @original; : print Dumper @sort; You might like the results better using an array reference. print Dumper [EMAIL PROTECTED]; Or you could avoid the extra array with the anonymous array constructor (or is it an operator?

Re: format output from Data::Dumper

2006-05-15 Thread Jeff Pang
> >I get data from Data::Dumper in an array format. >I just wonder if there is a means to format the >content in alphabetic order, something like "sort keys >or sort values". I would give you a simple way,you can sort the array and put the results into another array,then print this array to Dump

format output from Data::Dumper

2006-05-15 Thread chen li
Hi all, I get data from Data::Dumper in an array format. I just wonder if there is a means to format the content in alphabetic order, something like "sort keys or sort values". Thanks, Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

Re: report format/output question

2001-05-31 Thread Brian Warn
Uh, never mind. I expected the output to display to STDOUT. When I opened the 'rpt' file, voila! there sat my report. - Original Message - From: "Brian Warn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 31, 2001 3:50 PM Subject: repor

report format/output question

2001-05-31 Thread Brian Warn
Hello, I'm trying to do something fairly simple: read in colon-delimited data from a file and output it to the screen first. After that is OK, I want to send it in an email. The syntax checks out OK, but nothing outputs. Does anyone see what I'm missing? Thanks, Brian -