Re: Win32::SerialPort to log file

2003-12-15 Thread Ron Willmert
drieux wrote: On Dec 12, 2003, at 7:06 PM, [EMAIL PROTECTED] wrote: I'm trying to get a script to save a barcode scanner's output to a log file. [..] do you mean that you are using use Win32::SerialPort; # use s

Re: Split question

2003-12-15 Thread John W. Krahn
"R. Joseph Newton" wrote: > > Joel Newkirk wrote: > > > Well, actually they don't, since the 'bare' # will be interpreted as > > starting a comment, while the one in quotes won't... ;^) > > > > The op's assignment was assigning 'split(/' to @temp... > > Did you test. Did YOU test? > The only

Re: Getting the most recent file

2003-12-15 Thread victor
That "-M" is a perl file test operator, it will take the string after it as name of a file automatically. Tor. Paul Harwood wrote: One question I have: With this statement: @files = sort { -M $a <=> -M $b } @files; How does Perl understand that these are files and not just text entries? Did

Re: list problem

2003-12-15 Thread Fred Nastos
On December 14, 2003 03:09 pm, John W. Krahn wrote: > Fred Nastos wrote: > > On December 14, 2003 01:21 pm, km wrote: > > How about the old-fashioned way? > > > > for ($i=1; $i<=10) { > > print $i, "\n"; > > $i = $i + 3; > > } > > That produces a syntax error, it won't run. Really

Re: Split question

2003-12-15 Thread Joel Newkirk
On Sun, 2003-12-14 at 18:11, Joel Newkirk wrote: > > > > The first argument to split is converted to a regular expression and the > > '#' character is not special in a regular expression so split/#/ and > > split'\#' do exactly the same thing. > > Well, actually they don't, since the 'bare' # wi

advanced diff in Perl

2003-12-15 Thread Dusan Juhas
Hello, is there any library/utility which can help me to compare 2 different config files (eg. Apache, PHP)? I'd like to see _only_ parameters which are missing either in config_file1 or config_file2 and those parameters which are different. Standard diff can not make this. (comments,white chars.

pass vars to sub via TK/Button

2003-12-15 Thread Oliver Schaedlich
Greetings, I'd like to know how to pass variables fetched by TK/entry to a subroutine by using a Button. The Button/-command line in the following script is obviously wrong, but should suffice to illustrate what I want it to do. I'd be happy if someone could tell me how to do this properly. ---

Re: pass vars to sub via TK/Button

2003-12-15 Thread Laurent_Coudeur
Here is how I do it $mw->Button (-text=>"run", -command=> sub {test($rb_val,$bonobo,$oracleid)})->place(-x=>320, -y=>250 ,-width=>75); Laurent coudeur Oliver Schaedlich <[EMAIL PROTECTED]> 15/12/2003 11:27 Please respond to Oliver Schaedlich To: [EMAIL PROTECTED]

Re: pass vars to sub via TK/Button

2003-12-15 Thread Oliver Schaedlich
Greetings, 15.12.2003, [EMAIL PROTECTED] wrote: >$mw->>Button (-text=>"run", > -command=> sub {test($rb_val,$bonobo,$oracleid)}) > ->place(-x=>320,-y=>>250 ,-width=>75); thanks for your reply. I tried to adapt to your example: $main->Button ( -text => 'Add', -command => sub

Re: pass vars to sub via TK/Button

2003-12-15 Thread Laurent_Coudeur
not to sure what your problem is so Here is How I get the variables back sub test{ my $type=$_[0]; #$rb_val my $number=$_[2]; #$bonobo my $path1=$_[1];#$oracleid (these are string but I use the same process) Laurent coudeur Oliver Schaedlic

Re: Split question

2003-12-15 Thread R. Joseph Newton
"John W. Krahn" wrote: > "R. Joseph Newton" wrote: > > > > Joel Newkirk wrote: > > > > > Well, actually they don't, since the 'bare' # will be interpreted as > > > starting a comment, while the one in quotes won't... ;^) > > > > > > The op's assignment was assigning 'split(/' to @temp... > > > >

RE: Split question

2003-12-15 Thread Perry, Alan
On Monday, December 15, 2003 03:05, John W. Krahn wrote: >Here is a little quiz for you beginners out there. split() treats its >first argument as a regular expression. There are TWO exceptions where >the first argument does not behave the same as a normal regular >expression. What are they? T

RE: Split question

2003-12-15 Thread Wiggins d Anconia
> On Monday, December 15, 2003 03:05, John W. Krahn wrote: > > >Here is a little quiz for you beginners out there. split() treats its > >first argument as a regular expression. There are TWO exceptions where > >the first argument does not behave the same as a normal regular > >expression. Wha

How do you build your HTML?

2003-12-15 Thread Kevin Old
Hello everyone, I've been "hand coding" HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to "autogenerate" creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CGI.pm route as I am generating sta

Re: Parentheses

2003-12-15 Thread Steve Grazzini
On Dec 14, 2003, at 9:20 AM, Rob Dixon wrote: Steve Grazzini wrote: Actually, $_ isn't localized by 'while(<>)': % echo test | perl -le 'for ("const") { print while <> }' Modification of a read-only value attempted at -e line 1. Which occasionally jumps up and bites people. Thanks for th

Server Errors

2003-12-15 Thread Mr. W. A. Khushil Dep
I've got the below script saved on my server - but every time I use it I get an Internel Server Error! I've set the permission to 755 but still no luck. Any ideas folks? www.klconsulting.co.uk/cgi-bin/cssc.pl #!/usr/bin/perl use Net::Ping; @host_array = ("192.153.1.10","192.153.0.18","212.241.1

RE: advanced diff in Perl

2003-12-15 Thread Bakken, Luke
The Config::General module can read Apache-style config files. You should then be able to compare the contents of the files by comparing the hash tables returned by Config::General. Luke -Original Message- From: Dusan Juhas [mailto:[EMAIL PROTECTED] Sent: Mon

RE: Server Errors

2003-12-15 Thread Steven Kreuzer
Your script is erroring out for some reason, and it might be because you never defined $my_addr. $p->bind($my_addr) Sets the source address from which pings will be sent. This must be the address of one of the interfaces on the local host. $my_addr may be specified as a hostname or as a text IP ad

Get Terminal Width and Height, Pure Perl

2003-12-15 Thread James Edward Gray II
Okay, I have a terminal program I need to get the width and height for. I have a very good reason needing to do it with a base 5.8 Perl install, if at all possible. Unfortunately, that rules out the super easy Term::ReadKey CPAN module. (Side note: I do have Term::ReadKey installed and am ve

RE: Server Errors

2003-12-15 Thread Guay Jean-Sébastien
> I've got the below script saved on my server - but every time I use it I > get an Internel Server Error! I've set the permission to 755 but still no > luck. Any ideas folks? First of all, make your life easier with use strict; use warnings; right after the shebang line. Second of all, the si

Weekly list FAQ posting

2003-12-15 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

RE: Get Terminal Width and Height, Pure Perl

2003-12-15 Thread Charles K. Clarkson
James Edward Gray II <[EMAIL PROTECTED]> wrote: : : So my question is, is there a "Pure Perl" way to fetch : the terminal columns and rows? I took a look at the source of Term::ReadKey and it seemed to be pure perl. Are you sure it's not? If it is, you could use it as a guide to write your o

Re: Win32::SerialPort to log file

2003-12-15 Thread drieux
On Dec 15, 2003, at 12:23 AM, Ron Willmert wrote: drieux wrote: [..] do you mean that you are using [..] Thanks! you are more than welcome. You will of course forgive the brief 'evil Homer Simpson moment' Yes, that's t

RE: Split question

2003-12-15 Thread Charles K. Clarkson
Wiggins d Anconia <[EMAIL PROTECTED]> wrote: : : > On Monday, December 15, 2003 03:05, John W. Krahn wrote: : > : > > Here is a little quiz for you *BEGINNERS* out there. [emphasis added] : : But parentheses are normal in a regex, though granted the : return is odd. I would guess as the second

Re: Get Terminal Width and Height, Pure Perl

2003-12-15 Thread James Edward Gray II
On Dec 15, 2003, at 10:51 AM, Charles K. Clarkson wrote: James Edward Gray II <[EMAIL PROTECTED]> wrote: : : So my question is, is there a "Pure Perl" way to fetch : the terminal columns and rows? I took a look at the source of Term::ReadKey and it seemed to be pure perl. Are you sure it's not

RE: Get Terminal Width and Height, Pure Perl

2003-12-15 Thread Bob Showalter
James Edward Gray II wrote: > On Dec 15, 2003, at 10:51 AM, Charles K. Clarkson wrote: > > > James Edward Gray II <[EMAIL PROTECTED]> wrote: > > > > > > So my question is, is there a "Pure Perl" way to fetch > > > the terminal columns and rows? > > > > > > I took a look at the source of Ter

Re: How do you build your HTML?

2003-12-15 Thread drieux
On Dec 15, 2003, at 7:57 AM, Kevin Old wrote: [..] I've been "hand coding" HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to "autogenerate" creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CG

RE: Get Terminal Width and Height, Pure Perl

2003-12-15 Thread Steven Kreuzer
>> You might be able to get away with something as simple as querying the >> LINES and COLUMNS environment variables. Or use the output from 'tput >> lines' and 'tput columns'. It all depends on your platform... Actually, its tput cols Steven Kreuzer Linux Systems Administrator Etagon, Inc W: 646

a doubt

2003-12-15 Thread Ajey
Hi, How can i catch the difference in 2 files on a perl stmt? I want to do somethign like, if (there is some diff in 2 files) do something1 else do something2 Both files are simple text files TIA -Ajey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

Re: Server Errors

2003-12-15 Thread John W. Krahn
"Mr. W. A. Khushil Dep" wrote: > > I've got the below script saved on my server - but every time I use it I > get an Internel Server Error! I've set the permission to 755 but still > no > luck. Any ideas folks? > > www.klconsulting.co.uk/cgi-bin/cssc.pl > > #!/usr/bin/perl > use Net::Ping; > >

Re: a doubt

2003-12-15 Thread John W. Krahn
Ajey wrote: > > Hi, Hello, > How can i catch the difference in 2 files on a perl stmt? > I want to do somethign like, > if (there is some diff in 2 files) > do something1 > else > do something2 > Both files are simple text files use File::Compare; if ( compare( 'file1', 'file2' ) == 0 ) {

Recommended simple Perl IDE/Editors ?

2003-12-15 Thread stuart_clemons
Hi all: Just wondering what IDE/editor folks use for their Perl work ? I'm looking for something for a W2K system that is easy to use (without customization) and that has the basics (syntax highlighting, visual debugging, something that shows variable values, the values in whitespace, etc) wit

RE: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Tim Johnson
I've been using PerlBuilder for a while and have had relatively small problems, and the bugs that I've found their support has been able to resolve. It's a bit pricy, but it works. I still use the Perl Dev Kit's debugger, though, because it's better than the one built in to PerlBuilder. -O

Re: a doubt

2003-12-15 Thread Ajey
Too good. thanks John. On Mon, 15 Dec 2003, John W. Krahn wrote: > Ajey wrote: > > > > Hi, > > Hello, > > > How can i catch the difference in 2 files on a perl stmt? > > I want to do somethign like, > > if (there is some diff in 2 files) > > do something1 > > else > > do something2 > > Both fi

RE: How do you build your HTML?

2003-12-15 Thread Chris Ward
Hi Kevin and everyone, I recommend http://www.template-toolkit.org/. Just print out the documentation so it's on hand and your guarenteed on you way to creating some cool ass stuff. Basically it's embedded perl inside HTMLbut you if you reverse it and call it from within a perl cgi module

Re: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Stephan Hochhaus
Just wondering what IDE/editor folks use for their Perl work ? I am on OS X but I use a Java-based editor called jedit, which is available on W32 as well, I guess. http://www.jedit.org/ It supports syntax highlightning, plus it's Freeware and there are lots of nice add-ons! Stephan -- To unsub

Re: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Chuck Fox
[EMAIL PROTECTED] wrote: Just wondering what IDE/editor folks use for their Perl work ? I am on OS X but I use a Java-based editor called jedit, which is available on W32 as well, I guess. http://www.jedit.org/ It supports syntax highlightning, plus it's Freeware and there are lots of nice add-

RE: How do you build your HTML?

2003-12-15 Thread Kevin Old
Hi Chris, Well, I already use HTML::Mason as a templating engine and everything is fine. What I need is a way to generate HTML 4.01 compliant HTML. Basically taking the concept of CGI.pm, but keeping the resulting HTML up to date with the HTML specifications. For example, if you use CGI.pm or w

Re: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Wiggins d Anconia
> > [EMAIL PROTECTED] wrote: > > >> Just wondering what IDE/editor folks use for their Perl work ? > > > > I am on OS X but I use a Java-based editor called jedit, which is > > available on W32 as well, I guess. > > http://www.jedit.org/ > > > > It supports syntax highlightning, plus it's Free

RE: CSV file - Leading Zeros

2003-12-15 Thread Mark LoBue
At 02:03 PM 12/12/2003, Tim Johnson wrote: >I think this is more an Excel question than a Perl question. Excel will >detect that it is a number and show you the equivalent formatted as a >number. I think you can highlight the row and do a Format->Cells and >pick Text as the type. Otherwise if t

Re: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Randy W. Sims
On 12/15/2003 3:29 PM, Wiggins d Anconia wrote: [EMAIL PROTECTED] wrote: Just wondering what IDE/editor folks use for their Perl work ? I am on OS X but I use a Java-based editor called jedit, which is available on W32 as well, I guess. http://www.jedit.org/ It supports syntax highlightning,

Re: CSV file - Leading Zeros

2003-12-15 Thread Mark LoBue
At 09:45 PM 12/12/2003, R. Joseph Newton wrote: >Paul Kraus wrote: > >> Is there a way to write a CSV file so that excel wont drop the leading >> zero's from fields? I could use spreadsheet::writeexcel or OLE but >> that's like using a sledgehammer for something that needs to be hand >> tightened.

RE: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Tom Kinzer
OptiPerl rocks. http://www.xarka.com/optiperl/index.html -Tom Kinzer -Original Message- From: Randy W. Sims [mailto:[EMAIL PROTECTED] Sent: Monday, December 15, 2003 2:22 PM To: Wiggins d Anconia Cc: Chuck Fox; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Recommended simple Perl I

RE: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Tom Kinzer
I use the IDE OptiPerl and like it quite a bit. Vim is the best editor, IMHO. The Optiperl boys have added Vim OLE support to their list of enhancements. http://www.xarka.com/optiperl/index.html -Tom Kinzer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Mo

Re: pass vars to sub via TK/Button

2003-12-15 Thread R. Joseph Newton
Oliver Schaedlich wrote: > Greetings, > > 15.12.2003, [EMAIL PROTECTED] wrote: > > >$mw->>Button (-text=>"run", > > -command=> sub {test($rb_val,$bonobo,$oracleid)}) > > ->place(-x=>320,-y=>>250 ,-width=>75); > > thanks for your reply. > > I tried to adapt to your example: > > $main->Butto

Re: Server Errors

2003-12-15 Thread R. Joseph Newton
"Mr. W. A. Khushil Dep" wrote: > I've got the below script saved on my server - but every time I use it I > get an Internel Server Error! I've set the permission to 755 but still > no > luck. Any ideas folks? > > www.klconsulting.co.uk/cgi-bin/cssc.pl > > #!/usr/bin/perl > use Net::Ping; > > @host

Re: pass vars to sub via TK/Button

2003-12-15 Thread Oliver Schaedlich
Greetings, 15.12.2003, zentara wrote: > $main ->> Button > ( -text => 'Add', > -command => sub{\&add_item($var1,$var2)} > ) -> pack; [...] > sub add_item { [...] >my $entry1 = $_[0]->get(); >my $entry2 = $_[1]->get(); [...] > } thanks for your reply. I tried this out and i

Please help me! Thanks.

2003-12-15 Thread pagoda
for (my $value = -1; $value <= 1; $value += 0.1) { print "$value\n"; } The result is as following: -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 -1.38777878078145e-16 0.0999 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 But what I wanted is: -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2

Re: Please help me! Thanks.

2003-12-15 Thread pagoda
now, a stupid solution is: for (my $value = -1000; $value <= 1000; $value += 100) { print $value/1000, "\n"; } hehe, - Original Message - From: "pagoda" <[EMAIL PROTECTED]> To: "begin begin" <[EMAIL PROTECTED]> Sent: Tuesday, December 16, 2003 1:54 PM Subject: Please help me!

Re: pass vars to sub via TK/Button

2003-12-15 Thread Oliver Schaedlich
Greetings, thanks for your reply. 16.12.2003, R. Joseph Newton wrote: > What does perldoc Tk::Entry tell you? a) that there is a doc for Entry in the first place - I didn't know that, only read the main TK documentation. ^^; b) Now that I read it, hmm, not much I'm afraid. Either I missed

Re: Please help me! Thanks.

2003-12-15 Thread Hacksaw
> now, a stupid solution is: > > for (my $value = -1000; $value <= 1000; $value += 100) { > print $value/1000, "\n"; > } > > hehe, > Sadly, it's not as stupid as you think. Unless I misunderstand things, what you are seeing here is a problem called IEEE 754 floating point. I'm sure th

Re: Please help me! Thanks.

2003-12-15 Thread Paul Johnson
On Tue, Dec 16, 2003 at 02:25:42PM +0800, pagoda wrote: > now, a stupid solution is: > > for (my $value = -1000; $value <= 1000; $value += 100) { > print $value/1000, "\n"; > } > > hehe, Not so stupid, really. If you can keep most of your maths confined to integers you will have fewer

RE: Please help me! Thanks.

2003-12-15 Thread Charles K. Clarkson
pagoda <[EMAIL PROTECTED]> wrote: : Take a look at the first question in perlfaq4: Why am I getting long decimals (eg, 19.94999) instead of the numbers I should be getting (eg, 19.95)? HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc. Mobile Home Specialists