[9888] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3481 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 19 08:07:43 1998

Date: Wed, 19 Aug 98 05:00:40 -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           Wed, 19 Aug 1998     Volume: 8 Number: 3481

Today's topics:
    Re: 2 quick questions <posern@informatik.uni-marburg.de>
        Can not create socket ??? <johnvun@asiapac.net>
    Re: COBOL and Perl foochre@my-dejanews.com
        DBI::shell,dbish,DBD::Proxy Server.... rasyidi@aitpg.Adorna-RMIT.edu.my
        detach console under win32... (GEMINI)
    Re: has anyone tried embedding perl in win32? <brett.calcott@clear.net.nz>
    Re: here's an implementation of diff in perl (M.J.T. Guy)
        hmmm... <posern@informatik.uni-marburg.de>
        How to clear a filehandle? (Hugo Benne)
    Re: How to clear a filehandle? <bronel@friko6.onet.pl>
    Re: I need help with Hello World--Only works when modif dave@mag-sol.com
        IO::Select problem with named pipe simon@whitestar99.demon.co.uk
        Mailing List Sign up dgower@ilmioweb.it
        Need Help:perl for win32 serraqi@my-dejanews.com
    Re: Need Help:perl for win32 <posern@informatik.uni-marburg.de>
        Perl for win32: How to catch the STDERR-Stream?? AND Ho <posern@informatik.uni-marburg.de>
        Perl Lex ? Perl Yacc ? <elouan@usa.net>
    Re: Perl Lex ? Perl Yacc ? <uwe.honekamp@etas.de>
        perl.h in conflict with qt's qglobal.h <chirino@eng.usf.edu>
        Perlis.dll and SSI <wlchai@watercolours.com>
        Problem with <STDIN> in a script with a DCL wrapper (VM (R. Hewson)
        problems with  system() command <mack@montefiore.ulg.ac.be>
    Re: Reading from files <gt2214a@prism.gatech.edu>
    Re: Recommend a good editor (Al Aab)
    Re: Recommend a good editor scott@softbase.com
    Re: reference to anonymous scalar? (M.J.T. Guy)
        Returning an image from a call to a script <gt2214a@prism.gatech.edu>
    Re: Returning an image from a call to a script <chirino@eng.usf.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 19 Aug 1998 08:40:37 GMT
From: "K.Posern" <posern@informatik.uni-marburg.de>
To: Kris Davey <mivl@inquo.net>
Subject: Re: 2 quick questions
Message-Id: <35DA8F49.4BE1A405@informatik.uni-marburg.de>



Kris Davey wrote:

> 1. I think I remeber seeing something a while back about compiling perl
> scripts to an exe. I can't remeber if was a p3exe.bat or an actual compiler.
> I would like to create scripts that I can run on workstations that don't
> have Perl. (These workstations are on an isolated network with no ISAPI web
> server).

You could use perl2exe (from http://www.demobuilder.com/perl2exe.htm) which will
work with perl_for_win32 from activestate and will e.g. generate an 521kB big
exe-file out of an 11KB big perl-script! - but this exefile will only need
itself for execution...

Or you just copy ONCE perl.exe and the dll's and packages your program needs,
which I would appreciate, just if you have more than one perl program...

Hope that helpful somehow.

bye.

Knuth.



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

Date: Wed, 19 Aug 1998 17:33:18 +0800
From: johnvun <johnvun@asiapac.net>
Subject: Can not create socket ???
Message-Id: <35DA9BDD.C857781B@asiapac.net>

Dear Expert,

below is my code, i want to create a socket, but my program stop and say
No socket ??? Why ???
if i print $serveraddress then it print some thing like this PJ<j   why
???

$port = 4000;
($var1, $var2, $prototype) = getprotobyname ("tcp");
($var1, $var2, $var3, $var4, $server) = gethostbyname ("topgun");
$serveraddress = pack ("Sna4x8", 2, $port, $server);
print ("$serveraddress\n");
socket (issocket, 2, 1, $prototype) || die ("No socket");
bind (issocket, $serveraddress);
listen (issocket, 1);
 .......


Please Help !

Thanks !

johnvun



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

Date: Wed, 19 Aug 1998 09:43:27 GMT
From: foochre@my-dejanews.com
Subject: Re: COBOL and Perl
Message-Id: <6re6nu$t9a$1@nnrp1.dejanews.com>

In article <6r7fi0$9a7$1@nnrp1.dejanews.com>,
  birgitt@my-dejanews.com wrote:
> A couple of months ago I got here (clpm) the advice not using Perl
> as the first language when starting to learn how to program. It was
> recommended using PASCAL, C, AWK, and then Perl.

Sounds sensible - in those other languages you have to write
tidy code otherwise it doesn't work.  Perl usually does what
you expect whatever way you write it so might not be so good
for a learner.

> Having skipped reading much about PASCAL, reading only about
> C so far and not getting into Perl yet, I would like to know
> if in general COBOL programs could be rewritten effectively in
> Perl.

Yup, but it would be best to change the whole design to take
advantage of the different environment.


V

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 19 Aug 1998 10:15:13 GMT
From: rasyidi@aitpg.Adorna-RMIT.edu.my
Subject: DBI::shell,dbish,DBD::Proxy Server....
Message-Id: <6re8jh$v2e$1@nnrp1.dejanews.com>

I just install DBI-1.00 on my redhat 5.0.
My perl ver. is 5.004.04
My postgresql is ver. 6.3
this 2 package I upgrade using RPM from redhat 5.1

I also just install DBD::Pg on my pc.

the installation looks good ....no problem.

But I want to asked a few question regarding the installation for DBI and DBD.
DBI:
when I used 'perl Makefile.PL'
I got a warning that said DBI:shell and 'dbish' command not install
pRPC-modules (RPC::pClient) not install
DBD::Proxy driver and DBI Proxy server not install
Storable not install.
You can install it after install the DBI
something like that!!!!

Do I need to install all this modules?
I only can find pRPC-modules and Storable from
www.perl.org/CPAN/modules/by-module
Where can I find the others?

DBD:
when I used make...it show
if file include from /usr/include/libpq/pqcom.h:22
                from /usr/include/libpq-fe.h:28,
                from Pg.h:12,
                from dbdimpc.c:12 and also Pg.xs:12
 /usr/include/c.h:66: warning:empty declaration
But the 'make' is complete.
What is the meaning for this error? is that mean the installation not
succesfully.
when I run make test....everything is OK.

can someone help me to explain all this problem.
How I want to know my DBD and DBI working or not working?

Thanks

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 19 Aug 1998 01:03:24 GMT
From: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: detach console under win32...
Message-Id: <6rd88s$1nj$1@netnews.csie.NCTU.edu.tw>

hi all,
  I use perl + GUI module to develop windows program under win32 (win95).
if I execute the program in a MSDOS box, the next prompt will not return
till the program exit. If it is executed by double-clicking the icon
on the desktop, a MSDOS box will be created.
Is there a way to let the program detach from the console
(or not to create console) so that it looks like a normal windows
program?
thanks in advance.


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

Date: Wed, 19 Aug 1998 23:50:56 +1200
From: "Brett Calcott" <brett.calcott@clear.net.nz>
Subject: Re: has anyone tried embedding perl in win32?
Message-Id: <6reea1$he6$1@fep5.clear.net.nz>

>
>If you are literally trying to embed perl into the Win32 code, why?
>
I wrote a win app for the visual manipulation and layout of SGML text. It
seemed to me that I could add very powerful text manipulation to the app by
embedding perl in the app, and using it for scripting.
Also, just because it seemed like a fun thing to try, and the documentation
tells you how it *should* work. (perlembed, perlguts in the docs)

>Perl is portable and high usable in the manner is was designed to be
>used.
seems they designed it so it could be embedded too...










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

Date: 19 Aug 1998 11:52:13 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6ree9d$bir$1@pegasus.csx.cam.ac.uk>

Tushar Samant  <scribble@pobox.com> wrote:
>gbacon@cs.uah.edu writes:
>>	mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
>>:   Greg Bacon <gbacon@cs.uah.edu> wrote:
>>
>>: >O(n + n lg n) is the same as O(n lg n).
>>: 
>>: What's that got to do with Abigail's (correct) statement?
>>
>>It takes O(n) comparisons to check whether a set is already sorted.
>>This is a simple approach, but most modern implementations of quicksort
>>do something to avoid quicksort's O(n**2) worst case.
>
>Sorry, the fact that you are "wrong" follows from the "fact" that
>Big-O should only be used to describe worst case. Average case is
>alas forbidden from aspiring to the full rounded medal of "O".

Why not?    Big-O notation merely describes the form of dependence on
some parameter.    It can be applied to any quantity.  So:

quicksort takes average time O(n*log n) and worst-case time O(n**2).


Mike Guy


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

Date: 19 Aug 1998 11:46:40 GMT
From: "K.Posern" <posern@informatik.uni-marburg.de>
Subject: hmmm...
Message-Id: <35DABAE4.FB8EC6B7@informatik.uni-marburg.de>

Hi.

I wrote a prog. and got a mysterious error. I reduced the code to a
minimum and here it is:
<<<<<<<<<<<<CODE-START (with linenumbers)<
 1:#! /usr/bin/perl -w
 2:
 3:sub foo {
 4:    @Res = (4);
 5:    return $Res;
 5:}
 6:
 7:my @list = ("test");
 8:print "\n1:<@list>\n";
 9:
10:push(@list, foo() );
11:
12:print "\nbla... some code here...\n";
13:
14:print "\n2:<",@list,">\n";
15:
>>>>>>>>>>>CODE-END>

And here is what I GET as Output:

1:<test>

bla... some code here...

2:<testUse of uninitialized value at plato5_test.pl line 14.
>

And here is what I would had EXPECTED as Output:

1:<test>
Use of uninitialized value at plato5_test.pl line 4.
bla... some code here...

2:<testUse of uninitialized value at plato5_test.pl line 14.
>

Because the first use of the uninitialised variable $Res is in line
4...

O.k. you could say " return " does not really USE the Value it
returns... but it was a bit confusing for me to recognize that my fault
was the $Res (instead of $#Res) because Perl first shouted out, when I
used the array in a print...

So is this worth a change in the perl-code so that perl shouts out right
in line 4 ?!

O.k. that's it for now.

bye.

Knuth.



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

Date: Wed, 19 Aug 1998 09:23:42 GMT
From: h.benne@library.uu.nl (Hugo Benne)
Subject: How to clear a filehandle?
Message-Id: <6re5je$dld$1@news2.xs4all.nl>

Yes I'm a newbie, so this question might be very stupid ;-)

Can anybody explain how to open a file, make a backup of it and clear the 
original file before closing it?

Thanx,

Hugo

--------------------------------------------------
Universiteit Utrecht, Faculteit Rechtsgeleerdheid
Juridische Bibliotheek, Afdeling ICT
http://www.library.law.uu.nl/
e-mail: h.benne@library.uu.nl
Postadres: Ganzenmarkt 32, 3512 GE Utrecht
Bezoekadres: Hoogt 13
Telefoon (030) 2537206, Telefax (030) 2538409
--------------------------------------------------


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

Date: Wed, 19 Aug 1998 13:25:00 +0200
From: Bronek Truszkowski <bronel@friko6.onet.pl>
Subject: Re: How to clear a filehandle?
Message-Id: <35DAB60C.E1D99D45@friko6.onet.pl>

HI!

    This question is not stupid, a stupid thing would be to not ask any
questions.
So, the answer:
open(HANDLE,"+<filename.txt")         # now you have opened it to both read
and write (+), and if   the file hadn't existed, the instruction returns an
error (<) you can do whatever you want now (read, and so on), and after that
you move to the beggining of the file

seek(HANDLE,0,0)         # the first zero is the position from the begining,
the second one tells that it's from begining, not from the end :-)

now you can print spaces, or anything else into the file.  If you want just
to clear the file, close it, and open with the instruction:
open(HANDLE,">filename.txt") # this instruction creates new file, and if
existed, it clears it.

So, that's all, I hope you'll enjoy Perl (Two months ago I didn't know there
was something like Perl, so it's an easy language)
BYE!!

Hugo Benne wrote:

> Yes I'm a newbie, so this question might be very stupid ;-)
>
> Can anybody explain how to open a file, make a backup of it and clear the
> original file before closing it?
>
> Thanx,
>
> Hugo
>
> --------------------------------------------------
> Universiteit Utrecht, Faculteit Rechtsgeleerdheid
> Juridische Bibliotheek, Afdeling ICT
> http://www.library.law.uu.nl/
> e-mail: h.benne@library.uu.nl
> Postadres: Ganzenmarkt 32, 3512 GE Utrecht
> Bezoekadres: Hoogt 13
> Telefoon (030) 2537206, Telefax (030) 2538409
> --------------------------------------------------





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

Date: Wed, 19 Aug 1998 08:04:40 GMT
From: dave@mag-sol.com
Subject: Re: I need help with Hello World--Only works when modified to one line separated by black rectangle
Message-Id: <6re0um$m6s$1@nnrp1.dejanews.com>

In article <01bdcb07$4ce61a80$08c7efd1@default>,
  "Glenn Robards" <robards@jps.net> wrote:
> Help;
> How do I get from a simple perl text like this:
> #!/usr/bin/perl
> # Location of the perl program, this is important!!!
>
> print <<__END__;
> Content-Type: text/html
>
> <html><head><title>Hello World</title></head>
> <body bgcolor=#ffffff text=#000000>
> <center><h2>Hello World</h2></center>
> </body></html>
> __END__
>
> To a file that is one line no cr lf with a solid rectangle that replaces cr
> lf
> I tried to look at one of the faqs, but I sure would like help on this. I
> am using JPS.NET that's http://www.jps.net/
> Does anyone know how to accomplish this on JPS.NET ?

Glenn,

I'm guessing that you're developing this code on a Windows machine and then
transferring it to a Unix system to run.

Windows and Unix have different ways of denoting the end of a line in a text
file. Windows uses a carriage return character whereas Unix uses two
characters, a carriage return followed by a newline. When you transfer text
files (and Perl scripts are text files) between the two systems you need to
ensure that the transfer mechanism knows that the files are text files and
carries out the relevant translation.

If you're using FTP to transfer the files, you can do this by setting the
transfer mode to ASCII. If you're transferring things across an NFS mount then
things might be a bit more tricky and you should consult your sysadmin.

hth,

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 19 Aug 1998 10:20:40 GMT
From: simon@whitestar99.demon.co.uk
Subject: IO::Select problem with named pipe
Message-Id: <6re8to$vju$1@nnrp1.dejanews.com>

Hi,

I am experimenting with pipes and I have run into a bit of a problem the
following is a condensed version of my problem script:

------------
my $commandPipe = shift or die "No command pipe given.\n";
open CMD_PIPE, "$commandPipe" or die "Unable to open command pipe: $!.\n";

my $select = new IO::Select( \*CMD_PIPE );

while($select->can_read()) {
  sysread( CMD_PIPE, $char, 1 );
  print "\nRead <$char>";
}
------------

The command pipe is just a pipe I created on the system with 'mkfifo', if I
echo a string and redirect it to the pipe the can_read() returns and
processing of each character proceeds as normal. The problem is it just
carries on trying to read after the end of whatever I have echoed to the pipe
with the sysread returning 0. It is almost as if it blocks the first time but
after the first bit of data comes through it is no longer able to block, do I
need to reset something once I have read all available data from the pipe.

Any help would be appreciated and a copy of the response via email would also
be great.

Simon

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 19 Aug 1998 10:49:19 GMT
From: dgower@ilmioweb.it
Subject: Mailing List Sign up
Message-Id: <6reajf$18b$1@nnrp1.dejanews.com>

Hi all-

I am looking for a mailing list sign up script that I can run on NT for
ListServ.  I have seen many out there, but they all require sendmail or some
other mail server on your system and we are using the ISP for mail.

It seems like it would be simple to just take the email address, the name, and
include the Subscribe and the other information in the body of the message.
Then connect to SMTP server and send it to the list server address, but I have
not found it yet.

Any help is appreciated.  Thanks.

-David...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 19 Aug 1998 09:38:20 GMT
From: serraqi@my-dejanews.com
Subject: Need Help:perl for win32
Message-Id: <6re6eg$stv$1@nnrp1.dejanews.com>

Couple of questions to ask:
1. are there any perl for win32 compilers out there for download?
2. if so name them all please (as well as their sites)
3. recommend a good editor for perl for win32
4. is there a way to create a perl script/program to compile perl

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 19 Aug 1998 11:23:28 GMT
From: "K.Posern" <posern@informatik.uni-marburg.de>
To: serraqi@my-dejanews.com
Subject: Re: Need Help:perl for win32
Message-Id: <35DAB574.1DF88AB9@informatik.uni-marburg.de>

1.:  you mean interpreter ? - a perl-port for win32 ? - if so you can get
if over the www.perl.com => download perl => win32-version from
activestate.com
Or you mean a perl2exe compiler out of which you get a stand-a-lone
executable file (.exe (-ach)) then look at:
http://www.demobuilder.com/perl2exe.htm
It will work fine the the perl-interpreter from activestate.

I use the GWD-Texteditor because of his nice syntax-highlighting,
macro-c-like-scripts-, keymapping-functions, but this is very subjectiv...
there are of course other good editors (like  vedit) but if you once
choosen one and used it for a while you want miss it anymore, because you
get used to it's look and feel...
So if you want it just look at:
http://www.iridis.com/gwd/downloads/index.htm

And don't forget to download the ready to use perl-syntax-highlighting
profile.

I hope this was what you wanted to know.

Bye.

Knuth.


serraqi@my-dejanews.com wrote:

> Couple of questions to ask:
> 1. are there any perl for win32 compilers out there for download?
> 2. if so name them all please (as well as their sites)
> 3. recommend a good editor for perl for win32
> 4. is there a way to create a perl script/program to compile perl
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum





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

Date: 19 Aug 1998 08:19:48 GMT
From: "K.Posern" <posern@informatik.uni-marburg.de>
Subject: Perl for win32: How to catch the STDERR-Stream?? AND How to clear a list??
Message-Id: <35DA8A68.6E95A603@informatik.uni-marburg.de>

Hi.

So 2 more questions:

How do I get the STDERR-stream (in perl_for_win32) "in" my program, so
that I could catch the error-messages where they occur (for example if I
execute a dir *.txt - and there is no .txt file) and so (perhaps) be
able to react on them?!

And another question is on my mind: Is there a solution - neater (?)
than this one: "@foo = ();" to clear a list (e.g. after:
"@foo=(1,2,3);") ?!

Thanks a lot for answering - right now!!

bye.

Knuth.




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

Date: 19 Aug 1998 08:00:23 GMT
From: "elouan" <elouan@usa.net>
Subject: Perl Lex ? Perl Yacc ?
Message-Id: <01bdca35$b462e760$d2dafcc1@none.wonadoo.fr>

hello 
Is there any Perl Lex and Perl Yacc ??

Or How to make Perl handle lexical analysis or Grammar analysis ?

thx 

elouan 


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

Date: 19 Aug 1998 09:40:31 GMT
From: "Uwe Honekamp" <uwe.honekamp@etas.de>
Subject: Re: Perl Lex ? Perl Yacc ?
Message-Id: <01bdcb55$652341b0$931a0180@fe13803>

elouan <elouan@usa.net> wrote in =
<01bdca35$b462e760$d2dafcc1@none.wonadoo.fr>...
> Is there any Perl Lex and Perl Yacc ??

Have a look at the modules Parse::Lex and Parse::RecDescent which
can be found on any CPAN Server.

Regards

Uwe

--

Uwe Honekamp * ETAS GmbH * Borsigstr. 10 * D-70469 Stuttgart =20
uwe.honekamp@etas.de * voice: ++49/(0)711/89661-143 * fax: -107



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

Date: Wed, 19 Aug 1998 08:03:10 +0000
From: Hiram Chirino <chirino@eng.usf.edu>
Subject: perl.h in conflict with qt's qglobal.h
Message-Id: <35DA86BD.1857CDA5@eng.usf.edu>

Here's the scenario:  I'm writing a Qt 1.33 based widget and It's going
to have en embedded perl interpreter.  Problem is that the Qt header
qglobal.h defines a function "debug ( ... )" and perl.h defines an "int
debug".  I come to compile time and, BANG, error.  The simplest
workaround I found was to modify perl.h so that it reads (at about line
1691) :

#ifndef QGLOBAL_H               /* 'debug' breaks Qt's lib */
EXT VOL U32     debug;
#endif

Is there another way around this?  It's going to be a pain in the ass is

I have to apply diffs to perl.h on any system that my widget gets built
on.

By the way, I'm using  perl version 5.004_04 built for i386-linux.

- - - Hiram - - -



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

Date: Wed, 19 Aug 1998 15:48:08 +0800
From: "wlchai" <wlchai@watercolours.com>
Subject: Perlis.dll and SSI
Message-Id: <6re062$j9a$1@news.tm.net.my>

Hi,

I am runing my perl script using perlis.dll which execute .plx files. I need
to run a perl script which required Server Side Incuded environmemt and i
had problems, the eror are as below

HTTP/1.1 200 OK Date: Wed, 19 Aug 1998 07:33:37 GMT Server:
Microsoft-IIS/4.0 Content-type: text/html
'E:\InetPub\wwwroot\Tan\cgi-bin\banner2\ad.shtml' script produced no output

Please help. Thanks in advanced.

Regard
WL Chai




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

Date: 19 Aug 1998 11:47:26 GMT
From: rh10012@cus.cam.ac.uk (R. Hewson)
Subject: Problem with <STDIN> in a script with a DCL wrapper (VMS)
Message-Id: <6ree0e$b8g$1@pegasus.csx.cam.ac.uk>

I am having problems with the script below, it is written
for use on a VMS system i.e it has a DCL wrapper around it.

Can someone explain what is happening (and how to fix it) to STDIN
when I run this script without any command line parameters

Just incase this script works for you the problem I am having is that
the script should stop and wait for input from <STDIN> but it dosn't!

$ perl - DUMMY 'p1
$ deck/dollars="__END__"
#! perl -w

# The following SHIFT is needed because of the problem with hyphon and P1
# being null, the hyphon is interpreted as a continuation line in DCL

shift;

if ($ARGV[0]) {
  print "The command line: $ARGV[0]\n";
} else {
  print "Please enter something? ";
  $_ = <STDIN>;
  print "What you entered: $_\n";
}
__END__
$ write sys$output "Back in DCL!"
$ exit

Thanks for any help

Rees

-- 
[   /----\___  ___  _____\ System Programmer, Administrative Computing Unit,  ]
[  / /_/ / _ \/ _ \/ ___/  \ The Old Schools, University of Cambridge,        ]
[ / __, /  __/  __(__  )     \ Trinity Lane, Cambridge, CB2 1TS (01223 332225)]
[/_/  |_\___/\___/____/ Hewson \ Email: rh10012@cus.cam.ac.uk                 ]


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

Date: Wed, 19 Aug 1998 11:34:20 +0200
From: Philippe MACK <mack@montefiore.ulg.ac.be>
Subject: problems with  system() command
Message-Id: <35DA9C1C.15FAEF98@montefiore.ulg.ac.be>

Hi everybody,

I have some problems with the system keyword; i would like to execute
this shell command :
u/up/mack/bin/plaire/pgm/lfac pb < u/up/mack/bin/plaire/temp/lfac18.drv

If i execute directly on the command line it works without any problem,
but if i include it in a PERL script in the following way :
 
system ("u/up/mack/bin/plaire/pgm/lfac pb <
u/up/mack/bin/plaire/temp/lfac18.drv"),that doesn't work and i got these
messages :
	

dofio: [-1] end of file
logical unit 5, named 'stdin'
lately: reading sequential formatted external IO
part of last data: |
Abort

Has anyone an idea about this ?

Thanks in advance.
-- 
Philippe


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

Date: Wed, 19 Aug 1998 04:29:20 -0400
From: Alejandro Lay <gt2214a@prism.gatech.edu>
To: jkghins@highpoint.net
Subject: Re: Reading from files
Message-Id: <35DA8CE0.CBFD4514@prism.gatech.edu>

A simple solution might be:
Putting a comment line between the sections of your file and then
reading the sections into diferrent arrays ie:

Filename.txt ---
#section 1
Data
#section 2
Data
#section 3
Data
----------------

@section1 = ();
@section2 = ();
@section3 = ();
$sec1count = 0;
$sec2count = 0;
$sec3count = 0;
open (THEFILE, "filename.txt") || print "$!\n";
  while ($_ = <THEFILE>) {
    if (/#section 1/) { $section = 1; }
    elsif (/#section 2/) { $section = 2; }
    elsif (/#section 3/) { $section = 3; }
    else {
      if ($section == 1) { $section1[$sec1count] = $_;$sec1count++; }
      elsif ($section == 2) { $section2[$sec2count] = $_;$sec2count++; }
      elsif ($section == 3) { $section3[$sec3count] = $_;$sec3count++; }
    }
  }
close(THEFILE);

Hell, it's 4:30 am and you're making me think. :)
Alejandro

> I'm in my very early stages of PERL and have come across a little
> stump.  I'm writing to a file on the internet that stores some info
> about a product.  I want to store all of the product info in it's own
> specific file but need to know how to tell the computer that each
> section in the file is a little different and how to pull data from each
> section within the file.  Somehow put labels or something in the file.
> The things I've tried so far haven't worked.  Any help would be great.
> Thanks a lot!


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

Date: Wed, 19 Aug 1998 09:27:01 GMT
From: af137@torfree.net (Al Aab)
Subject: Re: Recommend a good editor
Message-Id: <ExxJL1.LwD.0.queen@torfree.net>

for dos:

slim
or 
terse

i can email slim (5k)

-- 
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator                                      sed u soon 
               it is not zat we do not see the  s o l u t i o n          
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+


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

Date: 19 Aug 1998 11:58:07 GMT
From: scott@softbase.com
Subject: Re: Recommend a good editor
Message-Id: <35dabdcf.0@news.new-era.net>

Zenin (zenin@bawdycaste.org) wrote:
> scott@softbase.com wrote:
> : Since this thread has degenerated into naming editors at random, I have
> : to mention Multi-Edit, my favorite: although it is a commercial
> : product, it is only $100, and has many important features that make it
> : worth the price. The main one is printing support, which Emacs and
> : probably none of the other UNIX ports have in Windows. (Yes, I am aware
> : Emacs can generate PS files, but printing those is convoluted and
> : certainly not as good as File/Print....) 

>         Convoluted?  Does emacs not have a simple way to pipe that
>         output (postscript, text, or otherwise) into lpr...?

Remember, we're talking about Windows. There is no lpr.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 19 Aug 1998 11:18:07 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: reference to anonymous scalar?
Message-Id: <6rec9f$a4k$1@pegasus.csx.cam.ac.uk>

Brett Denner  <Brett.W.Denner@lmco.com> wrote:
>
>Is there a similar way to compose a reference to an anonymous
>scalar? (Yes, I do have a need for such a thing.)
>
>    $scalarref = ????

     $scalarref = \[ 'my_value' ]->[0];


Mike Guy


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

Date: Wed, 19 Aug 1998 03:53:32 -0400
From: Alejandro Lay <gt2214a@prism.gatech.edu>
Subject: Returning an image from a call to a script
Message-Id: <35DA847C.D6544096@prism.gatech.edu>

Hi,

Is there any way to call a perl script from inside an html file
that returns an image that should be placed where the script was called
from? (I lnow this can be done using SSI, but in this case the HTML
file and the script are on two different servers). The other problem is
that the server that runs the script runs perl 5.004 and does not have
the CGI.pm module installed (I don't know why).

The html file looks like this:
<HTML><BODY>
<IMG SRC="http://my.server.com/cgi/script.pl">
</BODY></HTML>

And the script looks like this:
#!/usr/bin/perl
require library.pl;

print "Location: http://my.server.com/images/image.gif\n\n";
&library'incrementCounter();

I've also tried it with a: print "Content-Type: image/gif\n\n";
line in it but it won't work. The script gets called because
the counter is incremented.
I know it can be done because I've seen it in action. Any help solving
this problem would be greatly apreciated.
TIA.
Alejandro


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

Date: Wed, 19 Aug 1998 08:23:16 +0000
From: Hiram Chirino <chirino@eng.usf.edu>
Subject: Re: Returning an image from a call to a script
Message-Id: <35DA8B74.3297B510@eng.usf.edu>

Alejandro Lay wrote:

> Is there any way to call a perl script from inside an html file
> that returns an image that should be placed where the script was called
> from? (I lnow this can be done using SSI, but in this case the HTML
> file and the script are on two different servers). The other problem is
> that the server that runs the script runs perl 5.004 and does not have
> the CGI.pm module installed (I don't know why).
>
> The html file looks like this:
> <HTML><BODY>
> <IMG SRC="http://my.server.com/cgi/script.pl">
> </BODY></HTML>
>
> And the script looks like this:
> #!/usr/bin/perl
> require library.pl;
>
> print "Location: http://my.server.com/images/image.gif\n\n";
> &library'incrementCounter();

Yeah the script gets executed because the the brower requests the script's
output and then tries to load the script's output as an image (at least
the way you have it coded. )  To do what you want to do, you need
something like ePerl, the "Embedded Perl" language
http://www.ch.engelschall.com/sw/eperl/

Hiram



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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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