RE: Emptying several arrays at once

2007-08-14 Thread Jeff Pang
-Original Message- >From: Andrew Curry <[EMAIL PROTECTED]> >Sent: Aug 15, 2007 4:59 AM >To: DJ Gruby <[EMAIL PROTECTED]>, Perl Beginners Mailing List > >Subject: RE: Emptying several arrays at once > >Whilst you can do by turning off strict and using an array of arraynames and >looping o

Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Chris Charley
- Original Message - From: ""Wagner, David --- Senior Programmer Analyst --- WGO"" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Tuesday, August 14, 2007 1:06 PM Subject: Ability to do numeric and alpha sort in one pass on data which is compirsed of both I am attempting

Re: piping and reading stdin

2007-08-14 Thread Jeff Pang
-Original Message- >From: Chas Owens <[EMAIL PROTECTED]> >but you can sleep for less than a second >with usleep from the Time::HiRes* module if this is too slow for your >purposes. > Or use four arguments version of select,see perldoc -f select. -- Jeff Pang <[EMAIL PROTECTED]> http://h

Re: piping and reading stdin

2007-08-14 Thread Chas Owens
On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip > Its not really making sense to me why you are adding sleep to this. > Cant I do this as fast as possible? snip I added sleep for two reasons, to show that it worked and to prevent it from hogging the CPU. With non-blocking IO you pro

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Chas Owens wrote: > > On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: > >> Hello there! > >> > >> Have question if that is possible to empty a few arrays with one simple > >> command? > >> > >> For the moment I clear these six tables by a

Re: slices

2007-08-14 Thread Chas Owens
On 8/14/07, Jay Savage <[EMAIL PROTECTED]> wrote: snip > No. a single scalar subscript is, well, a scalar, not a single-element > list. And it refers to an index, not a slice. The definition of a > slice is more than one. from perldata: > > "A slice accesses several elements of a list, an array, or

Re: Is it wrong...croak vs die...carp vs warn

2007-08-14 Thread oryann9
--- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 13, 9:33 pm, [EMAIL PROTECTED] (Oryann9) > wrote: > > > From the Perl Review and my understanding as well, > use > > Carp with keywords carp and croak is supposed to > > provide additional detail in your errors and > warnings. > > Perl

Re: Emptying several arrays at once

2007-08-14 Thread Mr. Shawn H. Corey
Chas Owens wrote: On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: Hello there! Have question if that is possible to empty a few arrays with one simple command? For the moment I clear these six tables by assigning them an empty list: @bitmap_addr_lo = (); @bitmap_addr_hi = (); @screen

Re: How to convert csv file to excel

2007-08-14 Thread Lawrence Statton
> > Can anybody help me how to convert csv file to excel file using Perl > or Shell scripts? > I would use Text::CSV_XS to read the CSV file and SpreadSheet::WriteExcel to produce the Excel file. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: piping and reading stdin

2007-08-14 Thread horizxon
On Aug 13, 10:47 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 8/13/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > > > -Original Message- > > >From: [EMAIL PROTECTED] > > >Sent: Aug 14, 2007 3:20 AM > > >To: [EMAIL PROTECTED] > > >Subject: piping and reading stdin > > > >I want to read fro

Re: Is it wrong...croak vs die...carp vs warn

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 13, 9:33 pm, [EMAIL PROTECTED] (Oryann9) wrote: > From the Perl Review and my understanding as well, use > Carp with keywords carp and croak is supposed to > provide additional detail in your errors and warnings. Perl Review eh? That's foy isn't it? I'm just reviewing his book "Mastering P

How to convert csv file to excel

2007-08-14 Thread Kyaw San
Hi Friends, Can anybody help me how to convert csv file to excel file using Perl or Shell scripts? Regards, KS -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > for my $type (keys %addr) { > @$_ for keys %$type; > } snip Whoops, typo there, this should be for my $type (keys %addr) { @$_ = () for keys %$type; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: Emptying several arrays at once

2007-08-14 Thread Chas Owens
On 8/14/07, DJ Gruby <[EMAIL PROTECTED]> wrote: > Hello there! > > Have question if that is possible to empty a few arrays with one simple > command? > > For the moment I clear these six tables by assigning them an empty list: > >@bitmap_addr_lo = (); >@bitmap_addr_hi = (); >@screen_ad

Re: Emptying several arrays at once

2007-08-14 Thread DJ Gruby
Hello! And thanks for your answer... Andrew Curry wrote: Whilst you can do by turning off strict and using an array of arraynames and looping over them, its clear concise the way you are doing it. Well, I wouldn't rather go for turning off strict. I'm too much used to be strict with my progr

RE: Emptying several arrays at once

2007-08-14 Thread Andrew Curry
Whilst you can do by turning off strict and using an array of arraynames and looping over them, its clear concise the way you are doing it. I think you could do something like @arrays=('test1','test2','test3'); foreach my $array(@arrays) { @{$array}=(); } But not tested. -Original Messa

Emptying several arrays at once

2007-08-14 Thread DJ Gruby
Hello there! Have question if that is possible to empty a few arrays with one simple command? For the moment I clear these six tables by assigning them an empty list: @bitmap_addr_lo = (); @bitmap_addr_hi = (); @screen_addr_lo = (); @screen_addr_hi = (); @colors_addr_lo = (); @color

Re: Recognizing integer as string for if statement

2007-08-14 Thread John W. Krahn
Jesse Farrell wrote: Is there a way to have a variable recognized as a string even if it contains a valid integer? I have a script that is taking strings from a file that can be numbers, including zero. I have an if statement to simply see if the variable exists (otherwise I need to throw an er

RE: Recognizing integer as string for if statement

2007-08-14 Thread Jesse Farrell
Actually, "defined" is all I needed. I don't know why I couldn't find that myself, but I was really starting to tear my hair out. Thanks! - Jesse -Original Message- From: Andrew Curry [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:23 PM To: Jesse Farrell Cc: beginners@perl.

RE: Recognizing integer as string for if statement

2007-08-14 Thread Andrew Curry
Unless im being very stupid in what your requirements are If(defined $variable && $variable ne "0") { } -Original Message- From: Jesse Farrell [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 21:18 To: beginners@perl.org Subject: Recognizing integer as string for if statement Is there a

Recognizing integer as string for if statement

2007-08-14 Thread Jesse Farrell
Is there a way to have a variable recognized as a string even if it contains a valid integer? I have a script that is taking strings from a file that can be numbers, including zero. I have an if statement to simply see if the variable exists (otherwise I need to throw an error), and if the variab

Fwd: slices

2007-08-14 Thread Jay Savage
The dreaded reply-to strikes again: On 8/9/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > > $ perl -wle'my @bar = qw/alpha beta gamma/; @bar[()] = (1, 2, 3); > > > > > > ^^^ > > > > Can you explain this? The index

Re: qr + shift

2007-08-14 Thread Jay Savage
On 8/12/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > John W. Krahn wrote: > > yitzle wrote: > >> Works: > >> my $t = shift; > >> my $id = qr($t); > >> Doesn't work: > >> my $id = qr(shift); > >> > >> Why? > > > > perldoc -q "How do I expand function calls in a string" > > It's be

Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Jay Savage
On 8/14/07, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > I am attempting to sort data which has a combination of both numeric > and alpah numeric data. Now it would not be so bad, but the numeric data > can be either 9 or 10 characters in length and no leading z

Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Martin Barth
Hi there, http://search.cpan.org/~sburke/Sort-Naturally-1.02/lib/Sort/Naturally.pm HTH, martin. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Chas Owens
On 8/14/07, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > I am attempting to sort data which has a combination of both numeric > and alpah numeric data. Now it would not be so bad, but the numeric data > can be either 9 or 10 characters in length and no leading z

Re: System call returning Bad file Descriptor

2007-08-14 Thread Chas Owens
On 8/14/07, Darnelle Roby <[EMAIL PROTECTED]> wrote: snip > Once we call the script using an Oracle forms Host call the script returns an > error in the log file of "Bad file descriptor". snip > if (system("ghostscript -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite snip It sounds like ghostscript is getti

Ability to do numeric and alpha sort in one pass on data which is compirsed of both

2007-08-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I am attempting to sort data which has a combination of both numeric and alpah numeric data. Now it would not be so bad, but the numeric data can be either 9 or 10 characters in length and no leading zero is supplied in the numbers. I have supplied some code I am playing with, but running into a

System call returning Bad file Descriptor

2007-08-14 Thread Darnelle Roby
Currently running the following code within a script on an Linux based Oracle Apps Server. When script ran directly from linux it runs successfully. Once we call the script using an Oracle forms Host call the script returns an error in the log file of "Bad file descriptor". I have confirmed

Re: question over increasing the speed of a perl script

2007-08-14 Thread patmarbidon
patmarbidon a écrit : Luba Pardo a écrit : Dear list: I wrote a script that takes a list of ids from an input file and store these in an array in a pairwise-like manner (if total list is n then the array is (2 ^n)-n). I need to extract for each pair of ids a certain value from a huge file tha

Re: question over increasing the speed of a perl script

2007-08-14 Thread patmarbidon
Luba Pardo a écrit : Dear list: I wrote a script that takes a list of ids from an input file and store these in an array in a pairwise-like manner (if total list is n then the array is (2 ^n)-n). I need to extract for each pair of ids a certain value from a huge file that contains the pair of