[7516] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1142 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 8 01:07:46 1997

Date: Tue, 7 Oct 97 22:00:32 -0700
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, 7 Oct 1997     Volume: 8 Number: 1142

Today's topics:
     Re: "cannonical" location of perl binary mgjv@comdyn.com.au
     Re: $x = $y || $z - dangerous assumption? (Tad McClellan)
     Re: 32K limit on pipes? <bholzman@mail.earthlink.net>
     Re: accessing a printer's status via socket?... <bholzman@mail.earthlink.net>
     Re: Cookie Help! mgjv@comdyn.com.au
     Re: Counting Lines (Tad McClellan)
     Re: Counting Lines <cstewart@flash.net>
     Re: DATABASING IN PERL (HELP!) (Faust Gertz)
     Re: DATABASING IN PERL (HELP!) <fain@actcom.co.il>
     Re: Directory Contents (Tad McClellan)
     E-mail a WWW file <liam@dircon.co.uk>
     Re: how do I redirect the output of an existing perl sc <tarkus@dim.ANTISPAM.com>
     Re: IO Blocking? (Charles DeRykus)
     need help to test interactive application <IGOREK@prodigy.net>
     Re: New Perl syntax idea (O'Shaughnessy Evans)
     Re: Newbie ques: How to concatenate two strings? (Ronald L. Parker)
     Re: Perl eq to C struct mgjv@comdyn.com.au
     Re: Perl for Win95 (Steve Frost)
     Re: Perl for Win95 (Jim F.)
     Re: perl Q using -w and filehandlers (Tad McClellan)
     Pro's and Cons - Sub's from Sub's? webmaster@proliferate.com
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 07 Oct 1997 21:51:46 -0600
From: mgjv@comdyn.com.au
Subject: Re: "cannonical" location of perl binary
Message-Id: <876278800.11006@dejanews.com>

In article <slrn63ja4i.2bt.andrew@pimlott.student.harvard.edu>,
  pimlott@math.harvard.edu wrote:
>
> I remember reading somewhere (in the online documentation or the Camel) that
> /usr/bin/perl is the official location of the perl binary (on unix systems).

>From the file 'INSTALL' in the perl distribution:

By default, for most systems, perl will be installed in
/usr/local/{bin, lib, man}.  You can specify a different 'prefix' for
the default installation directory, when Configure prompts you or by
using the Configure command line option -Dprefix='/some/directory',

Martien

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


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

Date: Tue, 7 Oct 1997 20:41:49 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: $x = $y || $z - dangerous assumption?
Message-Id: <tcoe16.5u3.ln@localhost>

Damian Conway (damian@cs.monash.edu.au) wrote:
: Randal Schwartz <merlyn@stonehenge.com> writes:

: >Damian> 	sub first_defined { map { return $_ if defined $_ } @_ }
: >
: >Ewwwww.  My eyes hurt.  map/grep in a void context is Bad Form,

: Looks like you can take the programmer out of the functional paradigm,
: but you can't take the functional paradigm out of the programmer :-)

: For future reference, could you expand a little on _why_ that
: particular solution is inappropriate?


Perl FAQ, part 6:

---------------------------------------------
=head2 What's wrong with using grep or map in a void context?

Strictly speaking, nothing.  Stylistically speaking, it's not a good
way to write maintainable code.  That's because you're using these
constructs not for their return values but rather for their
side-effects, and side-effects can be mystifying.  There's no void
grep() that's not better written as a C<for> (well, C<foreach>,
technically) loop.
---------------------------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Tue, 07 Oct 1997 23:50:44 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: johns@minnie.pok.ibm.com
Subject: Re: 32K limit on pipes?
Message-Id: <343B0314.716BD975@mail.earthlink.net>

[posted & mailed]

John Simpson wrote:
> 
> --
> 
>   I am attemting to debug a problem with a perl program which is hanging on
> the read of a pipe. After quite a bit of debugging it appears that the
> program is running into a 32K limit somewhere, but it is not clear what has
> this limit and how I can fix the problem.
> 
>  Here are some of the details. I will try to make this brief and if necessary
> I will add to it if more details are needed.
> 
>   Basically I have a perl program which creates pipes and child processes to
> run commands remotely and then wait on the output of each to print the output.
> The problem has been simplified to the point that I can now reproduce it by
> cat'ing a large file. If I "rsh cat test_file 1>&2", where the test_file

What do you mean by that 'rsh' command-- are you rsh'ing to another
box?  What does that have to do with your perl program.  Do you execute
the exact same command from a system call in your  perl program?  And
are you aware that '1>&2' is redirecting STDOUT into STDERR?

> is greater than 32K of data, this works fine. If I do the same thing within
> the perl program the program hangs trying to read from the pipe. If the file
> is less than 32K there is no problem with the perl program.

Again, what exactly are you doing in your perl script?  It's not too
clear here.  Perhaps you should post some code...

> 
>   So, my questions are: Is there a 32K limit somewhere in Perl which I can
> change to fix this problem? Has anyone encountered this problem and could you
> please provide some assistance?
> 
> Thanks in advance for any help!
> 
> John




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

Date: Tue, 07 Oct 1997 23:44:17 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
Subject: Re: accessing a printer's status via socket?...
Message-Id: <343B0191.A27D3DCE@mail.earthlink.net>

Kevin Lambright wrote:
> 
> Stephen Cole <scoler@earthlink.net> writes:
> 

[snip]

> If you don't know the protocol that sycom/sycom_d are using, you are
> going to have a difficult time determining how to mimic the same thing
> in Perl.  Furthermore, if you don't know the commands that sycom_d is
> issuing to the plotter to get the status, that is going to be difficult
> as well.
> 
> You could try to reverse engineer sycom/sycom_d, but this would be
> painful and time consuming.
> 
> I assume the manafucturer does not have any documentation that describes
> either the commands to issue to the plotter to get status, or the
> protocol used for communication between sycom/sycom_d.  If they do, you
> should be able to mimic the behavior in Perl.
> 
> Otherwise, I would try one of two things.
> 
> 1.  If you know the port on which sycom_d listens on plotter host, you
>     can try to telnet to it and determine the (potentially) simple
>     protocol that sycom uses to get the status.
> 

A better way to figure out the protocol would be to run a good packet
sniffer while sycom talks to sycom_d.  That way you'll see the complete
exchange and won't have to guess too much.  You can probably figure out
which port sycom uses through 'netstat' or 'lsof', if you have it.

> Hope this helps.
> 
> Kevin
> --
> ------------------------------------------------------------------------------
> Kevin Lambright                                    email: kevinl@casc.com
> Ascend Communications                              voice: 978-952-7407
> 1 Robbins Road                                     fax:   978-692-1510
> Westford, Ma. 01886




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

Date: Tue, 07 Oct 1997 22:01:29 -0600
From: mgjv@comdyn.com.au
Subject: Re: Cookie Help!
Message-Id: <876279267.11611@dejanews.com>

In article <3437D10E.E4B92083@novice.uwaterloo.ca>,
  aljohns@novice.uwaterloo.ca wrote:
>
> I'm after information about how to ADD or SUBTRACT to already placed
> information in a cookie. Almost like a little shopping cart.

This is not really a perl question. In fact, now I think about it, it has
nothing to do with perl at all...

Check out www.cookiecentral.com for all your cookie related questions.

Martien

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


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

Date: Tue, 7 Oct 1997 21:02:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Counting Lines
Message-Id: <ejpe16.v14.ln@localhost>

Chuck (cstewart@flash.net) wrote:
: I hope I can explain this properly.  I have a script that sorts and then
: counts and prints the lines.  Sometimes the $total is the same. The $count
: is used to place players of a pool.  Should two or more players have the
: same score ($total), that place is considered tied.  How might I have count
: print the same number for those lines?  Here's what I mean:

: 1.       100    Pete
: T2.     50      Joe
: T2.     50      Larry
: 4.       30      Mike

: The below will count and print but I can't figure out how to do the above.
: Thanks..

:  open(DATABASE, ">$file");

You should ALWAYS (really, always) check the return value:

   open(DATABASE, ">$file") || die "could not open '$file'  $!";;

:    foreach $dataline (@dlines) {
:    $count = $count + 1;

   $count++;  # this is the usual idiom for incrementing..


:  chomp($total);

Eh? chomping $total *before* $total has even been assigned a value?

Maybe you meant $dataline here?


:    ($total, $realname, $email, $userid, $week1, $week2, $week3) = split
: (/\t/, $dataline);

I see three fields in the sample data you gave.

Do you have some other data where you expect seven fields?


:         print DATABASE
: "$count\t$total\t$realname\t$email\t$userid\t$week1\t$week2\t$week3";
:  }
:  close(DATABASE);


I was going to try and answer until I read the code.

Now I'm quite sure I don't know what you are asking, or that the code
you gave is even the real code ( -w has a lot to say when I tried to
run it...)


Don't try and explain in English.

Give us input data, and show us what you want the output data
to look like, and someone will likely help you do that...


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Tue, 7 Oct 1997 22:39:54 -0500
From: "Chuck" <cstewart@flash.net>
Subject: Re: Counting Lines
Message-Id: <61eum0$8rv$1@excalibur.flash.net>

-----Original Message-----
From: Tad McClellan <tadmc@flash.net>
Newsgroups: comp.lang.perl.misc
Date: Tuesday, October 07, 1997 9:02 PM
Subject: Re: Counting Lines

>Give us input data, and show us what you want the output data
>to look like, and someone will likely help you do that...

Tad, lemme try this again.  I have a tab delimited file I'll call "scores":
130 Joe 15  15  50  25  25
123 Frank  23  25  25  25  25
123 Mike 3  20  50  25  25
119 Pete 10  9  50  25  25

What I need to do is count the records in the file which results in "scores"
containing:
1  130  Joe 15  15  50  25  25
T2  123  Frank  23  25  25  25  25
T2  123  Mike  3  20  50  25  25
4  119  Pete  10  9  50  25  25

Thanks again..




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

Date: Wed, 08 Oct 1997 02:26:27 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: DATABASING IN PERL (HELP!)
Message-Id: <343ce154.9029560@news.wwa.com>

Please note:
comp.perl.lang does not exist and has not existed since 1995!  Please
demand (or nicely request) that your administrator to remove it.
Besides, as Tom Phoenix once noted:

>Kibo doesn't read it anymore. 

On Wed, 08 Oct 1997 20:34:20 +0200, || Fains || <fain@actcom.co.il>
wrote:

>My name is nathan Fain,

My name is 'Faust' and "Faust" names 'Faust'.  :-)

>I have recently begun learning how to write CGI scripts in Perl and am
>now able to edit and do basic functions. I do volunteer work for a
>school and they asked me to do a project for them involving a Database,
[snip] 
>They want me to read the database and create a webpage from it
>displaying the data in the the database Text file.

Do you mean displaying that data from the database?

>Here is what I am having trouble with:
>
>I need to know how to read from a database file in my CGI script using
>perl - in particular - How do I get it so that the script reads table
>cells in the database and not Just line Breaks, example:
>Companyname DD/MM/YY #### DESCRIPTION
>
>How do I get it to read the Company Name, the Date, the # and the
>Description as different parts of the database.

Perhaps you can read the line and use the split function as documented
in the perlfunc manpage.

For example:

my ($company_name, $date, $number, $description) = split /\s+/, $_, 4;

will split $_ into four pieces on the first three instances of white
space, but if there is any white space in the company name, this
solution won't split the way you want it to split. :-)  But this might
get you thinking about looking at all the neat functions in the
documentation.  Regular expressions might also do the trick, but you
might want to look at all (or most) the functions first.

>is there a certain type of file the database needs to be (can I just use
>a plain *.txt file)?

That is up to you.  :-)  There are several ways to handle this type of
thing.

>Any help that you can give me I would greatly appreciate.

If you haven't already, I suggest you purchase _Learning Perl_ by
Randal Schwartz and Tom Christiansen.  There is plenty of information
in the *later* chapters of the book on both file\database manipulation
and the CGI.pm module.  If you are looking for a less unix-centric
book, you can try Eric Johnson's _Cross-Platform Perl_, which also has
*later* chapters on file\database manipulation and the CGI.pm module.
If you have the money, perhaps you should get both.  :-)  I did.
Also, notice the information you seem to seek is available in the
*later* chapters.  It will take *time* for you to get up to speed and
do all the neat things you want to do.  Other excellent places to look
for information are FAQs (http://language.perl.com/faq/index.html),
CPAN modules which have already done the work for you
(http://www.perl.com/CPAN-local/CPAN.html), and Randal Schwartz's _Web
Techniques_ (http://www.stonehenge.com/merlyn/WebTechniques/)  and
_Unix Review_ (http://www.stonehenge.com/merlyn/UnixReview/) articles.
Lincoln Stein's homepage (http://www-genome.wi.mit.edu/~lstein/) isn't
a bad place either.

>Oh, if you could... please send me a mail to fain@cs.huji.ac.il to
>respond or to let me know that you have responded.

Oh, this group is also a good place to keep reading too.  :-)


Streben nach Wahrheit

Faust Gertz
Philosopher at Large

"The universe was once conceived almost as a vast preserve, landscaped
for heroes, plotted to provide them the appropriate adventures.  The
rules were known and respected, the adversaries honorable, the oracles
articulate and precise as the directives of a six-lane parkway. 
Errors of weakness or vanity led, with measured momentum, to the
tragedy which resolved everything.  Today, the rules are ambiguous,
the adversary is concealed in aliases, the oracles broadcast a babble
of contradictions."  --- Maya Deren, from her notes for _At Land_


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

Date: Thu, 09 Oct 1997 06:04:33 +0200
From: || Fains || <fain@actcom.co.il>
To: faust@wwa.com
Subject: Re: DATABASING IN PERL (HELP!)
Message-Id: <343C65E0.9ABA6EEC@actcom.co.il>

OK, if you are willing, I have another question.
in your example (and something I see everywhere):
my ($company_name, $date, $number, $description) = split /\s+/, $_, 4;

you use = split /\s+/, $_, 4;
what does that do exactly (what does /\s+ do as opposed to some other
combination), how does it affect:
my ($company_name, $date, $number, $description)
?
this is what I do not understand and what I need to understand.

The database that I am trying to use looks like this (a sample line from the
actual file):
-2 open pc386 AIM386 CT906M00022 132.65.181.8 utp pcftp2 42 - 640 + * * *
12-1-2-6
each space you see (" ") makes a different cell. What I need to do is make my
perl program split the line by each space (not commas or anything else) and
make a variable like what was in your example.
how would I have to change this: = split /\s+/, $_, 4;
in order to make it work?

I will definitely look for the books you suggested (although I don't know how
available they will be here in Israel)

Thanks for your help.

- Nathan fain@cs.huji.ac.il


Faust Gertz wrote:

> Please note:
> comp.perl.lang does not exist and has not existed since 1995!  Please
> demand (or nicely request) that your administrator to remove it.
> Besides, as Tom Phoenix once noted:
>
> >Kibo doesn't read it anymore.
>
> On Wed, 08 Oct 1997 20:34:20 +0200, || Fains || <fain@actcom.co.il>
> wrote:
>
> >My name is nathan Fain,
>
> My name is 'Faust' and "Faust" names 'Faust'.  :-)
>
> >I have recently begun learning how to write CGI scripts in Perl and am
> >now able to edit and do basic functions. I do volunteer work for a
> >school and they asked me to do a project for them involving a Database,
> [snip]
> >They want me to read the database and create a webpage from it
> >displaying the data in the the database Text file.
>
> Do you mean displaying that data from the database?
>
> >Here is what I am having trouble with:
> >
> >I need to know how to read from a database file in my CGI script using
> >perl - in particular - How do I get it so that the script reads table
> >cells in the database and not Just line Breaks, example:
> >Companyname DD/MM/YY #### DESCRIPTION
> >
> >How do I get it to read the Company Name, the Date, the # and the
> >Description as different parts of the database.
>
> Perhaps you can read the line and use the split function as documented
> in the perlfunc manpage.
>
> For example:
>
> my ($company_name, $date, $number, $description) = split /\s+/, $_, 4;
>
> will split $_ into four pieces on the first three instances of white
> space, but if there is any white space in the company name, this
> solution won't split the way you want it to split. :-)  But this might
> get you thinking about looking at all the neat functions in the
> documentation.  Regular expressions might also do the trick, but you
> might want to look at all (or most) the functions first.
>
> >is there a certain type of file the database needs to be (can I just use
> >a plain *.txt file)?
>
> That is up to you.  :-)  There are several ways to handle this type of
> thing.
>
> >Any help that you can give me I would greatly appreciate.
>
> If you haven't already, I suggest you purchase _Learning Perl_ by
> Randal Schwartz and Tom Christiansen.  There is plenty of information
> in the *later* chapters of the book on both file\database manipulation
> and the CGI.pm module.  If you are looking for a less unix-centric
> book, you can try Eric Johnson's _Cross-Platform Perl_, which also has
> *later* chapters on file\database manipulation and the CGI.pm module.
> If you have the money, perhaps you should get both.  :-)  I did.
> Also, notice the information you seem to seek is available in the
> *later* chapters.  It will take *time* for you to get up to speed and
> do all the neat things you want to do.  Other excellent places to look
> for information are FAQs (http://language.perl.com/faq/index.html),
> CPAN modules which have already done the work for you
> (http://www.perl.com/CPAN-local/CPAN.html), and Randal Schwartz's _Web
> Techniques_ (http://www.stonehenge.com/merlyn/WebTechniques/)  and
> _Unix Review_ (http://www.stonehenge.com/merlyn/UnixReview/) articles.
> Lincoln Stein's homepage (http://www-genome.wi.mit.edu/~lstein/) isn't
> a bad place either.
>
> >Oh, if you could... please send me a mail to fain@cs.huji.ac.il to
> >respond or to let me know that you have responded.
>
> Oh, this group is also a good place to keep reading too.  :-)
>
> Streben nach Wahrheit
>
> Faust Gertz
> Philosopher at Large
>
> "The universe was once conceived almost as a vast preserve, landscaped
> for heroes, plotted to provide them the appropriate adventures.  The
> rules were known and respected, the adversaries honorable, the oracles
> articulate and precise as the directives of a six-lane parkway.
> Errors of weakness or vanity led, with measured momentum, to the
> tragedy which resolved everything.  Today, the rules are ambiguous,
> the adversary is concealed in aliases, the oracles broadcast a babble
> of contradictions."  --- Maya Deren, from her notes for _At Land_





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

Date: Tue, 7 Oct 1997 21:59:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Directory Contents
Message-Id: <vuse16.je4.ln@localhost>

rets@meta3.com wrote:
: Working along and (accidentally) created the following.  I post it in
: hopes of it being useful to someone.


Thanks a lot. This is how Usenet is supposed to be. Folks helping folks.



Reading along, I (purposely) created the following.

I post it in the hopes of it showing that TMTOWTDI  ;-)

[ mine produces output identical to yours (I think) ]


: Just run it in the directory your are in.

Mine too  ;-)



: my $List = `ls -1d *`;

Sorry MS and Mac users. You are out of luck.

Use mine instead ;-)



: my @List = split(/\n/, $List);

No need for that intermediate $List variable:

   my @List = split(/\n/, `ls -1d *`);

or even:

   my @List = grep( s/\n//, `ls -1d *`); # Better. split() is for strings
                                         # grep() is for lists
                                         # let's hope there are no
                                         # filenames with newlines in them...


: foreach $Item (@List) {
:     next unless ($Item);

Why did you need that next() ?

Does your ls return null strings or something?

If you have a file named '0', it will not be counted at all.

Maybe you want (defined($Item)) instead?



[snip]

:     print "There are [$Ext{$A}] \.$A files.\n";
                                  ^
                                  ^ unnecessary backwack there


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


opendir(DIR, '.') || die "could not opendir() for the current directory $!";

foreach $item (grep /^[^.]/, readdir(DIR)) {

   push(@dir, $item), next if -d $item;              # directories

   if (-f $item) {
      push @singles, $item unless $item =~ tr/././; # files without extensions
      $ext{$1}++ if $item =~ /\.(.*)/;              # files with extension
      next;                                         # done with this item
   }

   push @skip, $item;
}
closedir(DIR);


foreach (sort keys %ext) {
   print "There are [$ext{$_}] .$_ files.\n";
}

print "\n";

if (@dir) {
   print '[', scalar(@dir), "] Directories\n-------------------\n";
   print join(', ', (sort @dir)), "\n\n";
}

if (@singles) {
   print '[', scalar(@singles), "] Single Files\n-------------------\n";
   print join(', ', (sort @singles)), "\n\n";
}

if (@skip) {
   print '[', scalar(@skip), "] Single Files\n-------------------\n";
   print join(', ', (sort @skip)), "\n";
}
---------------------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 8 Oct 1997 02:18:48 GMT
From: "Liam Bateman" <liam@dircon.co.uk>
Subject: E-mail a WWW file
Message-Id: <01bcd398$05c94ee0$8c3870c2@pennys>

Hi All,

	I'm just learning PERL and was wondering whether anyone could help me do
the following:

Every sunday morning my logs are created, by analog, for my WWW sites,
is it possible to 'hack' a PERL script to run every, sunday lunch time
(ish), say, and then perform this command line action on it:

'proclog wwwlog.html resolved_log.html'

then E-mail  'resolved.html' to my E-mail address,

from what little I know i s'pos I need to use cron ?
and use the 'sendmail' program but I do not know how!

TIA,
Regards,

Liam 
-- 
liam@renet-world.com <Liam Bateman>


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

Date: Tue, 07 Oct 1997 21:47:34 -0600
From: Tarkus <tarkus@dim.ANTISPAM.com>
Subject: Re: how do I redirect the output of an existing perl script
Message-Id: <343B0256.703CEBCC@dim.ANTISPAM.com>

Peter Tiemann wrote:

> I'd like to redirect the standard output of a perl function that I
> call.
> (Right now it writes on the screen = in a web page in my particular
> case)
> I would like to have that function write to a file to be able to
> process the
> output.
>
> Thank you for helping a beginner -
> Peter Tiemann,
> peter@preview.org

Well, nice try all of you.  This is more simple than you know.
Try this:

close(STDOUT);
open (STDOUT, ">FileName") || die;
select STDOUT;


Now any default print statment (those without a filehandle associated to
it) will
print to the stdout file.

Kevin "Tarkus" Eson



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

Date: Wed, 8 Oct 1997 01:09:11 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: IO Blocking?
Message-Id: <EHpKJB.K0L@bcstec.ca.boeing.com>

In article <61bmdq$i1m$1@news.monmouth.com>,
Nick Lehman <nlehman@shell.monmouth.com> wrote:
 >I read in the FAQ about how to open a file for non-blocking reads.
 >How do I open stdin for non-blocking reads?
 >TIA
 >Nick
 >nlehman@monmouth.com


Here's something that should work on many Unix-ish systems:

use Fcntl;

$ret = fcntl( STDIN, F_SETFL, O_NDELAY | O_NONBLOCK );
die "can't set STDIN non-blocking: $!" unless defined $ret;



HTH,
--
Charles DeRykus


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

Date: Tue, 07 Oct 1997 23:42:47 -0700
From: IGOREK <IGOREK@prodigy.net>
Subject: need help to test interactive application
Message-Id: <343B2B67.378F@prodigy.net>

Is anybody has or knows how to make Perl script for interactive Unix
Application.
I have very simple application which asks question and I have to insert
answers from the keyboard.
So I'm looking for a module or method to test this application.
I  made a script by using Tcl which works just fine but I'd like to use
Perl.  

Thanks.

Igor Annopolsky.
igorek@prodigy.net


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

Date: 8 Oct 1997 02:17:24 GMT
From: shaug@callamer.com (O'Shaughnessy Evans)
Subject: Re: New Perl syntax idea
Message-Id: <61eqfk$dmc$1@ha1.rdc1.occa.home.com>

In article <Pine.GSO.3.96.970930071314.16316E-100000@usertest.teleport.com>,
	Tom Phoenix <rootbeer@teleport.com> writes:
> 
> It may someday happen; it's being considered by various members of the
> Perl development team. One of the ongoing arguments is whether the implied
> start of the method should say
> 
>     my $self = shift;
> 
> or
> 
>     my $me = shift;

I'll throw in my two bits of half-informed opinion....

Since $self seems to be a somewhat "magical" variable anyhow, maybe
it would be appropriate to make it one of the last few special-char
variables:  ${ or $}.  An object is a hash of sorts, or appears to be 
in some ways, so it sort of makes sense :)

I think it'd be cool, anyway.  On the other hand, it could make code
pretty hard to read, and would kill the "bounce on %" feature of vi.
And, I'll bet there's a reason these chars haven't been used as var
names.

Hmm... ``$}->init(); $}->{obj_vars}{a} = 1;'' doesn't actually look that
bad.  Kinda neat from an aesthetic perspective, but I'm sure this is
best left to the local experts on language design.


-- 
                                                 O'Shaughnessy Evans -
                                       http://www.callamer.com/shaug -
       UNIX Sys Admin, GST Call America; San Luis Obispo, California -


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

Date: Tue, 07 Oct 1997 19:21:43 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <343a8b93.23645666@news.supernews.com>

On 7 Oct 1997 16:03:37 GMT, tfletche@pcocd2.intel.com (Terry Michael
Fletcher - PCD ~) wrote:

>Tom Phoenix (rootbeer@teleport.com) so eloquently and verbosely pontificated:
>> 
>> TANSTAAFL. HAND.
>
>WTF is that?  oh, and BTW, i am LOL.
>

There Ain't No Such Thing As A Free Lunch.  

ROTFLMAO,

--
Ron Parker
Software Engineer
Farm Works Software       Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt


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

Date: Tue, 07 Oct 1997 21:51:40 -0600
From: mgjv@comdyn.com.au
Subject: Re: Perl eq to C struct
Message-Id: <876278678.10893@dejanews.com>

In article <343a2888.1082367@news.panix.com>,
  Brian@Kreation.com wrote:
>
> I was wondering if there is a way to create a structure, or in Pascal
> a record? I also need an array of them.

You will want to read the perldsc (and perllol) man page

http://www.perl.com/CPAN/doc/manual/html/pod/perldsc.html
http://www.perl.com/CPAN/doc/manual/html/pod/perllol.html

Martien

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


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

Date: Wed, 08 Oct 1997 02:49:16 GMT
From: frostbyt@shell02.ozemail.com.au (Steve Frost)
Subject: Re: Perl for Win95
Message-Id: <61esad$djg$1@reader1.reader.news.ozemail.net>

Some time ago phenix@interpath.com (John Moreno) wrote:

>Jim F. <jimfr@best.com> wrote:
>] Does anyone know if there is a PERL for Win95 that will produce
>] standalone .exe files?  (There is a version for Macintosh that
>] produces standalone applications).

>Not to knock the Mac version - I'm using it, I like it - but it's
>standalone applications are simply a copy of the code bound to a copy of
>the runtime.  I'm not saying this well, but what it means is that your
>"standalone" applications ends up taking about 1.5M each - not really a
>lot of point in doing so.

I've seen one of these for Win32 Perl.  Can't see any reason
why it wouldn't work on Win95.  I tried it on NT.  As with
Jim's Mac (see above) you end up with huge executables though.
Might be fun for a 'once in a while' application, but not for
anything where it's being executed regularly (e.g. CGI).

Maybe a future version of the 'C' compiler for Perl will be
able to do what you really want.

Anyway, have a look on your favourite search engine.  If you
can't find it, drop me a line and I'll see if I've still got
it laying about on one of my servers.

Cheers

Steve

-- 
********************************************************************
Stephen Frost                                  Stephen Frost
Managing Director                              Technical Consultant
Frostbyte Computer Consultants Pty Ltd         OzEmail Limited
Melbourne, Australia (ACN 078 000 030)         Sydney, Australia
--------------------------------------------------------------------
http://www.frostbyte.com.au                   "Faith is the evidence
frostbyt@shell02.ozemail.com.au                of things unseen."
--------------------------------------------------------------------
Please remove the 'shell02' if emailing me or the mail will bounce.


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

Date: Wed, 08 Oct 1997 03:49:05 GMT
From: jimfr@best.com (Jim F.)
Subject: Re: Perl for Win95
Message-Id: <61evj4$e8g$1@nntp2.ba.best.com>

John,
  Agreed, but it's still really nice when you want to distribute the
"application", certainly, it would be a lot nicer on Windows.

jim

phenix@interpath.com (John Moreno) wrote:

>Jim F. <jimfr@best.com> wrote:

>] Does anyone know if there is a PERL for Win95 that will produce
>] standalone .exe files?  (There is a version for Macintosh that
>] produces standalone applications).

>Not to knock the Mac version - I'm using it, I like it - but it's
>standalone applications are simply a copy of the code bound to a copy of
>the runtime.  I'm not saying this well, but what it means is that your
>"standalone" applications ends up taking about 1.5M each - not really a
>lot of point in doing so.

>-- 
>John Moreno




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

Date: Tue, 7 Oct 1997 20:49:05 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: perl Q using -w and filehandlers
Message-Id: <hqoe16.5u3.ln@localhost>

sartang@pcocd2.intel.com wrote:

: &parseFile( FILE ) ;

: If I use -w it warns that  FILE  is not being used.

[snip]

: What can I do ?


Uhhh. How about seeing if your Question is one that is Frequently Asked?

Sure seems to me that someone is very likely to have come across
this before...


 ...

 ...


Yep. There it is.

Perl FAQ, part 5: 

   "How can I make a filehandle local to a subroutine?  
    How do I pass filehandles between subroutines?  
    How do I make an array of filehandles?"


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Tue, 07 Oct 1997 21:12:22 -0600
From: webmaster@proliferate.com
Subject: Pro's and Cons - Sub's from Sub's?
Message-Id: <876275999.8416@dejanews.com>

Hello,

I was wondering if anyone could point out the hazards of calling a
subroutine from within another subroutine.  Are there any drawbacks or
other hazzards I should be aware of.  I would greatly appriciate your
thoughts on the matter.  If you could E-mail me with your opinions I
would
be very grateful.  I am running WIN32 PERL port.

Thank you,
Andrew Nicholson

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


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

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 1142
**************************************

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