[7884] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1509 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 19 13:08:08 1997

Date: Fri, 19 Dec 97 10:00:22 -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           Fri, 19 Dec 1997     Volume: 8 Number: 1509

Today's topics:
     Favorite features (was: Re: Happy birthday Perl!) <rootbeer@teleport.com>
     Re: Fun with arrays (Honza Pazdziora)
     Re: Fun with arrays <rootbeer@teleport.com>
     Re: Fun with arrays (brian d foy)
     Re: getting correct web server headers <bugaj@bell-labs.com>
     Re: Happy Birthday Perl ? (brian d foy)
     Re: Happy Birthday Perl ? <#@qz.to>
     Re: Happy birthday Perl! (Bart Lateur)
     Re: HELP!  Bitwise XOR (^) doesn't work on strings? <rootbeer@teleport.com>
     Re: HELP! Bitwise XOR (^) doesn't work on strings? (Brian Wheeler)
     Re: HELP! Bitwise XOR (^) doesn't work on strings? <rootbeer@teleport.com>
     hey guyz! plz help me out! <luckycom@ica.net>
     Inheritance question (Kenneth Lee)
     Perl for windows 3.1 sserebry@tuc.com
     Re: Perl for windows 3.1 (brian d foy)
     Problem with perl client using sockets (Mike Artobello)
     Re: Problem with socket upon HTTP (brian d foy)
     Single key input on NT4.0 with ActiveWare Perl <johnw@usmh.usmd.edu>
     Re: Teaching programing (Mark)
     Re: unshift, @INC, require??? (Bart Lateur)
     Re: unshift, @INC, require??? (Mark)
     Re: Web Architects Needed (brian d foy)
     Re: Whats wrong with this simple code? <dballing@speedchoice.com>
     Re: Whats wrong with this simple code? <ajohnson@gpu.srv.ualberta.ca>
     Re: Whats wrong with this simple code? (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Dec 1997 08:10:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: eglamkowski@angelfire.com
Subject: Favorite features (was: Re: Happy birthday Perl!)
Message-Id: <Pine.GSO.3.96.971219080904.23972Z-100000@user2.teleport.com>

On Fri, 19 Dec 1997, the count wrote:

> So, what's everybody's favorite feature of perl?

Dataflow analysis, also known as taint checking. AFAIK, this is unique to
Perl - unlike every other Perl feature, perhaps?

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 16:01:41 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Fun with arrays
Message-Id: <adelton.882547301@aisa.fi.muni.cz>

erik@earthlink.net (Erik Y. Adams) writes:

[...]

> So, I've got two ways to get what I want, but I keep thinking that there's
> some clever combination of $#@()[]{} to get what I want:  the number of
> elements in the array.

my $num = $#{[$q->param('p')]};

will force to call $q->param() in list context, create annonymous
array of its result, then dereference that array and return index of
last element.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Fri, 19 Dec 1997 08:25:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Erik Y. Adams" <erik@earthlink.net>
Subject: Re: Fun with arrays
Message-Id: <Pine.GSO.3.96.971219081235.23972b-100000@user2.teleport.com>

On Fri, 19 Dec 1997, Erik Y. Adams wrote:

> how can I get the number of elements in the array
> returned by param()?

>    use CGI;
>    $q = new CGI;
> 
>    @num = $q->param('p'); # @num now contains all values for 'p' from form
>    $num = $#num; # $num now equals the number of elements in the array

No! No! No! It does _not_. I shout it from the rooftops: Not the right
answer. Triple plus ungood. Negatory, good buddy. That's a negative. No
way, Jose. Read my lips: Off by one error. Don't have a cow, man. Never
had it, never will. Not on my watch. No shirt, no shoes, no service. Void
where prohibited by law. Read directions for best results. Do not stand on
or above this array index.

That statement sets $num to one _smaller_ than the number of elements in
@num. If you want the number of elements in @num, you may use this,
although TMTOWTDI.

    $num = @num;	# Get number of elements in @num

>    $num = $#q->param('p'); # DOESN'T WORK
>    $num = $#($q->param('p')); # DOESN'T WORK

How about this?

    $num = @{[ $q->param('p') ]};	# Get the real number of elements.

Of course, if you're going to need the actual list, which you almost
certainly will, you should probably store that into an array rather than
calling param twice. 

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 11:40:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Fun with arrays
Message-Id: <comdog-ya02408000R1912971140130001@news.panix.com>
Keywords: from just another new york perl hacker

In article <erik-1912970735410001@pool015-max28.mpop2-ca-us.dialup.earthlink.net>, erik@earthlink.net (Erik Y. Adams) wrote:

>I've hit on a question:  how can I get the number of elements in the array
>returned by param()?

>   @num = $q->param('p'); # @num now contains all values for 'p' from form
>   $num = $#num; # $num now equals the number of elements in the array

close.  $num now has one less than the number of elements is array
since the $#num construct returns the index of the last array
element and array indices start at 0.

you could

   $num = $#num + 1;

or

   $num = scalar @num;

or other ways.

good luck ;)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Dec 1997 11:56:50 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: Re: getting correct web server headers
Message-Id: <349AA752.167E@bell-labs.com>

> but while you are at it, perhaps you should do you own IP packets as
> well.  telnet is just a crutch. :)
> 
I prefer to build my own atoms and electrons proceed from there.
People who use pre-existing matter and energy are wusses.

Maybe someone should write the Assembler.pm module so all the "real
programmers" can just make ASM calls from PERL and skip all these
useless levels of abstraction... 

;->


LL+P,
Stephan


-- 
  
                    "Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj                      bugaj@bell-labs.com
Member of Technical Staff                        (908) 949-3875
Multimedia Communication Research Dept.     Rm. 4F-601, Holmdel
Bell Labs of Lucent Technologies   www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website:     http://www.cthulhu-dynamics.com/stephan  
---------------------------------------------------------------
    STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
           "Do submarines swim?" - E.W. Dijkstra


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

Date: Fri, 19 Dec 1997 11:23:07 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Happy Birthday Perl ?
Message-Id: <comdog-ya02408000R1912971123070001@news.panix.com>
Keywords: from just another new york perl hacker

In article <67bs98$1nh@walras.econ.de>, Oliver Much <uzs7ci@ibm.rhrz.uni-bonn.de> wrote:

>Is it true that Perl celebrated its 10th anniversary on 12/18/97 ?

a lot more than Perl celebrated on that even.  maybe Randal can 
convince Larry to make an .au file out of the message we left
on his answering machine :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 19 Dec 1997 17:03:30 GMT
From: Eli the Bearded <#@qz.to>
Subject: Re: Happy Birthday Perl ?
Message-Id: <eli$9712191159@qz.little-neck.ny.us>
Keywords: from just another new york perl hacker

brian d foy <comdog@computerdog.com> wrote:
> Oliver Much <uzs7ci@ibm.rhrz.uni-bonn.de> wrote:
> >Is it true that Perl celebrated its 10th anniversary on 12/18/97 ?
> a lot more than Perl celebrated on that even.  maybe Randal can 
> convince Larry to make an .au file out of the message we left
> on his answering machine :)

What are you going to do with your photos of the recital?

Elijah
------
was slightly disappointed Larry was not home


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

Date: Fri, 19 Dec 1997 16:06:04 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Happy birthday Perl!
Message-Id: <34a19b55.4081257@news.tornado.be>

Since Perl appears to be 10 years old, and Randal used to say "Stop
using five year old software!" about Perl 4, well versions 1 to 3 may
not have lasted more than 4-5 years, together. I'm curious how long Perl
5 will last.

the count <eglamkowski@usa.net> wrote:

>So, what's everybody's favorite feature of perl?

In two words: regular expressions and hashes. No, that's four.

	Bart.


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

Date: Fri, 19 Dec 1997 08:08:37 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Wheeler <bdwheele@indiana.edu>
Subject: Re: HELP!  Bitwise XOR (^) doesn't work on strings?
Message-Id: <Pine.GSO.3.96.971219080532.23972Y-100000@user2.teleport.com>

On 19 Dec 1997, Brian Wheeler wrote:

> Subject: HELP!  Bitwise XOR (^) doesn't work on strings?
> 
> It doesn't seem to work as advertised.  consider this script: 
> 
> $a="0";
> $b="1";
> print $a&$b,",",$a|$b,",",$a^$b,"\n";
> 
> it outputs:
> 0,1,
> 
> Shouldn't it output 0,1,1?  

No, you're doing bitstring operations. It should (and does) output
"0,1,\001\n";

Here's a bit of text I recently added to the Perl docs:

If you are intending to manipulate bitstrings, you should be certain that
you're supplying bitstrings: If an operand is a number, that will imply
a numeric bitwise operation. You may explicitly show which type of
operation you intend by using "" or 0+, as in the examples below.

    $foo =  150  |  105 ;      # yields 255  (0x96 | 0x69 is 0xFF)
    $foo = '150' |  105 ;      # yields 255
    $foo =  150  | '105';      # yields 255
    $foo = '150' | '105';      # yields string '155' (under ASCII)

    $baz = 0+$foo & 0+$bar;    # both ops explicitly numeric
    $biz = "$foo" ^ "$bar";    # both ops explicitly stringy

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 19 Dec 1997 16:04:59 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Re: HELP! Bitwise XOR (^) doesn't work on strings?
Message-Id: <67e5vb$b6s$1@dismay.ucs.indiana.edu>

In article <adelton.882545891@aisa.fi.muni.cz>,
	adelton@fi.muni.cz (Honza Pazdziora) writes:
> bdwheele@indiana.edu (Brian Wheeler) writes:
> 
>> It doesn't seem to work as advertised.
>> consider this script:
>> 
>> $a="0";
>> $b="1";
>> print $a&$b,",",$a|$b,",",$a^$b,"\n";
>> 
>> it outputs:
>> 0,1,
>> 
>> Shouldn't it output 0,1,1?  I need this for a project I'm working on, and the
>> Camel 2 says it should work....
> 
> It works, only you do not know it ;-) Perlop man page says
> 
> 	Binary "^" returns its operators XORed together bit by bit.
> 
> Hmmm. What are the bits in string "0"? And bits in "1"? Try to run the
> output of your script via od -c to see what's going on.

	whoa.  That's really odd.  Its partially a misunderstanding on my part,
and partially a inconsistancy between perl4 and perl5.

Perl4 prints "1" for "0"^"1" 
perl5 prints chr(1) for "0"^"1".  I wonder why?

In any case, I was thrown off by "0"&"1" and "0"|"1" which are doing what I
want...but for a different reason.

Thanks!
Brian

> 
> Hope this helps,
> 
> --
> ------------------------------------------------------------------------
>  Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
>                    I can take or leave it if I please
> ------------------------------------------------------------------------


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

Date: Fri, 19 Dec 1997 08:39:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Wheeler <bdwheele@indiana.edu>
Subject: Re: HELP! Bitwise XOR (^) doesn't work on strings?
Message-Id: <Pine.GSO.3.96.971219083816.23972e-100000@user2.teleport.com>

On 19 Dec 1997, Brian Wheeler wrote:

> Perl4 prints "1" for "0"^"1" 
> perl5 prints chr(1) for "0"^"1".  I wonder why?

Because in Perl4 you had to use vec() somewhere in your script to enable
bitwise string ops. That restriction was removed with Perl5. Hope this
helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 12:18:40 -0800
From: Alex Kovalenko <luckycom@ica.net>
Subject: hey guyz! plz help me out!
Message-Id: <349AD6A0.26A9FB7@ica.net>

hey there programmerz...
i am recently in perl, so i am have some faq ques...
1) i need to make up a cgi script which will do the following:
I have several forms on my Web Page like : name, password, ID, and
etc...
then i need that perl script take all of those and put it in the form
like :
Alex Kovalenko
security
1234567890
and etc.

then i need that this script SEND ALL OF THIS to e-mail and also ADD all
this information to file called for example users.dat ...

if ya can help me out , than plz HELP ME PLZ!

any ideas would be VERY appreciated!

with best wishes,
Alex.





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

Date: Fri, 19 Dec 1997 16:53:07 GMT
From: %%Kenneth_Lee%%@pcmailgw.ml.com (Kenneth Lee)
Subject: Inheritance question
Message-Id: <349aa275.8571384@199.201.57.131>

Well, this is my first post to this newsgroup.  I've been given the task of
quickly learning perl in order to take over the web site that was left over
by the previous developer (who left the department).  Anyway, while looking
at some of his perl programs, I realized three things: 

a) a lot of code and subroutines are being repeated over and over in many
of the programs

b) the code is an eyesore and there must be a better way to 'wrap' some of
functionality.

c) he wasn't usign CGI.pm, or any libraries for that matter.

So I attempted to create a new object called SecurePage.pm which would
provide some common methods and traits to descendant objects.
Unfortunately, I'm having a bit of trouble with the syntax.  I've read the
glazed over a few of the Perl manuals we have here, but they tend to skim
over the object-oriented aspect of Perl.  I've looked at some of the
tutorials on www.perl.com (which was vastly more helpful), but I still
can't seem to get this to work.

The header for SecurePage.pm looks like:

package Secure_Page;
use CGI;
use Sybase::CTlib;
use Exporter;
use strict;
require 'Web_Profile.pl';

@ISA::Secure_Page = qw(CGI CTlib Exporter);



The new looks like:

sub new {
        my $type = shift;
        my $this = new CGI;
        bless ($this, $type);
        return $this;
}

It seems to compile well enough, except that when I attempt something like
this:

$q = new SecurePage;
$q->param(-Name=>'foo', -Value=>'bar');

I end up with the runtime error: 
	Can't locate object method "param" via package "SecurePage" at 
	SecurePage.pm line.....

Am I not performing the inheritance correctly?  Shouldn't CGI's methods
become inherited by SecurePage?  If so, why can't I access them in the
expected manner?

-Ken
(Please remove %% from my email for private replies)



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

Date: Fri, 19 Dec 1997 10:51:37 -0600
From: sserebry@tuc.com
Subject: Perl for windows 3.1
Message-Id: <882549663.319881226@dejanews.com>

Is there PERL for windows 3.1 ?

Please respond directly to my email address at sserebry@tuc.com

Thank you for any help.

Sergey

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 19 Dec 1997 12:29:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl for windows 3.1
Message-Id: <comdog-ya02408000R1912971229530001@news.panix.com>
Keywords: from just another new york perl hacker

In article <882549663.319881226@dejanews.com>, sserebry@tuc.com wrote:

>Is there PERL for windows 3.1 ?

maybe.  

   * did you check <URL:http://www.perl.com>? 

   * did you search "windows perl" in Yahoo, for instance?

>Please respond directly to my email address at sserebry@tuc.com

feel free to join the community :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 19 Dec 1997 09:26:56 -0800
From: marto@ccnet.com (Mike Artobello)
Subject: Problem with perl client using sockets
Message-Id: <67eap0$r0p$1@ccnet3.ccnet.com>

I'm helping a friend debug his perl script, which uses sockets to post 
data to a URL (i.e. submit a form) and retrieve the result. According to 
his ISP, the script was spawning multiple child processess which became 
zombies. I looked at his code but saw no forks, so I'm not sure where the 
child processes are coming from. 

Below is a copy of the subroutine that sumbits the URL, can anyone tell 
me why this would spawn a child?

sub connect {
sleep(2);
$errfnd='N';
($name, $aliases, $prto)=getprotobyname('tcp');
if (length($name)>0) {
   ($name, $aliases, $port, $prto)=getservbyname($port, 'tcp') unless $port=~/^\d+$/;
   if (length($name)>0) {
      ($name, $aliases, $stype, $len, $thisaddr)=gethostbyname($hostname);
      if (length($thisaddr)>0) {
         ($name, $aliases, $stype, $len, $thataddr)=gethostbyname(@them[$i]);
         if (length($thataddr)>0) {
            } else {
               @fail[$a]="@linkurl[$i] Remote Failed";
               $a++;
               if ($subtype eq "GET") {$subtype="POST";}
               return;
            }
         } else {
            @fail[$a]="@linkurl[$i] Local Failed";
            $a++;
            if ($subtype eq "GET") {$subtype="POST";}
            return;
         }
      } else {
         @fail[$a]="@linkurl[$i] Server Failed";
         $a++;
         if ($subtype eq "GET") {$subtype="POST";}
         return;
      }
   } else {
      @fail[$a]="@linkurl[$i] Protocol Failed";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
}

$this=pack($sockaddr, &AF_INET, 0, $thisaddr);
$that=pack($sockaddr, &AF_INET, $port, $thataddr);

#Tie file pointer to a socket
if (! socket(S, &PF_INET, &SOCK_STREAM, $prto) == 0) {
      #Attach socket to a local address
      if (! bind(S, $this) == 0) {
         #Attach socket to a remote address
         if (! connect(S, $that) == 0) {
            #Set socket to be command buffered
            select(S); $| = 1;
            select(STDOUT);
         } else {
            @fail[$a]="@linkurl[$i] Connect Failed";
            $a++;
            if ($subtype eq "GET") {$subtype="POST";} 
            return;
         }
      } else {
         @fail[$a]="@linkurl[$i] Bind Failed";
                $a++;
         if ($subtype eq "GET") {$subtype="POST";}
         return;
      }
   } else {
      @fail[$a]="@linkurl[$i] Socket Failed";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
}

@arrin="";
if ($subtype eq 'HEAD') {
      print S "HEAD ",@path[$i]," HTTP/1.0\n\n";
      print S $formdata;
   } elsif ($subtype eq 'GET') {
      print S "GET ",@path[$i]," HTTP/1.0\n";
      print S "Content-Type: application/x-www-form-urlencoded\n";
      print S "Content-Length: ",length($formdata)."\n\n";
      print S $formdata;
   } else {
      print S "POST ",@path[$i]," HTTP/1.0\n";
      print S "Content-Type: application/x-www-form-urlencoded\n";
      print S "Content-Length: ",length($formdata)."\n\n";
      print S $formdata;
   }

    sleep 1;

$h=0;
do  {
       $h++;
       if ($h > 15000) { 
          @fail[$a]="@linkurl[$i] No Response/Data";
          $a++;
          return;
       }
 }  until (@arrin=<S>);


#@arrin=<S>;
      $string = join(' ',@arrin);
      $string =~ s/\n//g;

   if ($string =~ /not found/i) {
      @fail[$a]="@linkurl[$i] File Not Found";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /no url/i) {
      @fail[$a]="@linkurl[$i] URL Blank";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /no title/i) {
      @fail[$a]="@linkurl[$i] Title Blank";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /Repeat URL/i) {
      @succeed[$b]="@linkurl[$i] Repeat URL";
      $b++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /permission/i) {
      @fail[$a]="@linkurl[$i] Permission Denied";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /server error/i) {
      @fail[$a]="@linkurl[$i] Bad Script";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   if ($string =~ /timeout/i) {
      @fail[$a]="@linkurl[$i] Timed Out";
      $a++;
      if ($subtype eq "GET") {$subtype="POST";}
      return;
   }

   @succeed[$b]=@linkurl[$i];
   $total++;
   $b++;
   if ($subtype eq "GET") {$subtype="POST";}
   return;
}
 
-- 
Regards,

Mike
____________________________ 
Mike Artobello (Concord, CA) 
 
email: marto@ccnet.com               
WWW:   http://www.ccnet.com/~marto


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

Date: Fri, 19 Dec 1997 11:50:54 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Problem with socket upon HTTP
Message-Id: <comdog-ya02408000R1912971150540001@news.panix.com>
Keywords: from just another new york perl hacker

In article <349A59B6.2EDF@asi.fr>, mdgoutte@asi.fr wrote:

>I've written a PERL script to test TCP sockets upon HTTP protocol. This
>script builds a socket with a HTTP daemon, sends a request and display
>the answer. It works with every host I've tested except one :
>www.yslaire.be.

are you sure it works with every host.?  checking for warnings by
invoking perl as 

   #!/usr/bin/perl -w

will tell you about some problems.  

>Here is my script, can anyone help me ? 

Perl helps those who help themselves.  good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Dec 1997 09:35:47 -0500
From: John Gordon White <johnw@usmh.usmd.edu>
Subject: Single key input on NT4.0 with ActiveWare Perl
Message-Id: <349A8643.2AB79C3D@usmh.usmd.edu>

I'm hoping this will be a simple question -- for someone else ...

How can I do single key input from the keyboard?  

I'm not sure yet if I need for this to be a read with wait or without. 
It would be best if I can choose.  The application will be similar to a
hex editor. 

I'm using ActiveWare's Perl for Win32 Build 312 (compliant to Perl
V5.003_07), on an NT 4.0 workstation.  It's excellent.  It doesn't have
fcntl(), but buried down in the libraries there is a Fcntl module which
calls the Fcntl.pll dynamic load library.  Other than comments in the
module, there's no documentation.

Thanks!

p.s. This is a re-send ... somehow I managed to plug my work e-mail
address into my Identity setting, and it appeared in the previous
message.  So, I'm cancelling that message before too many spammers see
it.  Sorry for the inconvenience!


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

Date: 19 Dec 1997 16:02:30 GMT
From: gt2863a@acmez.gatech.edu (Mark)
Subject: Re: Teaching programing
Message-Id: <67e5qm$slc@catapult.gatech.edu>


As a student of computer science I would
have to say that the language is an important choice but not as 
important as HOW you teach it to them.

Here at Georgia Tech the first cs class is not taught in a specific
"language" it is taught in a psuedo language this allows the students
to make small mistakes in syntax without hurting them. The work is 
turned in and graded for it's content and if it is a sound algorithm
then it is considered correct. Syntax mistakes are pointed out and small
points are lost but the point is a student is not sitting staring at
a screen with a good algorithm but a semi-colon in the wrong place.

The psuedo-language used to resemble pascal however now it has changed
to Java. The class after this is where the students actually have to
implement code(Java). After learning concepts the implementation becomes
much easier. The complexity of the programs these relatively novice 
programers are able to implement is very high. In addition they have
a rock solid understanding of all the fundemental programming concepts. 

-variable passing
-recusion
-objects, classes, inheritance
-dynamic and static data structures
-big O and alogrithm analysis
-GUIs
-concurrency and control of multiple processes

Anyway, I find this to be an extremely good way to learn. Concepts 
first and then Syntax. 

It of course has a lot to do with how much time you have and what not
but I hope this is helpful

mark



--
mec --gt2863a
 


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

Date: Fri, 19 Dec 1997 16:11:42 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: unshift, @INC, require???
Message-Id: <349f9990.3628345@news.tornado.be>

gt2863a@acmez.gatech.edu (Mark) wrote:

>No this still does not work, this is exactly what I have
>in the directory L:\scripts\mec\calendar\test.pl

>BEGIN {
>   unshift (@INC, 'L:\scripts\mec\subs');

Aha! Backslashes! (it must be a PC). Double them. You need to, even
between single quotes (that is because \' is still recognized).

HTH,
Bart.


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

Date: 19 Dec 1997 16:45:42 GMT
From: gt2863a@acmez.gatech.edu (Mark)
Subject: Re: unshift, @INC, require???
Message-Id: <67e8bm$t5d@catapult.gatech.edu>

: >No this still does not work, this is exactly what I have
: >in the directory L:\scripts\mec\calendar\test.pl

: >BEGIN {
: >   unshift (@INC, 'L:\scripts\mec\subs');

: Aha! Backslashes! (it must be a PC). Double them. You need to, even
: between single quotes (that is because \' is still recognized).

No afraid that doesn't work either, man I am getting really pissed
I can not get this to work.

--
mec --gt2863a
 


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

Date: Fri, 19 Dec 1997 11:28:26 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Web Architects Needed
Message-Id: <comdog-ya02408000R1912971128260001@news.panix.com>
Keywords: from just another new york perl hacker

In article <349A875E.608CC9D1@lds.com>, Chris Gaston <cgaston@lds.com> wrote:


>Job Description:

[snip]

>Keeping up-to-date with current technology trends is
>essential

first time that i've seen a job description that allowed for 
goofing off on IRC or usenet.  i think i'll apply *heh*.

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Dec 1997 10:00:27 -0600
From: Derek Balling <dballing@speedchoice.com>
Subject: Re: Whats wrong with this simple code?
Message-Id: <6E3540C5A6C3D9BD.424E32A0B9D8958A.A9EFCE3E27DA4B40@library-proxy.airnews.net>

brian d foy wrote:
> 
> In article <67c273$hp5@snews1.zippo.com>, "E. Brian Depenbrock" <ebd@sunline.net> wrote:
> 
> >The following code works, but it does not exit out to a prompt when it
> >reaches the end of file.
> 
> >$line = <>;
> >while ($line ne "") {
> >die("\n") if ($line eq "");
> >    $mls = substr($line,18,6);
> >    $line = <>;
> >    print("$mls");
> >    print("\n");
> >    $line = <>;
> >}
> 
> perhaps you wanted something simple like:
> 
>    #!/usr/bin/perl
> 
>    while( $line = <> )
>         {
>         print $line;
>         }

Why be THAT complicated?

#!/usr/bin/perl
while (<>) { print; }


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

Date: Fri, 19 Dec 1997 10:34:13 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Whats wrong with this simple code?
Message-Id: <349AA205.3F835801@gpu.srv.ualberta.ca>

Derek Balling wrote:
!
! brian d foy wrote:
[snip]
! >
! > perhaps you wanted something simple like:
! >
! >    #!/usr/bin/perl
! >
! >    while( $line = <> )
! >         {
! >         print $line;
! >         }
! 
! Why be THAT complicated?
! 
! #!/usr/bin/perl
! while (<>) { print; }

or maybe just:

#!/usr/bin/perl -p

(and maybe call it cat :-)

regards
andrew


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

Date: Fri, 19 Dec 1997 12:10:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Whats wrong with this simple code?
Message-Id: <comdog-ya02408000R1912971210530001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6E3540C5A6C3D9BD.424E32A0B9D8958A.A9EFCE3E27DA4B40@library-proxy.airnews.net>, Derek Balling <dballing@speedchoice.com> wrote:

>brian d foy wrote:

>>    #!/usr/bin/perl
>> 
>>    while( $line = <> )
>>         {
>>         print $line;
>>         }
>
>Why be THAT complicated?

for clear program flow in what would be a much more complicated
block of code that will probably involve lots of munging of the
input data.  (well, you asked...)

>#!/usr/bin/perl
>while (<>) { print; }

but why be THAT complicated?

   perl -e 'while(<>){print}' < infile

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1509
**************************************

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