how to read write COM port

2005-11-07 Thread swayam panda
Hi , I have installed Perl 5.8.7 on windows XP. How to read from COM port . when i am writing the program like this open( PORT, "COM1" ) or die "Can't open COM1: $!"; my $in=; print "$in" I am getting error msg that permission denied at line 3 Thanks in advance Swayam - Origina

RE: Getopt::Long

2005-11-07 Thread Timothy Johnson
An excerpt from the documentation: " my $tag = ''; # option variable with default value GetOptions ('tag=s' => \$tag); In the option specification, the option name is followed by an equals sign "=" and the letter "s". The equals sign indicates that this option requires a

Getopt::Long

2005-11-07 Thread Chris Knipe
Hi all, Just a quick question and a couple of lines of really simple code use Getopt::Long; ... GetOptions ('h' => \$h, 'b=s' => \$s ); Sub ShowHelp() { print "this is help" } Sub DoSomethingWithString() { ... } If ($s) { DoSomethingWithString(); } else { ShowHel

Re: See the structure of what I am pulling via DBI

2005-11-07 Thread Michael David
"Robert Hicks" <[EMAIL PROTECTED]> wrote > If I am pulling data out with a $sth->fetchrow_arrayref, how do I see the > structure of what is coming back? I need to change the description on some > of the data coming back out (like changing a "C" to "Closed") but I am not > sure how to see the arra

Re: See the structure of what I am pulling via DBI

2005-11-07 Thread Robert
JupiterHost.Net wrote: Robert Hicks wrote: If I am pulling data out with a $sth->fetchrow_arrayref, how do I see the structure of what is coming back? I need to change the description on some use Data::Dumper; print Dumper $sth->fetchrow_arrayref(.. of the data coming back out (like

Re: PS what is the correct/efficient function to create a file

2005-11-07 Thread Tom Allison
You could always use Shell module. Hi, unlink $file works fine, but link $file doesn't even exist, The sysopen function seems to be tedious, does anyone know how to effectively create a file in some directory in perl? -- To unsubscribe, e-mail: [EMA

RE: PS what is the correct/efficient function to create a file

2005-11-07 Thread Timothy Johnson
I think people have been pretty clear. the open() function is the standard function for creating files. ## open(OUTFILE,">my_file.txt") or die("Couldn't open 'my_file.txt' for writing!\n"; foreach(1..1001){ print OUTFILE $_; } close OUTFILE; ###

PS what is the correct/efficient function to create a file

2005-11-07 Thread ZHAO, BING
Hi, unlink $file works fine, but link $file doesn't even exist, The sysopen function seems to be tedious, does anyone know how to effectively create a file in some directory in perl? thanks a lot best, -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: about creating a file in directory

2005-11-07 Thread JupiterHost.Net
ZHAO, BING wrote: Hi, Hello, It seems pretty easy to unlink a file from a directory, but wherever describes unlinking file has no counterpart on create a file. I did perldoc -q file: got what seemed to be what I need, then tested my program, no good: open

RE: about creating a file in directory

2005-11-07 Thread Ward.P.Fontenot
You need to look for open / close. Example: open(TMP, "> test.file") || die "Can't open test.file: $! \n"; >From there you are printing to it print TMP "Whatever you are wanting to get into the file"; And closing Close(TMP); -Original Message- From: ZHAO, BING [mailto:[EMAIL PRO

about creating a file in directory

2005-11-07 Thread ZHAO, BING
Hi, It seems pretty easy to unlink a file from a directory, but wherever describes unlinking file has no counterpart on create a file. I did perldoc -q file: got what seemed to be what I need, then tested my program, no good: opendir PDB,"SCRATCH" or die "cannot

RE: Regex

2005-11-07 Thread Ward.P.Fontenot
Thanks a million, that one did it -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 1:55 PM To: Fontenot, Ward P. Cc: beginners@perl.org Subject: Re: Regex [EMAIL PROTECTED] wrote: > I have a field that looks like this: > > 'modprobe: modp

Re: Regex

2005-11-07 Thread Bob Showalter
[EMAIL PROTECTED] wrote: I have a field that looks like this: 'modprobe: modprobe: Can't locate module char-major-10-134' I need to add a single quote so that it looks like this: 'modprobe: modprobe: Can''t locate module char-major-10-134' But I have no idea how to go about doing that, can I

RE: Regex

2005-11-07 Thread Ward.P.Fontenot
I need to retain the outer quotes and only add the single quote if it exists in the field. For instance... Not here: 'kernel: mtrr: Serverworks LE detected. Write-combining disabled.' But here: 'modprobe: modprobe: Can't locate module char-major-10-134' I hope that makes it alittle clearer than

RE: Regex

2005-11-07 Thread Timothy Johnson
What about stripping the outer quotes using Perl and then using $dbh->quote? My concern is that if you try to use a regex it will end up being more complicated than necessary if you try to factor in all of the possibilities. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTE

RE: Regex

2005-11-07 Thread Ward.P.Fontenot
Yes they are -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 12:46 PM To: Fontenot, Ward P. Subject: RE: Regex Are the outer quotes part of the field? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent:

RE: Regex

2005-11-07 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : I have a field that looks like this: : : 'modprobe: modprobe: Can't locate module char-major-10-134' : : I need to add a single quote so that it looks like this: : : 'modprobe: modprobe: Can''t locate module char-major-10-134' : : But I hav

RE: Regex

2005-11-07 Thread Timothy Johnson
If you are using DBI, there is a $dbh->quote() method that will do what you want. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 11:34 AM To: beginners@perl.org Subject: Regex I have a field that looks like this: 'modpro

Regex

2005-11-07 Thread Ward.P.Fontenot
I have a field that looks like this: 'modprobe: modprobe: Can't locate module char-major-10-134' I need to add a single quote so that it looks like this: 'modprobe: modprobe: Can''t locate module char-major-10-134' But I have no idea how to go about doing that, can I get an example? Thanks s

Re: See the structure of what I am pulling via DBI

2005-11-07 Thread JupiterHost.Net
Robert Hicks wrote: If I am pulling data out with a $sth->fetchrow_arrayref, how do I see the structure of what is coming back? I need to change the description on some use Data::Dumper; print Dumper $sth->fetchrow_arrayref(.. of the data coming back out (like changing a "C" to "Close

Re: WWW::Mechanize doesnt download https webpage

2005-11-07 Thread Ing. Branislav Gerzo
Ing. Branislav Gerzo [IBG], on Monday, November 07, 2005 at 13:27 (+0100) has on mind: IBG> use IO::Socket::SSL; #it is installed when I delete ^^ this one, and write: use Crypt::SSLeay; everything works. strange :) -- How do you protect mail on web? I use http://www.2pu.net [Brains aren't e

Re: See the structure of what I am pulling via DBI

2005-11-07 Thread Hal Ashburner
On Mon, 2005-11-07 at 10:56 -0500, Robert Hicks wrote: > If I am pulling data out with a $sth->fetchrow_arrayref, how do I see the > structure of what is coming back? I need to change the description on some > of the data coming back out (like changing a "C" to "Closed") but I am not > sure how to

See the structure of what I am pulling via DBI

2005-11-07 Thread Robert Hicks
If I am pulling data out with a $sth->fetchrow_arrayref, how do I see the structure of what is coming back? I need to change the description on some of the data coming back out (like changing a "C" to "Closed") but I am not sure how to see the arrayref. Robert -- To unsubscribe, e-mail: [EMAIL

Re: Using Mechanize to download a zip file?

2005-11-07 Thread Xavier Noria
On Nov 7, 2005, at 13:33, Dhanashri Bhate wrote: The difference is in the sizes of these files, the File downloaded via the script is a little bigger (about 20 KB) than the File downloaded manually with a browser (the file sizes are in MBs) That comment was the key. I bet a beer this is a ne

Re: waitpid() and exitcode >> 8 ?

2005-11-07 Thread Elie De Brauwer
John W. Krahn wrote: Elie De Brauwer wrote: Hello list, Hello, I recently encountered a small oddity. Suppose I have a process A: #!/usr/bin/perl use strict; print "Hello \n"; sleep 1; print "Goodbye\n"; exit 9; Simply shows some out and gives a certain exit code. A second process, s

Re: waitpid() and exitcode >> 8 ?

2005-11-07 Thread Shawn Corey
Elie De Brauwer wrote: Hello list, I recently encountered a small oddity. Suppose I have a process A: #!/usr/bin/perl use strict; print "Hello \n"; sleep 1; print "Goodbye\n"; exit 9; Simply shows some out and gives a certain exit code. A second process, simply calls fork, execs the child

RE: Using Mechanize to download a zip file?

2005-11-07 Thread Dhanashri Bhate
>>> The difference is in the sizes of these files, the File downloaded >>> via the >>> script is a little bigger (about 20 KB) than the File downloaded >>> manually >>> with a browser (the file sizes are in MBs) >That comment was the key. >I bet a beer this is a newline issue. THANKS A MILL

WWW::Mechanize doesnt download https webpage

2005-11-07 Thread Ing. Branislav Gerzo
Hi all, i have a little problem, I use my favourite WWW::Mechanize to download webpages and so on, but I came to one problem: #!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; use IO::Socket::SSL; #it is installed my $mech = WWW::Mechanize->new(); $mech->agent_alias( 'Windows IE 6' )

Re: Using Mechanize to download a zip file?

2005-11-07 Thread Xavier Noria
On Nov 7, 2005, at 12:39, Dhanashri Bhate wrote: Hello, Thanks for responding! :) Yes, if I manually do the same things I do get a zip file! The difference is in the sizes of these files, the File downloaded via the script is a little bigger (about 20 KB) than the File downloaded manually

RE: Using Mechanize to download a zip file?

2005-11-07 Thread Dhanashri Bhate
Hello, Thanks for responding! :) Yes, if I manually do the same things I do get a zip file! The difference is in the sizes of these files, the File downloaded via the script is a little bigger (about 20 KB) than the File downloaded manually with a browser (the file sizes are in MBs) So I guess t

Re: Using Mechanize to download a zip file?

2005-11-07 Thread Xavier Noria
On Nov 7, 2005, at 11:53, Dhanashri Bhate wrote: I am trying to write a perl script using WWW:::Mechanize, to download a dictionary file from a server. The file is a zip file. The program given below (error checks have been purposely removed), This program runs without any errors/warnings

Using Mechanize to download a zip file?

2005-11-07 Thread Dhanashri Bhate
Hello! I am trying to write a perl script using WWW:::Mechanize, to download a dictionary file from a server. The file is a zip file. The program given below (error checks have been purposely removed), This program runs without any errors/warnings, and i can see the file downloaded in the spe

Re: waitpid() and exitcode >> 8 ?

2005-11-07 Thread John W. Krahn
Elie De Brauwer wrote: > Hello list, Hello, > I recently encountered a small oddity. Suppose I have a process A: > > #!/usr/bin/perl > > use strict; > > print "Hello \n"; > sleep 1; > print "Goodbye\n"; > exit 9; > > Simply shows some out and gives a certain exit code. A second process, > si

waitpid() and exitcode >> 8 ?

2005-11-07 Thread Elie De Brauwer
Hello list, I recently encountered a small oddity. Suppose I have a process A: #!/usr/bin/perl use strict; print "Hello \n"; sleep 1; print "Goodbye\n"; exit 9; Simply shows some out and gives a certain exit code. A second process, simply calls fork, execs the child in a process and waits f