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=<PORT>;
print "$in"

I am getting error msg that

permission denied at line 3

Thanks in advance
Swayam
----- Original Message ----- From: "Charles K. Clarkson" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Tuesday, November 08, 2005 1:14 AM
Subject: RE: Regex


[EMAIL PROTECTED] <mailto:[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 get an example?

   I wasn't sure if those single quotes were part of the field or
just delimiters.


#!/usr/bin/perl

use strict;
use warnings;

$_ = "modprobe: modprobe: Can't locate module char-major-10-134";

s/'/''/g;

print;

# OR

$_ = "'modprobe: modprobe: Can't locate module char-major-10-134'";

s/(\w)'(\w)/$1''$2/g;    # There is probably a more
                        # elegant way to write this.
print;

__END__


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to