[11092] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4692 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 19 18:05:26 1999

Date: Tue, 19 Jan 99 15:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 19 Jan 1999     Volume: 8 Number: 4692

Today's topics:
    Re: "Back button" in CGI script (Bart Lateur)
    Re: "Back button" in CGI script (I R A Aggie)
    Re: A really easy string question dhosek@webley.com
    Re: Calculate next [mon..sun]day <skilchen@swissonline.ch>
    Re: Can I manipulate Win apps using Perl? <ebohlman@netcom.com>
    Re: Can I manipulate Win apps using Perl? <gellyfish@btinternet.com>
    Re: CC via email (Was Re: "Back button" in CGI script) (John Moreno)
    Re: Don't grok closure behavior w/memory <tluedtke@visteon.com>
    Re: Don't grok closure behavior w/memory (Ilya Zakharevich)
        error handling <slava@volodchenko.freeserve.co.uk>
    Re: f (Martien Verbruggen)
    Re: How to get IP address of a local machine under NT KernelKlink@webtv.net
    Re: How to get IP address of a local machine under NT KernelKlink@webtv.net
    Re: I forgot (Martien Verbruggen)
        Is that possible in perl? <stupakov@slac.stanford.edu>
    Re: joining lines from file and sending to array (Tad McClellan)
    Re: Load sharing facility in Perl? (Gregory Snow)
        Open a serial port for reading (Arthur Newhall)
    Re: Open a serial port for reading (Martien Verbruggen)
    Re: Perl and MS/DOS KernelKlink@webtv.net
    Re: Perl Criticism (Tad McClellan)
    Re: Perl problem :(Offline mode... <andrewf@beausys.demon.co.uk>
    Re: protecting scripts KernelKlink@webtv.net
        Run your CGI Scripts for low cost <netaid@tamcotec.com>
    Re: Using PERL to access SQL <spam.me@idea.co.uk>
        which form of dbm to use? (Sam Curren)
        Winnipeg.pm meeting (Randy Kobes)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 19 Jan 1999 20:46:30 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: "Back button" in CGI script
Message-Id: <36a6ebdb.1768914@news.skynet.be>

Adrian Price wrote:

>>   2) Every browser already has that functionality.
>    True, but links are just plain more user-freindly.

No they're not. Every time you click such a link, you move *forward*,
not back.

	Bart.


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

Date: Tue, 19 Jan 1999 16:07:03 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: "Back button" in CGI script
Message-Id: <fl_aggie-1901991607030001@aggie.coaps.fsu.edu>

In article <adrian-1901990923360001@webgalaxy.com>,
adrian@sequoiarecords.com wrote:

+ In article <782bbq$4$1@client2.news.psi.net>, abigail@fnx.com wrote:

+ >   3) You can't do that.
+     Yes you can.

No, no, you can't. You can provide a facsimile of it, but you can't 
_really_ do it.

+ If you are going to try to answer a question, answer it
+ or just keep quiet. If you are going to answer anyway, and still just say
+ it can't be done, at least note that it can't be done AS FAR AS YOU KNOW.
+ Five little letters, AFAIK, will do the trick.
+ 
+ Just to enlighten, heres how:
+ <A HREF="javascript:document.history.back();">Go back</A>

Ok, I have javascript disabled, or am in a non-javascript browser. Now
what? It no longer works.

A facsimile. QED.

James


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

Date: Tue, 19 Jan 1999 20:56:42 GMT
From: dhosek@webley.com
Subject: Re: A really easy string question
Message-Id: <782ri3$kji$1@nnrp1.dejanews.com>

In article <1dlldrb.1fgbxauqasqrkN@bay1-541.quincy.ziplink.net>,
  rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
> <info@gadnet.com> wrote:

> > I want to become "a perl stud" as dhosek@webley.com
> > phrases it, and to use a regexp

> Being a "Perl stud" does not mean using a regexp.  Being a Perl stud
> means knowing when to use a regexp, and when to use a module.

> I've seen too many "Perl studs" use regular expressions when there are
> other ways to do it that are more efficient, more readable, and, in some
> cases, actually correct.

Just want to point out that (a) I said that to become a perl stud, one should
know their regexps, not use them blindly, and (b) for the simple case of
extracting everything after the last / to the end of the string, the regexp
solution that I provided is correct and efficient. If one is looking for more
sophisticated file parsing than perhaps a module is in order, but for a
simple parse like this, I doubt that a module is the most efficient way to do
the job. I'm open to being proved wrong.

-dh

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 19 Jan 1999 22:10:51 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Calculate next [mon..sun]day
Message-Id: <782sel$n6u4@news-sol.swissonline.ch>

marcel_anthonijsz@my-dejanews.com schrieb in Nachricht
<77vpeo$un8$1@nnrp1.dejanews.com>...
>Hi,
>
>I want to calculate the date of next [mon..sun]day, what is the
easiest and
>most nice way to do this? It should work after the year 0 .. (Hey, my
brain
>has a Y2K bug!).
>
maybe something like:

my %WeekDays = ('sun' => 1,
                'mon' => 2,
                'tue' => 3,
                'wed' => 4,
                'thu' => 5,
                'fri' => 6,
                'sat' => 7
               );

sub getTimeOfNextWeekday {
# input:  weekdayname
# output: timevalue of next (from today) weekdayname

  my $dayname = shift;

  my $oneday   = 86400;
  my $offset   = 0;

  my $wdaynext = $WeekDays{lc(substr($dayname,0,3))};
  my $time     = time();
  my $wdaycurr = (localtime($time))[6]+1;

  if ($wdaycurr < $wdaynext) {
     $offset = ($wdaynext - $wdaycurr) * $oneday;
  } else {
     $offset = (7-($wdaycurr - $wdaynext)) * $oneday;
  }
  return $time+$offset;
}

my $next = $ARGV[0];
print scalar(localtime(time())), "\n";
print scalar(localtime(getTimeOfNextWeekday($next))), "\n";

--
Samuel Kilchenmann
skilchen@swissonline.ch







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

Date: Tue, 19 Jan 1999 21:05:46 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Can I manipulate Win apps using Perl?
Message-Id: <ebohlmanF5trxn.Kqu@netcom.com>

mere_mortal@my-dejanews.com wrote:
: I am about to start the scripting journey...

: I have to implement a script that needs to manipulate Windows apps to make
: them output files. Can I use Perl to manipulate these apps? For example, can
: I launch WINFOO.EXE, make WINFOO save a document, then close WINFOO?

If they're OLE Automation servers, then you can use Win32::OLE to control 
them.



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

Date: 19 Jan 1999 22:42:22 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Can I manipulate Win apps using Perl?
Message-Id: <7831oe$18e$1@gellyfish.btinternet.com>

On Tue, 19 Jan 1999 18:15:09 GMT mere_mortal@my-dejanews.com wrote:
> I am about to start the scripting journey...
> 
> I have to implement a script that needs to manipulate Windows apps to make
> them output files. Can I use Perl to manipulate these apps? For example, can
> I launch WINFOO.EXE, make WINFOO save a document, then close WINFOO?
> 

You can do this if your target application supports OLE using the Win32::OLE
module.  This module is reasonably well documented I recall so it shouldnt
be too difficult to get a start.

> If Perl can't do this, is there another free scripting language (TCL, Python)
> that can?
> 

I couldnt possibly comment.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 19 Jan 1999 16:36:35 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: CC via email (Was Re: "Back button" in CGI script)
Message-Id: <1dlvz1e.19bjpzx1afd8u3N@roxboro0-035.dyn.interpath.net>

Larry Rosler <lr@hpl.hp.com> wrote:

> [Posted and a courtesy copy mailed.]
> 
> Mike Bristow <mike@fat.dotat.at> says...
> > On the vexed question of CCing followups via email.
> > 
> > On Tue, 19 Jan 1999 08:32:03 -0800, Larry Rosler <lr@hpl.hp.com> wrote:
> > >I agree.  Refusal to do so as a matter of policy is a fascistic response
> > >to a polite and reasonable request.  I often CC the response on my
> > >own, unless requested not to -- it gets to the questioner much faster, as
> > >a rule.
> > 
> > I, personally, find this irritating.  
> > 
> > Unless I notice that it's an email copy, I will often reply to the email
> > and then get a sense of deja vu when reading the newsgroup.
> 
> A decent newsreader puts in a notice automatically (see the first line
> above), and it's hard for the recipient to overlook.  I agree that 
> without such a notice, it is discourteous, and I resent it too.

Of course if the original poster had just included a Mail-Copies-To
header with his email address in it, 3 of the 5 direct responses would
have done this without his having to mention it in the body.

-- 
John Moreno


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

Date: Tue, 19 Jan 1999 15:57:12 -0500
From: Terry Luedtke <tluedtke@visteon.com>
To: Clinton Pierce <cpierce1@mail.ford.com>
Subject: Re: Don't grok closure behavior w/memory
Message-Id: <36A4F1A8.F3A80343@visteon.com>

Clinton Pierce wrote:
> 
> I'm about to do something that seems so....counter-intuitive, but
> apparently it does the right thing.  Here's a sample of code:
> 
>         #!/usr/bin/perl
> 
>         sub get_response {
> 
>                 my $rs=sub {
>                         print rand(100), "\n";   # or something...
>                 };
>                 return($rs);
>         }
> 
>         while (1) {
>                 my $subref;
> 
>                 $subref=&get_response;
>                 &$subref;
>         }
> 

Would it work something like this?


Start loop
  create $subref
  call get_response
    create $rs
    create sub #1
    return sub #1 (and assign to $subref)
    delete $rs
  return
 call $subref
 delete $subref (and sub #1 as well)
repeat loop
  create $subref
  call get_response
    create $rs
    create sub #2
    return sub #2 (and assign to $subref)
    delete $rs
  return
 call $subref
 delete $subref (and sub #2 as well)
repeat loop
 ...

Since the line

   my $subref

is inside the loop, it goes in and out of scope on each loop.  You can see
this if you run

   perl -e"while(1){my $s; $s++; print \"$s\n\";}"

which will print ones ad infinitum.  But even if $subref didn't drop out
of scope, memory would be reclaimed as soon as something else, like the
next sub, is assigned to $subref.  Perl knows that $subref is a pointer to
a sub (perl -e "my($s); $s = sub {return 1;}; print $s, \"\\n\";") so when
something else is assigned to $subref, the reference counter on the sub is
decremented.


Of course, I could be wrong.



--
---------------------------------------------------------------------------
Terry Luedtke                                     Information Systems
E-mail: tluedtke@visteon.com                      North Penn Electronics
                                                  Visteon Automotive 
---------------------------------------------------------------------------
"It's far too late, and things are far too bad, for pessimism."
  - Dee Hock, Founder, Visa International, on Y2K


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

Date: 19 Jan 1999 22:39:53 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Don't grok closure behavior w/memory
Message-Id: <7831jp$16e$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Clinton Pierce
<cpierce1@mail.ford.com>],
who wrote in article <36a9d284.354311913@news.ford.com>:
> I'm about to do something that seems so....counter-intuitive, but
> apparently it does the right thing.  Here's a sample of code:
> 
> 	#!/usr/bin/perl
>  
> 	sub get_response {
>  
> 	        my $rs=sub {
> 	                print rand(100), "\n";   # or something...
> 	        };
> 	        return($rs);
> 	}

You are returning a constant from get_response().

> 	while (1) {
> 		my $subref;
> 
> 	        $subref=&get_response;

$subref should stay the same.  No new nothing is created here.

> 	        &$subref;
> 	}
> 
> I plan on setting up get_response to return lots and lots of anonymous
> subs, and for some reason, in the back of my head, experience is
> whispering:  "This...leaks...memory..."

No more than 

   sub one { return 1 }

You are mixing anon-subs and closures.  Closures indeed create new
instances of a subroutine when sub {} is calculated.  Since your
anon-sub does not mention lexicals from enclosing blocks, it is not a
closure.

But even if it were a closure, you code would not leak any more than

    sub ref_one { return [ 1 ] }

Ilya


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

Date: Tue, 19 Jan 1999 21:03:51 -0000
From: "Vyacheslav Volodchenko" <slava@volodchenko.freeserve.co.uk>
Subject: error handling
Message-Id: <782ruo$vjp$1@news4.svr.pol.co.uk>

I am trying to convert postscript image file into gif format.

The programme for doing this is called "pstogif".  Problem is that
when running this programme, it produces output that I am not concerned
about and just want to redirect it to /dev/null.  It works
fine when I type command in linux command prompt.

The following script generates a run time error.
It says "sh: Bad number".

#!/usr/local/bin/perl

$ps_file = "picture.ps"; # postscript file
`pstogif $ps _file >& /dev/null`;


I think shell misinterprets redirection and considers it as a part of
the command.

Can anyone suggest me a way to run srcipt in the context of different
shell or a different way to avoid output from this program being printed on
the screen.

Thanks in advance.
Slava




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

Date: Tue, 19 Jan 1999 22:32:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: f
Message-Id: <NJ7p2.57$7g1.2777@nsw.nnrp.telstra.net>

[Next time you post, you should consider using a real subject line]

In article <782gn1$55$2@news.smart.net>,
	dsi@smart.net (Decision Systems Inc) writes:
> What is the best way to pass switches or parameters to my perl script from
> the command line?

You check the @ARGV array (# perldoc perlvar), or use one of the
Getopt:: modules (# perldoc Getopt::Std or # perldoc Getopt::Long)

In any but the most simple of cases, I'd choose one of the modules.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


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

Date: Tue, 19 Jan 1999 16:30:27 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: How to get IP address of a local machine under NT
Message-Id: <14993-36A4F973-1@newsd-101.iap.bryant.webtv.net>

At the command prompt you shpuld be able to type

ipconfig 


This should give you the IP address. It has been a while but I believe
the command is ipconfig. In Win95 it is winipcfg



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

Date: Tue, 19 Jan 1999 16:33:18 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: How to get IP address of a local machine under NT
Message-Id: <14989-36A4FA1E-27@newsd-101.iap.bryant.webtv.net>

To do it with Perl (check with an expert first) I think you would use
the "system" command.



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

Date: Tue, 19 Jan 1999 22:29:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: I forgot
Message-Id: <cH7p2.53$7g1.2777@nsw.nnrp.telstra.net>

In article <77vcv5$4p0$1@usenet46.supernews.com>,
	"Joe" <Joe@rhein.to> writes:
> Hi... I remember doing this once but I forgot how to get the values out of
> this baby (it is a variable that got printed and this was the result):
> 
> IO::Socket::INET=GLOB(0x8131790)

That looks like the string representation of a blessed reference. In
this case it looks like you are using the IO::Socket::INET module, or
maybe just the IO::Socket module, which returns some handle like that.
Who knows.

The way to get to whatever that reference represents is to use the
methods that were provided for that purpose, and which should be
described in the documentation:

# perldoc IO::Socket::INET

Alternatively, you can check the sources to see how the data is stored
internally. But I wouldn't do that, unless there is no way to get to
the 'data' and you really really need to do that. Data encapsulation
is done for a reason. Relying on the internal workings of a module,
instead of just its public interface is asking for trouble. The next
implementation of the same module may be a total rewrite, with a
totally different internal process, but with the same interface.
That's what part of OO programming is about.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.       | selective about its friends.
NSW, Australia                      | 


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

Date: Tue, 19 Jan 1999 13:19:05 -0800
From: Gennady Stupakov <stupakov@slac.stanford.edu>
Subject: Is that possible in perl?
Message-Id: <36A4F6C9.968A3775@slac.stanford.edu>

I run ActivePerl on Windows NT and I am wondering
if it's possible to start a windows
application from perl (say, Notepad of Netscape)
and have perl simulate keybord
events for this application. That is, instead of typing text
in Notepad window by myself,
I would like perl to "type" a string that would appear in Notepad
window.
It that possible,
that would allow automation of many interactions with windows
application.
Any hint will be appreciated,

Gennady.



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

Date: Tue, 19 Jan 1999 15:26:11 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: joining lines from file and sending to array
Message-Id: <j9t287.1ah.ln@magna.metronet.com>

Hampton Keathley (hamptonk@bible.org) wrote:

: I've read all my perl books on arrays and still can't figure this out...
: so I'm turning to the experts.

: I want to remove the "<BR>\n" at the end of each line that has <BR>'s
: and make one long line so that it looks like this:

: Then I want to send the entire file with the joined lines to an array so
: I can process it some more.

: After I do all my searches and replaces, then I'll split it into two
: arrays (body and footnotes) and do separate things to those arrays.

: Why doesn't this work?


   I don't know.


: while  (<INFILE>){
: 	$line = $_;

: 	while ($line =~ /\<BR\>\n/){		#this section just puts me in
: 		$line =~ s/\<BR\>\n/<lb>/;	#an endless loop
: 		$newline = <INFILE>;		#and I don't know why
: 		$line = $line.$newline;


   I cannot get an infinite loop out of it.

   Of course, I only have the 3 lines of sample data that you gave.

   There is some danger there where you read from INFILE but
   don't check to see if you are at the end of the file.


   Does this do what you want?

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

my $line;
my @array1;

while  (<DATA>){
   if ( s/<BR>\n/<lb>/ )
        { $line .= $_ }
   else {
      $line .= $_;
      push @array1, $line;
      $line = '';
   }
}

foreach (@array1)
   { print }


__DATA__
<div2 type=title><head>Here's the text<BR>
here's some more text<BR>
and some more text.
<div2 type=title><head>Here's the text<BR>
here's some more text<BR>
and some more text.
----------------


You should use '-w' and 'use strict' on all of your Perl programs.


: #now split @array1 into @body and @footnotes arrays
: #Yogish and Tad gave me this and it works with while (<>) but not an
: array
: #should I use "for (@array1){  "? I tried but it only put the body text
: in @body
: #but put the whole file in @notes

: for (@array1) {
:       last if /<P><A NAME="P/;  
:       push @body, $;
                    ^^

   You should cut/paste code when posting rather that trying to
   type it in.

   Else you will get help fixing typos that do not appear in your code.


:    }

:    push @notes, $_;
:    for (@array1) {


   The problem here is that all of the "body" stuff is still
   at the beginning of @array1.


:       push @notes, $_;
:    }


   This should split them up:

while ( $_ = shift @array1 ) {
   last if /<P><A NAME="P/;
   push @body, $_;
}

@notes = ($_, @array1);  # only notes parts are left in the array


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 19 Jan 1999 20:31:41 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: Load sharing facility in Perl?
Message-Id: <782q3d$18es$1@nntp6.u.washington.edu>

In article <77vvil$4k2$1@nnrp1.dejanews.com>,  <gjoshi@my-dejanews.com> wrote:
>
>
>Hi,
>
>I was wondering if there is a load sharing facility inside perl.
>
>In my script I need to run the 'same' command on 50-60 'different' files.
>Currently I have implemented this using the 'system' command in a 'for loop'.
>
>Is there a way to logon to different machines and run the command on
>different machines in parallel? (I would need to make sure that all the
>runs source the same environment, therby using the same binaries.)
>
>Please let me know.
>
>thanks,
>Girish.
>

Below is a basic example that I wrote awhile ago to show to myself
(and a friend who had found a much more complicated way) that I could
do it.  It worked, but for anything more than an example you should
probably add/fix some things.  It uses the Comm.pl library available
on CPAN and runs on a unix cluster.

hope this helps



#!/usr/local/bin/perl -w

# This is a basic example script to distribute several tasks between
# different computers

use lib 'where/to/find/Comm.pl';

require 'Comm.pl';

Comm::init();

@hosts = qw(gorn sol);  # the list of computers to use.

@tasks = ('nice R --no-save <r1.in >r1.out',
          'nice R --no-save <r2.in >r2.out',
          'nice R --no-save <r3.in >r3.out',
          'nice R --no-save <r4.in >r4.out',
          'nice R --no-save <r5.in >r5.out'
         );  # the tasks to run, R is a free statistics package.

$remaining = @tasks;  # number of tasks not finished (array in scalar context);

for $host ( @hosts ) {
  $procs{$host}= open_proc("rsh $host"); 
  delete $procs{$host} unless $procs{$host}; #remove key if failed
    # it would probably also be good to check how busy the host is
    # and delete it from the list if too busy.
}

die("no hosts available\n") unless %procs; # %procs is only false if empty

for $host ( keys %procs ) { #run first task for each
  $task = shift @tasks;
  $handle=$procs{$host};
  print $handle "cd perl/temp\n";  # change to right dir.
  print $handle $task,"\necho done\n"; #  so we have something to check for.
  print "starting $task on $host\n";
}

while (1) {  # do until a last breaks us out.
  for $host ( keys %procs ) {  # cycle through hosts checking which are done.
                      # there might be a better way to do this using select_it
    $match = expect($procs{$host}, 1, "\n\s*done");
    if ($match) {
      $remaining--;;
      print "$host finished, $remaining jobs remain\n";
      if (@tasks) {
        $task = shift @tasks;
        $handle = $procs{$host};
        print $handle $task,"\necho done\n";
        print "starting $task on $host\n";
      } else {
        $handle = $procs{$host};
        print $handle "lo\n";
        close_it( $procs{$host} );
        delete( $procs{$host} );
      }
    }
  }

  last unless $remaining;

}


-- 
-------------------------------------------------------------------------------
     Gregory L. Snow         |   The trouble with doing something right the
     (Greg)                  | first time is that nobody appreciates how
snow@biostat.washington.edu  | difficult it was.


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

Date: 19 Jan 1999 21:45:27 GMT
From: anewhall@whoi.edu (Arthur Newhall)
Subject: Open a serial port for reading
Message-Id: <782udn$lue1@dilbert.whoi.edu>


Hi,

   This problem probably has been answered here or is in an FAQ
somewhere, but I can't seem to find it.  I am trying to open a
serial port using perl on a linux box for reading and then writing
to a file. I have been unsuccessful so file far and need some help.

If someone could please point me to a good URL, FAQ, news archive 
or send me a solution, it would be greatly appreciated.


Thanks,
Arthur


-- 
Arthur Newhall,  Research Specialist        email: anewhall@whoi.edu
Applied Ocean Physics & Engineering Dept.   office: (508) 289-3317  
Woods Hole Oceanographic Institution        fax: (508) 457-2194     
Woods Hole, MA  02543        		    http://www.oal.whoi.edu                                      


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

Date: Tue, 19 Jan 1999 22:34:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Open a serial port for reading
Message-Id: <SL7p2.59$7g1.2777@nsw.nnrp.telstra.net>

In article <782udn$lue1@dilbert.whoi.edu>,
	anewhall@whoi.edu (Arthur Newhall) writes:

>    This problem probably has been answered here or is in an FAQ
> somewhere, but I can't seem to find it.  I am trying to open a
> serial port using perl on a linux box for reading and then writing
> to a file. I have been unsuccessful so file far and need some help.

The perldoc program is your friend. Recent versions of it have the -q
option, which will search for a RE in the FAQ.

# perldoc -q serial
=head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod

=head2 How do I read and write the serial port?
[snip of lengthy explanations]

In other words: The answer is in part 8 of the perl FAQ.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Tue, 19 Jan 1999 16:09:58 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: Perl and MS/DOS
Message-Id: <14989-36A4F4A6-23@newsd-101.iap.bryant.webtv.net>

If you don't mind another Perl book. "Discover Perl 5" has a CD included
that has Perl v5.x which installs easily, and runs at the C: prompt.



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

Date: Tue, 19 Jan 1999 15:31:58 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Criticism
Message-Id: <ekt287.1ah.ln@magna.metronet.com>

Staffan Liljas (staffan@ngb.se) wrote:
: topmind@technologist.com wrote:

: > ththththaaaattzzit  = thththfileoppzen(<ffffilehandle>,"name.ththat")
    ^^^^^^^^^^^^^^^^^^

: Interesting. This is the first piece of perl code we see from topmind.
: I'm not surprised he's mad at perl. WHY DOESN'T THIS WORK???


   perl says:

      "Can't modify constant item in scalar assignment at..."


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 19 Jan 1999 21:46:50 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: Perl problem :(Offline mode...
Message-Id: <YJEpnBAK1Pp2Ew75@beausys.demon.co.uk>

In article <782l5r$11f$1@gellyfish.btinternet.com>, Jonathan Stowe
<gellyfish@btinternet.com> writes
>On Tue, 19 Jan 1999 12:19:45 +0000 Andrew Fry wrote:
>> (offline mode : please give name=value pairs via STDIN)
>> (... or something like that) and then waiting for some
>> reply.
>> Why is it doing this ? And what is offline mode ?
>> 
>
>You are using CGI.pm

Doh! You're right. I converted my non-CGI program so that it could
run in non-CGI or CGI mode, tested as CGI and then returned to
testing as non-CGI ... which is when I came across the problem.
I guess the "name=value pairs" should have given me a clue.
Just inexperience!
Anyway, thanks guys!

---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

Date: Tue, 19 Jan 1999 16:22:48 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: protecting scripts
Message-Id: <14989-36A4F7A8-25@newsd-101.iap.bryant.webtv.net>

Don't know if this is what you had in mind but you could put your
scripts in a password protected directory on your website and let people
test drive the scripts via HTML pages on your site; a guestbook form for
example. They could see the results and decide if they want to buy the
right to use the source.

I'm not sure that you can compile Perl, but even if you can, I wouldn't
be surprised if there are tools that can decompile to source. Seems the
best way to do it might be to keep the source secret until you get paid
and then decorate the source with copyright information.



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

Date: Tue, 19 Jan 1999 16:44:48 -0500
From: "Network Conexion Inc." <netaid@tamcotec.com>
Subject: Run your CGI Scripts for low cost
Message-Id: <36a4fcfd.0@diana.idirect.com>

This is a multi-part message in MIME format.

------=_NextPart_000_0054_01BE43CB.06DD6FB0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Run your Visual Basic, Perl, Phynton etc. I'm looking for a partner to =
help me afford this web server. Please if interested send me a line.

Looking for someone in the Toronto area, (416, 905). This is a small =
server and would be use for web development mainly.

I'm not asking for big capital, and I'm willing to negotiate with =
someone who is really interested.

Jorge Torres=20

------=_NextPart_000_0054_01BE43CB.06DD6FB0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY>
<DIV>Run your Visual Basic, Perl, Phynton etc. I'm looking for a partner =
to help=20
me afford this web server. Please if interested send me a line.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Looking for someone in the Toronto area, (416, 905). This is a =
small server=20
and would be use for web development mainly.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I'm not asking for big capital, and I'm willing to negotiate with =
someone=20
who is really interested.</DIV>
<DIV>&nbsp;</DIV>
<DIV><A href=3D"mailto:torresj@tamcotec.com">Jorge=20
Torres&nbsp;</A></DIV></BODY></HTML>

------=_NextPart_000_0054_01BE43CB.06DD6FB0--



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

Date: Tue, 19 Jan 1999 21:09:21 +0000
From: Kiril <spam.me@idea.co.uk>
Subject: Re: Using PERL to access SQL
Message-Id: <36A4F481.81BC9683@idea.co.uk>

(sorry for the OT stuff, btw)

Abigail wrote:
> 
> Stewart Eastham (sme@planetpod.com) wrote on MCMLXVII September MCMXCIII
> in <URL:news:36A3D19D.E8F5F782@planetpod.com>:

<chop problem descr>

> 
> *boggle* mySQL doesn't know the concept of "identify" columns?
> 
> !! 7.  The record from the text file (along with its newly created

<chop more stuff>

I was always beaten on the head with a big brick when I suggested
ideantity fields (sybase here)...

Michael Peppler, what says you ?


Kiril


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

Date: Tue, 19 Jan 1999 13:20:12 -0800
From: samc@empirewest.com (Sam Curren)
Subject: which form of dbm to use?
Message-Id: <MPG.110e40f47425efb29896ce@news.sonic.net>

I'm converting a script that uses dbmopen to use the tie function. The 
tied hash interface is perfect for the simple database I'm using, and I'm 
interested in speed, not necessarily diskspace or features. I'd like 
something solid (and ftpable), but I'm assuming most are.

What method (DB_File, GDBM, etc.) does dbmopen use?

Which is the best to use in my case?

Thanks

-Sam Curren
Empire West Plastics


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

Date: 19 Jan 1999 22:14:59 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Winnipeg.pm meeting
Message-Id: <slrn7aa1h9.5nh.randy@theory.uwinnipeg.ca>


Hi,
   The next meeting of the Winnipeg Perl Monger's group
will be this Thursday, Jan 21, at 8:30 PM at Applebee's
bar near the University of Manitoba. Anybody in the Winnipeg
area with an interest in Perl, at any level, are welcome
to come. Please get in touch with me if you have any
questions.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4692
**************************************

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