[19540] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1735 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 12 03:05:24 2001

Date: Wed, 12 Sep 2001 00:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000278308-v10-i1735@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 12 Sep 2001     Volume: 10 Number: 1735

Today's topics:
    Re: cgi-page and exec <bwalton@rochester.rr.com>
    Re: Convert hex dump to binary (Phil Hibbs)
    Re: CPAN problems on OSX <gnarinn@hotmail.com>
    Re: help with this script-database column names <goldbb2@earthlink.net>
    Re: How do you use <> and @ARGV with 4nt? <pne-news-20010912@newton.digitalspace.net>
    Re: How do you use <> and @ARGV with 4nt? <pne-news-20010912@newton.digitalspace.net>
    Re: Is there any perl script formater? (Jonadab the Unsightly One)
    Re: Is there any perl script formater? (Martien Verbruggen)
    Re: Is there any perl script formater? <pne-news-20010912@newton.digitalspace.net>
    Re: Laugh: BT webspace CGI conditions <goldbb2@earthlink.net>
    Re: non-blocking Socket IO problem?  Help Req. (Villy Kruse)
    Re: PERL DBI module question <goldbb2@earthlink.net>
    Re: problems getting info from Oracle database table <gnarinn@hotmail.com>
    Re: process stopping --> start script <goldbb2@earthlink.net>
    Re: recognize MS Windows with perl <pne-news-20010912@newton.digitalspace.net>
    Re: Serial port communication <cliff@rayman.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 12 Sep 2001 04:07:38 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: cgi-page and exec
Message-Id: <3B9EDF40.850C08B2@rochester.rr.com>

Rami Huhtala wrote:
 ...
> I have perl cgi html-page and there is a button, when you push a button
> its runs other perl program (this is only perl script not cgi). Okay its
> runs the other program okay but browser goes give error message:
> 
> This server has encountered an internal error which prevents
> it from fulfilling your request. The most likely cause is a misconfiguration.
> 
> where is the problem. cgi-script is like:
> 
> #!/usr/bin/perl
> use CGI;
> $query = CGI->new();
> print $query->header();
> $run   = $query->param('run');
> print "<!doctype html public '  -//w3c//dtd html 4.0 transitional//en'>\n";
> print "<html>\n";
> print "<head>\n";
> print "<title>CSV FILES</title>\n";
> print "</head>\n";
> print "<body>\n";
> print "<table>";
> print "<form name=Form1action='http://server/cgi-bin/get_files.pl'  METHOD='POST'>";
> print '<tr><td><input name=run type=submit value="Run"></td>';
> print "</form>";
> if ($run ne '')
> {
> exec("/server/cgi-bin/csv.pl");
> }
> 
> and csv.pl makes only file
 ...
> Rami
Well, when I load the garble generated by this into my browser, I get a
blank page.  You might considering separating Form1 and action in the
<form> tag with a space; closing your table's row with a </tr> tag;
closing your table with a </table> tag; closing your body with a </body>
tag; closing the HTML with a </html> tag; and fixing the other more
minor syntax/usage issues.  Since you are using CGI, maybe you should
use its facilities to do all that, so your wouldn't make such errors?

Does the program you exec return a proper exit code?  Maybe your web
server cares.  Also, depending on your OS, you might need to make sure
the csv.pl script is executable, or that the .pl extension is configured
to run Perl. Maybe you need exec("perl /server/cgi-bin/csv.pl"); on your
OS?

When I fixed up that crap and ran it on my web server, it worked fine. 
And I tested it writing a file, too.

And, what is your Perl question?
-- 
Bob Walton


------------------------------

Date: 11 Sep 2001 23:43:15 -0700
From: phil.hibbs@capgemini.co.uk (Phil Hibbs)
Subject: Re: Convert hex dump to binary
Message-Id: <153e25f0.0109112243.4fd79347@posting.google.com>

Tad McClellan:
> #!/usr/bin/perl -w
> use strict;
> while(<DATA>) {
>    foreach my $hex ( split /\s+/, substr($_, 6, 23) ) {
>       print chr hex $hex;
>    }
> }

Wow, thanks! I had to move the "my $hex" up to before the while (may
be a Perl 5.001 quirk - I know, I should upgrade, don't bother telling
me), but basically, it's perfect! Thanks!

I had a quick "D'oh" moment when I thought perl was crashing, then I
realised that the file I was feeding it was full of Dr.Watson output.

Phil Hibbs.


------------------------------

Date: Wed, 12 Sep 2001 05:52:02 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: CPAN problems on OSX
Message-Id: <1000273922.0512003721669316.gnarinn@hotmail.com>

In article <31515748.0109110643.332731e1@posting.google.com>,
kerin <kerin@airside.co.uk> wrote:
>I'm pretty much a Perl newbie (I'm a PHP developer by trade), but
>today I've had to delve into the world of Perl and CPAN, and I'm
>having problems.
>
>Whenever I try and install any module whatsoever, I get an error like
>this:

[snipped cpan errors]

have you read perldoc CPAN ?
if you are behind a firewall you may have to look at the section:
  WORKING WITH CPAN.pm BEHIND FIREWALLS

it looks to me as if CPAN::Config may be bad. take a look at
  perldoc -m CPAN::Config
for some wrong things

also if it exists, at ~/.cpan/CPAN/MyConfig.pm

maybe the 'urllist' value contains invalid CPAN mirrors

you can always try to install manually, but it is worth it to
try to get the cpan tool working. it is really nice.

gnari


------------------------------

Date: Wed, 12 Sep 2001 00:44:27 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: help with this script-database column names
Message-Id: <3B9EE82B.C8C58380@earthlink.net>

gnarasi wrote:
[snip]
> The following works. Thanks.

It might work, but it's not the best that the code could be.

For one thing, it could be much shorter.

#!/usr/bin/perl -wT
use strict;
BEGIN {
    print "Content-type: text/html\n\n";
    $SIG{__DIE__} = sub {
        print "<BLINK><CODE>", @_, "</CODE></BLINK>";
        exit 0;
    };
}
use DBI;

my $dbi = DBI->connect(
    "dbi:mysql:gldb",
    "root", "" ,
    {RaiseError=>1}
);
my $sth = $dbi->prepare("SELECT * FROM cia");
$sth->execute;
print qq[<HTML><HEAD><TITLE>SQL Statement Results</TITLE></HEAD>\n];
print qq[<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n];
print qq[<CENTER><TABLE BORDER=1><TR>\n];
foreach( @{ $sth->{NAME} } ) {
    print q[<TH ALIGN=MIDDLE VALIGN=TOP BGCOLOR="FFFFCC"><B>];
    print $_, qq[</B></TH>\n];
}
while( my $row = $sth->fetchrow_arrayref ) {
    print qq[</TR><TR>\n];
    foreach my $column (@$row) {
        print q[<TD>],$_,q[</TD>];
    }
}
print qq[\n</TR></TABLE></CENTER></BODY></HTML>\n];
__END__

Besides being smaller, every level of indentation here *means*
something... so if/when you want to go and change things a month or year
from now, you can see exactly what everything is doing.  Oh, and it has
warning, strictures, and taint-checking turned on, further decreasing
the chances that future changes will introduce errors.

-- 
"I think not," said Descartes, and promptly disappeared.


------------------------------

Date: Wed, 12 Sep 2001 08:33:47 +0200
From: Philip Newton <pne-news-20010912@newton.digitalspace.net>
Subject: Re: How do you use <> and @ARGV with 4nt?
Message-Id: <npvtptgu8pgvsgete7vs82ino9q1jua6vv@4ax.com>

On 11 Sep 2001 09:54:42 -0800, yf110@vtn1.victoria.tc.ca (Malcolm
Dew-Jones) wrote:

[autoglob]
> Perhaps you could put this in a module something like
> 
> 	#my_gludgle.pm
> 	@ARGV = map {expand_wild_cards_here } @ARGV;
> 	1;

It exists and is called G.pm. http://Jenda.Krynicky.cz/ .

> and then when even you run perl on 4NT you always go
> 
> 	perl -Mmy_gludge script.pl

or add -MG to PERL5OPT if desired, as suggested by Jenda.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Wed, 12 Sep 2001 08:33:48 +0200
From: Philip Newton <pne-news-20010912@newton.digitalspace.net>
Subject: Re: How do you use <> and @ARGV with 4nt?
Message-Id: <4rvtptgo1enrv8hcststnfv86onel5m7g2@4ax.com>

On Tue, 11 Sep 2001 03:46:28 GMT, bis@world.std.com (Adi Inbar) wrote:

> It looks like @ARGV doesn't work with 4NT.
> 
> I tried to run a Perl script that I wrote on a Unix system on a
> Windows 2000 system.  I invoked the script at the 4NT 3.02B command
> prompt, and the line
> 
>   my @input = <>;
> 
> produced this error:
> 
>   Can't open %*: Invalid argument at E:\Data Files\Perl\ex6-3.pl line 6.
> 
> I added a line to print the contents of @ARGV, and sure enough, the
> result was "%*".

Did you run the script through pl2bat or something like that? I think
that adds a preamble that tries to exec with %* meaning "all arguments"
(sort of like $* or "$@" or something like that with Unix shells).
Specifically, does the beginning of your script look a bit like this?

: @rem = '--*-Perl-*--
: @echo off
: if "%OS%" == "Windows_NT" goto WinNT
: perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
: goto endofperl
: :WinNT
: perl -x -S "%0" %*
: if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
: if %errorlevel% == 9009 echo You do not have Perl in your PATH.
: goto endofperl
: @rem ';
: #!/usr/local/bin/perl -w

There's a %* in there (around the middle) which 4NT may not like but
CMD.EXE presumably handles correctly. So if you ran your script through
such a converter, you may need to tweak it for your shell.

Did you call the script as "ex6-3.pl" or as "perl ex6-3.pl"? If the
former, what happened when you called it as the latter?

Can you post the script here?

> (Are there any 4NT newsgroups?  I couldn't find any...)

Possibly comp.os.msdos.4dos , since 4DOS and 4NT presumably behave
fairly similarly in many respects.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Wed, 12 Sep 2001 04:19:10 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: Is there any perl script formater?
Message-Id: <3b9edc50.11032341@news.bright.net>

crud@hongkong.com (Dav Lam) wrote:

> Any perl formator out there that is to reformat perl scripts?
> Thanks in advance..

I use this elisp function:

(defun reformat-buffer ()
  (interactive)
  (indent-region (point-min) (point-max) nil))

This is a simple solution in that it doesn't rewrap comments
or strings, but it does fix up indentation, and it's fast.

Incidentally, can someone fill in the blank spot at the 
end of the table below for me?

  Language | text-editor-with-that-language-for-scripting
  ---------+---------------------------------------------
   lisp    |   Emacs
   Python  |   Wily
   Java    |   jedit
   Tcl     |   Alpha
   Perl    |   
               ^^^^^

Surely, as great as Perl is for text manipulation, there
must be an editor out there that uses it for scripting?

Not that I'm looking to switch personally since I already 
know lisp anyway, but...  I'd still like to know if there's
an equivalent to Emacs with Perl instead of lisp.  

- jonadab


------------------------------

Date: Wed, 12 Sep 2001 06:06:41 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Is there any perl script formater?
Message-Id: <slrn9pturh.n8d.mgjv@verbruggen.comdyn.com.au>

On Wed, 12 Sep 2001 04:19:10 GMT,
	Jonadab the Unsightly One <jonadab@bright.net> wrote:
> 
>   Language | text-editor-with-that-language-for-scripting
>   ---------+---------------------------------------------

>    Perl    |   
>                ^^^^^

vim has quite some support for Perl, as well as for python and tcl.  

You can execute arbitrary perl code, and apply it to a range of your
file.  It also has some other uses. There is a VIM:: set of package
namespaces available as well, that give the programmer access to
editor, window and document specific functions and values.

Can't say I've used it very often though. I tend to use a shell prompt
for most of these needs.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Unix is the answer, but only if you
Commercial Dynamics Pty. Ltd.   | phrase the question very carefully
NSW, Australia                  | 


------------------------------

Date: Wed, 12 Sep 2001 08:19:23 +0200
From: Philip Newton <pne-news-20010912@newton.digitalspace.net>
Subject: Re: Is there any perl script formater?
Message-Id: <n3vtpto4408fo5lvovsucqm23femjtkho3@4ax.com>

On Wed, 12 Sep 2001 04:19:10 GMT, jonadab@bright.net (Jonadab the
Unsightly One) wrote:

> Incidentally, can someone fill in the blank spot at the 
> end of the table below for me?
> 
>   Language | text-editor-with-that-language-for-scripting
>   ---------+---------------------------------------------
>    lisp    |   Emacs
>    Python  |   Wily         vim
>    Java    |   jedit
>    Tcl     |   Alpha
>    Perl    |                vim
>                ^^^^^
> 
> Surely, as great as Perl is for text manipulation, there
> must be an editor out there that uses it for scripting?

Perl and Python can both be compiled into vim. And I think one of vile
or elvis (other vi clones) wanted to add Perl -- ask H.Merijn Brand, he
uses it and mentioned it to me at one point, but I forgot which clone it
was.

> Not that I'm looking to switch personally since I already 
> know lisp anyway, but...  I'd still like to know if there's
> an equivalent to Emacs with Perl instead of lisp.  

I don't think there's an equivalent to Emacs, period. It's in a category
of its own, IMO.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Wed, 12 Sep 2001 01:38:50 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Laugh: BT webspace CGI conditions
Message-Id: <3B9EF4EA.4BF6AF70@earthlink.net>

Stuart Moore wrote:
> 
> Anyone who wants a bit of humour, see if you can spot my problem here:
> 
> BT's conditions for use of it's CGI webspace.
[snip]
>  - these would imply that I can use perl to open files. Which is nice
> of them.
> But then:
> 
> * Do not use "exec", "fork", "open", "pipe", "system", "backticks" or "eval".
>                                /\ !!!

The reason for this is if you did something dumb, like:
	open( FH, param("foo") );
which would be bad, since if the CGI supplied parameter begins or ends
with |, it will result in a new proccess [which is exactly what they
don't want happening].

I don't see sysopen on that list, so that would be a perfectly valid way
of opening files.

Another would be to use the three argument version of open, and make
sure to *not* use "-|" or "|-" as the specifiers [since such things do
forking].  Yes, I realize this uses "open" but the three-argument
version of it is just as safe as sysopen.

Presumably, they would also want you to not use open2 and open3 from
IPC::Open2 and IPC::Open3.

Personally, I think that instead of restricting what *functions* you
should use, they should require that you do the two following things:

	1) use the -T option as one of perl's flags.
	This is done with:
		#!/path/to/perl -T
	2) use the 'ops' pragma, to disable the following items:
		:subprocess
		:ownprocess
	This is done with:
		no ops qw(:subprocess :ownprocess);

The first results in disabling eval for most uses of it which they might
be afraid of, the second disables those other functions.

This has the additional benefit of extending the restriction to modules
which might be used by your modules.

-- 
"I think not," said Descartes, and promptly disappeared.


------------------------------

Date: 12 Sep 2001 06:56:57 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: non-blocking Socket IO problem?  Help Req.
Message-Id: <slrn9pu1po.h1n.vek@pharmnl.ohout.pharmapartners.nl>

On Tue, 11 Sep 2001 13:41:29 +0100,
    Chris Morris <chris_h_morris@bigfoot.com> wrote:


>My attempt to use sysread on a socket didn't work on Linux (although the
>same script ran fine on Win98!)
>I'd avoid this unles your host is very POSIX compliant.
>
>



That doesn't make sense.  Linux is very POSIX, much more than Win98.
If you combine socket io with IO::Select or the 4 argument select
function in perl you should only use sysread and syswrite.



Villy


------------------------------

Date: Wed, 12 Sep 2001 00:17:55 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: PERL DBI module question
Message-Id: <3B9EE1F3.CCD016E4@earthlink.net>

Tim Schultz wrote:
> 
> John,
> Thanks for the rapid response time.
> The script I'll be using is the simplest use of the DBI module. It
> makes no fopen or calls to a log file. Does DBI have a built-in call
> to write to a log file? (code below):

No, and that's probably not the problem.  The real problem is that
you didn't print the needed CGI header.

>  #!/usr/bin/perl

#!/usr/bin/perl -wT
use strict;

The -w and strict should be in all of your programs, everywhere.
The -T should be on all of your CGI programs.

>       use lib qw(/data/web/65962/modules/DBI);
>       use DBI ();
>       use DBD::mysql ();

Since you want this script to run as a CGI program, with minimal changes, add the following line:
	print "Content-type: text/plain\n\n";


>       my $dbh =
> DBI->connect("DBI:mysql:database=65962_1;host=mysql.hostcentric.net",
>                              "bardavon", "romi7ruj7646",
>                              {'RaiseError' => 1});

Nothing *wrong* with this line, but it would be more readable as:
	my $dbh = DBI->connect( "DBI:mysql:" .
		"database=65962_1;" .
		"host=mysql.hostcentric.net",
		"bardavon", "romi7ruj7646",
		{RaiseError => 1},
	);

Don't get the .s confused with ,s [I've seen someone do that] and umm, should you *really* be posting what appears to be an actual userid and password on a public forum?

Oh, and the reason I removed the '' around RaiseError is that the => operator will cause barewords on it's left hand side to be stringified.

>       my $sth = $dbh->prepare("SELECT * FROM press_releases WHERE id = 13");
>       $sth->execute();
>       while (my $ref = $sth->fetchrow_hashref()) {
>         print "Found a row: id = $ref->{'id'}, Headline = ref->{'headline'}\n";

You left off a $ in front of ref->{'headline'}

>       }
>       $sth->finish();
>       # Disconnect
>       $dbh->disconnect();

These lines would be more readable as:
	my $sth = $dbh->prepare( q[
		SELECT id, headline
		FROM press_releases
		WHERE id = 13
	] );
	$sth->execute;
	while (my ($id,$headline) = $sth->fetchrow_array) {
		print "Found a row: id = $id, ";
		print "Headline: $headline\n";
	}

You don't need to call finish unless you exit the loop before all items
have been fetched.  You don't need to explicitly call disconnect,
especially if all you're doing is fetching data, not inserting, updating,
or removing records, or dropping tables.

-- 
"I think not," said Descartes, and promptly disappeared.


------------------------------

Date: Wed, 12 Sep 2001 06:11:26 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: problems getting info from Oracle database table
Message-Id: <1000275086.325118447188288.gnarinn@hotmail.com>

In article <cf0dac6.0109111554.166108ed@posting.google.com>,
Ponzie B. Pogie <ponzie_b_pogie@hotmail.com> wrote:
>In the following code, I have no problem connecting to a Oracle
>database on NT. (I'm using Solaris). The table is not empty, but I get
>a zero printed, followed by "Sorry, no matches." Hopefully someone can
>help me with this. Thanks in advance.

[snip]

>my $matches=$sth->rows();
>print "$matches\n";
>unless ($matches) {
>	print "Sorry, no matches\n";
>} else {
>	print "matches found:\n";
>	while (my @row = $sth ->fetchrow_arrayref()) {
>		print "@row\n";
>	}
>}

the answer, as usual is in the docs.
perldoc DBI
see the definition of the rows method, in particular:

  For C<SELECT> statements, it is generally not possible to know how many
  rows will be returned except by fetching them all.  Some drivers will
  return the number of rows the application has fetched so far, but
  others may return -1 until all rows have been fetched.  So use of the
  C<rows> method or C<$DBI::rows> with C<SELECT> statements is not
  recommended.

  One alternative method to get a row count for a C<SELECT> is to execute a
  "SELECT COUNT(*) FROM ..." SQL statement with the same "..." as your
  query and then fetch the row count from that.


change your code to something like:

  my $matches=0;
  while (my @row = $sth ->fetchrow_arrayref()) {
      print "matches found:\n" unless  $matches++;    
      print "@row\n";
  }
  if ($matches) {
    print "\n$matches\n";
  } else {
    print "\nSorry, no matches\n";
  }


gnari




------------------------------

Date: Wed, 12 Sep 2001 02:00:50 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: process stopping --> start script
Message-Id: <3B9EFA12.6DB6FE8B@earthlink.net>

Luke Vanderfluit wrote:
[snip]
>         system("squid &");
>         system("/etc/rc.d/rc.firewall");
>         system("/etc/rc.d/init.d/smb start");
>         system("wvdial &");
>         system("sleep 1m");
>         system("keepLinkUp > /dev/null &");
> }
> ---------------------------
> But now!
> I want to know when wvdial exits or terminates in whatever way, so I
> can kill the keepLinkUp script.
> I think I need the exit of 'wvdial' to trigger a script that gets the
> PID of 'keepLinkUp' and kills it.
> 
> Has anyone got an idea?

	use IPC::Open3;
	open(DEVNULL, "<", "/dev/null");
	my $s = open3(">&STDOUT", "<&DEVNULL", ">&STDERR", "squid");
	system("/etc/rc.d/rc.firewall");
	system("/etc/rc.d/init.d/smb start");
	open(DEVNULL, "<", "/dev/null");
	my $w = open3(">&STDOUT", "<&DEVNULL", ">&STDERR", "wvdial");
	sleep 10*60;
	open(DEVNULL, "<+", "/dev/null");
	my $k = open3(">&DEVNULL", "<&DEVNULL", ">&STDERR",
		"keepLinkUp");
	my $pid = wait or die "wait: $!";
	if( $pid == $s ) {
		die "Uh oh, squid died\n"
	} elsif( $pid == $k ) {
		die "Uh oh, keepLinkup died\n";
	} elsif( $pid != $w ) {
		die "Urk, got $pid, expected one of $s, $w, $k\n";
	}
	kill "TERM", $k;

-- 
"I think not," said Descartes, and promptly disappeared.


------------------------------

Date: Wed, 12 Sep 2001 08:19:22 +0200
From: Philip Newton <pne-news-20010912@newton.digitalspace.net>
Subject: Re: recognize MS Windows with perl
Message-Id: <unutptkmchdgc2pb0ckopuia7nc50i7p15@4ax.com>

On Tue, 11 Sep 2001 21:49:26 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:

> Alex Hart wrote:
> 
> >What is the best way to determine whether my program is being run on a
> >MS Windows box? Is there a sure fire way?
> 
> $^O, but that does NOT make a distinction between various flavours of
> Win9x and/or NT/Win2K. Its always "MSWin32". The reason is because this
> value is baked into the executable, and you run the same executable on
> all versions.

Which is also the reason why it's not a completely reliable indicator of
the operating system you're running on. You might be running a Linux
binary under emulation on a *BSD system, or whatever. You'll get the OS
that the binary was compiled for, not necessarily the OS you're running
under.

(But if you're running on Win32 and have libwin32 installed [which is
the case by default under ActivePerl], you may be able to use
Win32::IsWinNT/Win32::IsWin95 and/or Win32::GetOSVersion to distinguish
more closely between the various Win32 flavours.)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: Wed, 12 Sep 2001 04:09:52 GMT
From: ___cliff rayman___ <cliff@rayman.com>
Subject: Re: Serial port communication
Message-Id: <3B9EDE98.70C580C5@rayman.com>

search.cpan.org is your friend:
http://search.cpan.org/search?dist=Device-SerialPort

terminalsplash wrote:

> Hi
>
>    I'm trying to write a perl script for serial port communication in LINUX.
> Which module can I use?
> I know in windows I can use WIN32.

--
_____cliff_rayman_____cliff_@_rayman_._com_____




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 1735
***************************************


home help back first fref pref prev next nref lref last post