[7454] in Perl-Users-Digest
Perl-Users Digest, Issue: 1079 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 25 15:18:39 1997
Date: Thu, 25 Sep 97 12:00:30 -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 Thu, 25 Sep 1997 Volume: 8 Number: 1079
Today's topics:
alarm(n) works but not consistently ..... (Atiqullah Hashmi)
Re: Array or Hash? (Tad McClellan)
Re: cgi data <fearless@io.com>
Re: Convert VB to Perl <russ@mail.org.uk>
Date Algorithm needed (Ed.Q.Bridges)
DB_File gotchas <eedalf@eed.ericsson.se>
extracting between C comments? <jeep@rahul.net>
Re: extracting between C comments? (Tad McClellan)
ftp.pl, lchat.pl, socket.ph <acouch@activevoice.com>
Re: get DOS perl to ignore EOF/SUB chars <fearless@io.com>
Re: how to write HTML form data to a text file??? (Jeremy D. Zawodny)
Re: htpasswd crypt (Jeremy D. Zawodny)
Re: IO::Select and formatted read <sriram@weblogic.com>
Re: Julian Date Routine (Jeremy D. Zawodny)
Re: Julian Date Routine <seay@absyss.fr>
Re: Need Help With Redirect Script <tou@tou.com>
Re: packages -head1 stuff (Mike Stok)
Re: Perl and html problem (Scott McMahan)
Re: Perl crashing RS600 box (Scott McMahan)
perl find (?) <awrobinson@amoco.com>
Re: perl mail on solaris <bruce.albrecht@seag.fingerhut.com>
Re: Perl's pointer (Mike Stok)
Re: Perl's pointer <seay@absyss.fr>
Re: Perl5.004 and Solaris 2.6 (Edward S. Marshall)
Re: Using sockets with WI N95 <jcbuelk@charleston.net>
Re: Using sockets with WI N95 (Jeremy D. Zawodny)
Re: Using sockets with WI N95 (Scott McMahan)
Re: Using sockets with WI N95 (Jeremy D. Zawodny)
Re: What does the . operator do? <russ@mail.org.uk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Sep 1997 12:24:02 -0400
From: hashmi@cnj.digex.net (Atiqullah Hashmi)
Subject: alarm(n) works but not consistently .....
Message-Id: <60e372$4nn@cnj.digex.net>
Hi,
I am using alarm(n) and catching the SIGALRM which works but not
properly always. Actually I am reading a pipe to a child process
and want to interrupt if don't get answer in n secs. Then I reset
it. The idea being that on Unix, a read call is interrupted if
the SIGALRM signal goes off.
Here is how I am doing it:
sub handler {
local($sig) = @_;
print STDOUT "cnt_ns.pl timed out\n";
$gotalarm=1;
alarm(0);
}
#set alarm
$SIG{'ALRM'} = 'handler';
alarm(10);
$gotalarm=0;
.... write next input and read pipe from child process
# reset alarm
alarm(0);
$SIG{'ALRM'} = 'DEFAULT';
if ($gotalarm){
do something ....
}
$gotalarm=0;
Sometimes alarm goes off in 10 secs. but sometime it takes much longer
like minutes on reading the pipe (and I start thinking the
alarm did not work) however, still I see that handler() prints 'timed
out' msg. meaning handler was invoked. I run the above setup in a program
loop, so I need the alarm working at n secs. in every loop run.
So, is it that alarm is working exactly in 10 secs. and somehow
the system is not telling me in time ? OR
I am not setting it right ?
If possible, pls reply directly.
Thx much.
AH
------------------------------
Date: Thu, 25 Sep 1997 09:04:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Array or Hash?
Message-Id: <71rd06.111.ln@localhost>
Martien Verbruggen (mgjv@mali.comdyn.com.au) wrote:
: In article <Pine.LNX.3.96.970923214123.337A-100000@drews.drews.net>,
: Andy Smith <asmith@hsonline.net> writes:
[snip]
: > $n=0;
: my $n = 0;
: > while($n<5)
: > {print AFILE {$services[$n]};
: > ++$n
: while ( $n < 5 ) # $n < $#services might be what you really want
^^^^^^^^^^^^^^^
$n <= $#services
or
$n < @services
: {
: print AFILE $services[$n];
: ++$n;
: }
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 25 Sep 1997 09:19:42 -0700
From: "Creede Lambard" <fearless@io.com>
Subject: Re: cgi data
Message-Id: <60e39s$8ed@news.microsoft.com>
Actually, $id should be a regular expression. The regular expression in this
case happens to be the ID number you're looking for (it expands out to
something like /123456789/ ).
-- Creede
open(BLACKBOARD,"afterschool.txt");
print BLACKBOARD ("I will not get my variables backwards when doing a regex
match." x 100);
============================================================================
================
Tom Phoenix wrote in message ...
>On Wed, 24 Sep 1997, Creede Lambard wrote:
>
>> Try this ($id is the ID number you're checking for):
>>
>> open (DATA,"data.txt");
>
>Even when your script is "just an example" (and perhaps especially in that
>case!) you should _always_ check of the return value after opening a
>file.
>
>> read (DATA,$s,(-s DATA));
>> close DATA;
>>
>> if ($id =~ /$s/) { . . . code to execute if ID matches . . . }
>
>Was that file one giant regular expression? I don't think so. Maybe you
>meant to do that the other way around, but that's still wrong unless $id
>is a regular expression. I think you wanted to capture the return value of
>index(), although it might be better to check one line at a time, if the
>file is large.
>
>Better luck next time! :-)
>
>--
>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: Thu, 25 Sep 1997 18:12:55 +0100
From: Russell Odom <russ@mail.org.uk>
To: Ramon Rodriguez <ramonr@earthlink.net>
Subject: Re: Convert VB to Perl
Message-Id: <342A9B97.F6B20890@mail.org.uk>
[Posted and mailed]
Ramon Rodriguez wrote:
>
> Would appreciate some help in converting this vb code into Perl. I'm
> just
> learning perl and am starting to think that this is going to be a long
> process. Any help would really be appreciated.
[Snip >100k of uuencoded VB code]
OK, in nice easy steps:
1. Learn perl (you can probably do this in conjunction with step 3)
2. Read and understand code
3. Write perl code to do the same thing
Seriously, why on earth did you post so much code? It isn't even perl, and
this (in case you didn't notice) is a _perl_ group. Rather, you should've
posted a URL to the code, or e-mailed it to just those people who
responded saying they were interested in helping you.
Instead, you chose to post it all round the world, using bandwidth (the
message is now copied all round the world on thousands of news servers)
and the online time (=> money) of almost everyone who reads this group.
I think you should read up on some netiquette.
End of flame.
Russ
---------------------------------------------------------------------
--[ R u s s e l l O d o m ]---[ *NEW:* mailto:russ@mail.org.uk ]--
--[ University of York, UK ]---[ http://www.york.ac.uk/~rjo100/ ]--
---------------------------------------------------------------------
--[ FAQ maintainer, news:comp.os.ms-windows.win95.moderated ]--
---------------------------------------------------------------------
------------------------------
Date: Thu, 25 Sep 1997 16:12:52 GMT
From: eqbridges@cbs.com (Ed.Q.Bridges)
Subject: Date Algorithm needed
Message-Id: <342a8a28.268122589@news.spry.com>
hi i've been struggling with this pblm for a few days now. it seems
simple, but has been an awfully gnarly task.
given GMT and a +/- integer offset from GMT and a +/- integer offset
correction for DST, i need to be able to determine the current date
for several different timezones around the world.
what i need is a function equivalent to localtime() that takes a
parameter for a timezone and returns the localtime *at that timezone*
(rather than the machine that the localtime function is running on).
i've explored a couple of different things:
+ running as a cron job hourly, using gmtime(), i obtain the number of
hours since midnite, i then add this to the offset getting the
localtime in hours. i then check the resulting value: if it's equal
to zero, and the offset is negative, it's a new day. else if it's
equal to 24, and the offset is positive, it's also a new day.
The issue with this, though, is that i don't have a record of the
actual date in the local timezone, to check whether or not it's
already been updated (do i even need this???).
+ (this is a speculative question) i'm working on Solaris 2.5, which
has an environment variable TZ. If i can reset this value to another
timezone, then call localtime() will this return the value for that
locale?
anybody have to deal with this sort of thing before? it seems like
such an obvious problem to contend with, and surely there must be a
solution that i can be more confident in.
if possible please cc: your response to eqbridges@cbs.com
many thanks
--ed.bridges--
eqbridges@cbs.com
------------------------------
Date: Thu, 25 Sep 1997 17:51:30 +0200
From: Alexander Farber <eedalf@eed.ericsson.se>
Subject: DB_File gotchas
Message-Id: <342A8882.AB1D48C4@eed.ericsson.se>
Dear colleagues,
i am using DB_File (on Solaris/Sparc; couldnt find out
which version however) for some CGI-scripts and
actually they work now after 2 weeks bleeding.
But i wonder if someone else has experienced same problems:
1) dbopen man page tells, that theres a O_EXLOCK flag,
but it seems not to work for me.
2) Due to Camel (2) book you should store the database
object, then get the file descriptor, then use
that descriptor to open the file handle and then
use that file handle to flock file.
But i am already knowing the file name, so i tried
to skip getting of the file descriptor and got the
file handle via open DB_FH, "+>$file_name"
and the flock-ed it (and flushed with sync() at the end).
Open and flock were not failing, but when i assigned
a value to some hash element other elements were deleted.
Cant understand why?
Greetings
Alex
------------------------------
Date: 25 Sep 1997 17:32:12 GMT
From: California Man <jeep@rahul.net>
Subject: extracting between C comments?
Message-Id: <60e76s$on4$1@samba.rahul.net>
This might be easy, but I cant seem to do it. Im trying to write
a perl utility that will extract code between 'C' style comments.
Id like to either extract the /* and */ or just the text in between.
Anyone know a simple way to do this?
Thanks
jeep@rahul.net
--
------------------------------------------------------------------
http://www.rahul.net/jeep
------------------------------------------------------------------
------------------------------
Date: Thu, 25 Sep 1997 12:59:16 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: extracting between C comments?
Message-Id: <kp8e06.vo1.ln@localhost>
California Man (jeep@rahul.net) wrote:
: This might be easy, but I cant seem to do it. Im trying to write
: a perl utility that will extract code between 'C' style comments.
: Id like to either extract the /* and */ or just the text in between.
: Anyone know a simple way to do this?
One simple way to do this would be to do a Dejanews search for
the thread about this that ran a few days ago ;-)
It had this Subject line:
Subject: How to clear the remark of lang C?
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 25 Sep 1997 18:44:37 GMT
From: "Aaron Couch" <acouch@activevoice.com>
Subject: ftp.pl, lchat.pl, socket.ph
Message-Id: <01bcc9e2$c3650260$491dd8ce@sea-ws0093>
hello everyone!
has anyone used the 2 scripts ftp.pl & lchat.pl to automate some ftp
processes. i'm having some trouble getting them to work.
my source of problem is the file sys/socket.ph .
inside of lchat.pl is the line:
# Only include sys/socket.ph if not already there
my understanding of perl is not really that great yet, so i think i'm
getting a bit confused with exactly what this means.
1) i don't have socket.ph in my perl directory, only socket.pm, this isn't
the right file is it?
2) i saw that to make socket.ph you have to run h2ph, but i couldn't find
h2ph, and didn't exactly understand how to use it. i know it takes
socket.h (is this the socket.h in the standard C++ library?) and produces
socket.ph.
3) where do i need to put socket.ph?
4) is there anything else i need along with socket.ph (e.g. socket.pm)?
5) i'm a bit confused as to the difference between use & require. which
should i use here or does it matter?
i would REALLY appreciate any answers or clarifications of the above... has
anyone used these scripts?
thanks in advance!
-aaron
------------------------------
Date: Thu, 25 Sep 1997 09:37:59 -0700
From: "Creede Lambard" <fearless@io.com>
Subject: Re: get DOS perl to ignore EOF/SUB chars
Message-Id: <60e4c2$4b0@news.microsoft.com>
How did you manage to embed EOF characters in a text file? Never mind. I
don't think I really want to know. :D
This might also work for you, since it uses the LOF that DOS reports:
open(FILE,"myfile.txt") || die "Can't open myfile";
read(FILE,$s,(-s FILE)) # -s returns the LOF
close FILE # so you read the entire
file
# into a string
Now you can play with $s, write it back out to your file or a different
file, or whatever you need to do. I don't know for sure but I suspect
depending on your system this may be faster, since everything happens in
memory and you don't have to go out to disk.
HTH,
-- Creede
Mike Heins wrote in message <60do63$p8v$1@vixen.cso.uiuc.edu>...
>Peter Prymmer (pvhp@forte.com) wrote:
>: Eric Pement wrote:
>: >
>: > I'm using the MS-DOS port of perl v 4.0M4 and 5.003, and have
discovered
>: > that perl stops processing when it finds an EOF char (SUB, Ctrl-Z,
0x1A)
>: > embedded in a textfile. I would like perl to ignore the EOF/SUB
character
>: > and not stop when it encounters it. Any ideas of how to do this with
>: > perl? I'm using 4DOS v5.52 if it means anything. A reply by e-mail,
in
>: > addition to a post to this newsgroup, would be appreciated.
>: >
>: > --
>: > Eric Pement <epement@jpusa.chi.il.us>
>:
>:
>: Did you try either of these?:
>:
>: read FILEHANDLE,SCALAR,LENGTH,OFFSET
>: read FILEHANDLE,SCALAR,LENGTH
>:
>: you might also try the sysopen(), sysread(), sysseek() functions - but
>: they
>: may not be implemented in your DOS port.
>
>And most likely you might want
>
> binmode FILEHANDLE
>
>as well.
>
>--
>Regards,
>Mike Heins
>
>This post reflects the
>opinion of my employer.
------------------------------
Date: Thu, 25 Sep 1997 16:35:57 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: how to write HTML form data to a text file???
Message-Id: <342b91a9.76253136@igate.hst.moc.com>
[cc'd automagically to original author]
On Wed, 24 Sep 1997 16:39:55 -0700, Scott Kahn <scott@netobjects.com>
wrote:
>There are a billion Perl scripts on the Web that capture the contents of
>an HTML form and E-mail them to someone, but what I want to do is to
>take the form contents and append them to a text file sitting on my
>server (I'll later import the data into a database).
>
>I'm running on Solaris with Perl 5. Anyone know of a script that does
>what I need?
Yes, MailMerge does.
http://www-genome.wi.mit.edu/ftp/distribution/software/WWW/mailmerge/
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Thu, 25 Sep 1997 16:39:43 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: htpasswd crypt
Message-Id: <342d93ac.76768266@igate.hst.moc.com>
[cc'd automagically to original author]
On 25 Sep 1997 14:34:31 GMT, dsiebert@gate.net (David Siebert) wrote:
>does anyone have the source to a function that will take a password and crypt
>it into a string that is compatable with htaccess?
In Perl, I assume (or you wouldn't have posted here, right?).
Why not use the crypt() function as documented in the manual pages?
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Thu, 25 Sep 1997 08:57:34 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
To: jdavie2@umbc.edu
Subject: Re: IO::Select and formatted read
Message-Id: <342A89EE.32ECE6D6@weblogic.com>
> I have a question about using the can_read function (from the
> IO::Select module) with formatted I/O. I know that this is a very bad
> combination. I was wondering how the formatted I/O decided where to
> stop (is it using the sysread()?).
If can_read() returns true, the file descriptor is either at end
of file, or *guarantees* that at least one byte is available for
reading.
Now, getline waits for end of line (or whatever the input record
separator ($/) has been set to), and if getline blocks, then
it means not enough characters have arrived. You can force this
with a "flush()" on the other side.
sysread has the same problem (feature, actually). Under ordinary
conditions, it'll wait for the number of characters you have requested,
before returning. In case of errors or an end-of-file condition,
it will return earlier.
(I've covered non-blocking I/O and I/O multiplexing extensively in my
book, mentioned below, so that's one place to take a look. If you
are looking for a code sample, download the examples tarfile and
examine Networking/Msg.pm, a messaging toolkit for building
client-server systems.)
Hope this helps.
- Sriram
_______________________________________________________________________
Principal Engineer WebLogic, San Francisco www.weblogic.com
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/
------------------------------
Date: Thu, 25 Sep 1997 16:42:18 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Julian Date Routine
Message-Id: <342f9453.76935227@igate.hst.moc.com>
[cc'd automagically to original author]
On 25 Sep 1997 15:19:57 GMT, bfogarty@np0337.ford.com (Ben Fogarty)
wrote:
>Any of you GURUs out there have a Julian date routine in perl?
>I need it to evaluate a running log and delete prior to a certain
>date. Julian date works best. I would appreciate same if you
>have it, or a pointer to it's location if you know of one.
Have a look at some of the date/time modules on CPAN. I think you'll
find just what you need.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Thu, 25 Sep 1997 18:11:10 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Julian Date Routine
Message-Id: <342A8D1E.DAF3D5C@absyss.fr>
Ben Fogarty wrote:
>
> Any of you GURUs out there have a Julian date routine in perl?
> I need it to evaluate a running log and delete prior to a certain
> date. Julian date works best. I would appreciate same if you
> have it, or a pointer to it's location if you know of one.
Did Date::Manip not do what you want? And you don't truely mean
"julian" do you? You most likely mean Gregorian year with days into
year (yday) instead of month/day. The Julian calendar starts a long
time before Christ and is only really used in a few domains (astronomy
is one IIRC).
- doug
------------------------------
Date: Thu, 25 Sep 1997 10:09:35 -0700
From: Joel Shellman <tou@tou.com>
To: Eric Neuman <eneuman@halcyon.com>
Subject: Re: Need Help With Redirect Script
Message-Id: <342A9ACF.430A9409@tou.com>
Eric Neuman wrote:
>
> Folks,
>
> I have a dropdown form combobox that lists a variety of websites, and
> I'd like to be able to have a user select a site, hit the "Go" button,
> and be redirected to that site. I've been looking all over for a simple
> PERL script to do this, but haven't been able to find anything yet.
> Does anyone out here know how to do this, or know of any good examples?
> Thanks!
> --
>
> Eric Neuman
> Associate Editor
> Entermedia
> http://www.entermedia.net
You may be better off looking for a Javascript solution to this.
-Joel
--
TaoTree Research and Development
Web Development/Design, Virtual Servers, hosting, Perl/CGI programming
http://www.tou.com/rd/
Revolutionary new clicks-based Banner Exchange Guarantees you traffic
http://www.tou.com/ite/
------------------------------
Date: 25 Sep 1997 16:47:11 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: packages -head1 stuff
Message-Id: <60e4if$38q@news-central.tiac.net>
They are POD (plain old documentation) documents. The command
perldoc perlpod
on a full installation of a recent perl should produce the docs on pod:
PERLPOD(1) User Contributed Perl Documentation PERLPOD(1)
NAME
perlpod - plain old documentation
DESCRIPTION
A pod-to-whatever translator reads a pod file paragraph by
paragraph, and translates it to the appropriate output
format. There are three kinds of paragraphs:
o A verbatim paragraph, distinguished by being indented
(that is, it starts with space or tab). It should be
reproduced exactly, with tabs assumed to be on
8-column boundaries. There are no special formatting
escapes, so you can't italicize or anything like that.
A \ means \, and nothing else.
o A command. All command paragraphs start with "=",
followed by an identifier, followed by arbitrary text
that the command can use however it pleases.
Currently recognized commands are
=head1 heading
=head2 heading
=item text
=over N
=back
=cut
=pod
=for X
=begin X
=end X
The "=pod" directive does nothing beyond telling the
compiler to lay off parsing code through the next
"=cut". It's useful for adding another paragraph to
the doc if you're mixing up code and pod a lot.
etc.
Hope this helps,
Mike
In article <342A8708.3D75@daytonoh.ncr.com>,
Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com> wrote:
>I have written my 1st library module and it works fine but I do have a
>question.
>
>When looking at the .pm files that were installed with Perl, i see lines
>that have stuff in them that looks like the following
>
>=head1 NAME
>
>Blah Blah
>
>=head1 SYNOPSIS
>
>Blah Blah
>
>=head1 DESCRIPTION
>
>Blah Blah
>
>=cut
>
>I can see that they document the code but where can I find out about
>these =headX lines ?
>
>Also, is there some software that recognizes them and prints a report or
>something ??
>
>I have all of the Perl books (Camel, llama & panther) but I can not find
>any reference to these =headX lines in them.
>
>Thank You
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 25 Sep 1997 16:32:33 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Perl and html problem
Message-Id: <60e3n1$vv$3@mainsrv.main.nc.us>
Robbert Uittenbosch (robbert@bicho.eui.upm.es) wrote:
: At this moment I'm developing an internet site which uses perl as cgi.
: Everytime I open the site I get the following errormessage :
: 500 internal server error.
: Or I get the contents of the perlscript.
: I have tried everything that I could think of, but it still fails.
Here is the three step cure to CGI problems with Perl:
1. Run it from the command line first, then do a -w. Amazing what
that'll turn up.
2. If it still crashes, make this the first line of the
program:
print "Content-type: text/html\n\n<html><body><pre>"
This is your magic debug mode. Anything the script emits will
look like a terminal printout.
3. If #2 still doesn't make it work, your server/CGI directory/perl
program in improperly configured. Check the server config, file
permissions, etc.
Scott
------------------------------
Date: 25 Sep 1997 16:28:39 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Perl crashing RS600 box
Message-Id: <60e3fn$vv$2@mainsrv.main.nc.us>
Michael McCrann (mccrann_michael@jpmorgan.com) wrote:
: A perl script I was running on my RS6000 AIX3.2 server caused the server
: to crash. Can anyone tell me how I can report this bug and find out if it
: can be fixed.
I've used a RS6000 for two years, and Perl on it a lot, and have never
seen it crash for any reason short of catastrophic things like complete
power failures. I am incredulous that a Perl script could in any way
crash a RS6000. For all the weird things about its strange version of
UNIX, it is a rock solid OS. I think you need to investigate
possible other causes of the crash.
Scott
------------------------------
Date: Thu, 25 Sep 1997 12:29:03 -0500
From: "Andrew W. Robinson" <awrobinson@amoco.com>
Subject: perl find (?)
Message-Id: <342A9F5F.D9E90EB0@amoco.com>
Hi all,
I have an application where I need to generate a list of
files with fully qualified paths. The files are scattered
through many subdirectories within the directory tree and
at varying levels. I know how to generate the list using
the UNIX find command:
find $startdir -name \*.RAS -print
In my perl application, I actually used this find command to
generate the list:
open( FPIPE, "find $startdir -name \*.RAS -print |" );
Is there a built-in perl way to accomplish this? I looked at
the glob function, but I could not find an example or guess
the syntax to make it work.
Thanks!
Andrew Robinson
--
Offshore Business Unit email: awrobinson@amoco.com
Amoco Corporation phone: (504) 586-6888
New Orleans, LA fax: (504) 586-2637
-----
The events depicted herein are fictional. Any similarity to
persons living or dead is entirely...oops, wrong disclaimer
------------------------------
Date: 25 Sep 1997 12:27:23 -0500
From: Bruce Albrecht <bruce.albrecht@seag.fingerhut.com>
Subject: Re: perl mail on solaris
Message-Id: <gdiuvptibo.fsf@seag.fingerhut.com>
gbacon@adtran.com (Greg Bacon) writes:
>
> In article <memo.19970924062231.21497A@skep.compulink.co.uk.cix.co.uk>,
> neilb@zetnet.co.uk (Neil Briscoe) writes:
> : The quick solution to this is to use
> : open (DOMAIL, "| mail -s \"${MailSubject}\" $Mailto");
>
> That breaks when the shell peers through its beady little eyes, sees
> a shiny trinket like a $, and goes to grab it. Better to use single
> quotes:
>
> open DOMAIL, "| mail -s '${MailSubject}' $Mailto"
> or die "$0: Failed fork: $!\n";
>
> because it works with single- or multi-word subjects.
Even better is to use:
open(DOMAIL, "|-") || exec("/bin/mail", "-s", $MailSubject, $Mailto);
and then the shell never gets a chance to play with any arguments
anyway. Of course, if you're really paranoid, you can look at
perlipc.pod to see the safe pipe open, which will die if the fork or
exec fails.
------------------------------
Date: 25 Sep 1997 16:06:32 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Perl's pointer
Message-Id: <60e268$16f@news-central.tiac.net>
In article <342A86F6.7137@nortel.ca>, Sijun Zeng <sijun@nortel.ca> wrote:
>Hi,
>
>Is there any "pointer" in Perl. Like
>
> $a= $b;
> $b=1;
> print "$a";
>
>I'm expecting $a become 1, how I can do this?
You can use references in perl 5, they can be viewed as typed pointers
e.g.
$b = \$a; # $b is a reference to $a
$$b = 1; # no automatic dereference in perl, $$b is the
# scalar referd to by $b
print "$a\n"; # prints 1 and a new line
You can also use soft or symbolic references (if strict refs aren't
being enforced) e.g.
$b = 'a'; # $b contains the name of $a
$$b = 1; # sets $a
Or you can use type globs e.g.
*b = *a;
effectively makes b an alias for a, so $b is an alias for $a, @b is an
alias for @a etc.
Note that soft references and type globs work foir variables with symbol
table entries, (i.e. global and "local" variables) and hard references
work for lexical variables as well.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Thu, 25 Sep 1997 18:20:03 +0200
From: Doug Seay <seay@absyss.fr>
To: Sijun Zeng <sijun@nortel.ca>
Subject: Re: Perl's pointer
Message-Id: <342A8F32.16711EB@absyss.fr>
[posted and mailed]
Sijun Zeng wrote:
>
> Hi,
>
> Is there any "pointer" in Perl. Like
>
> $a= $b;
> $b=1;
> print "$a";
>
> I'm expecting $a become 1, how I can do this?
What you are asking for is an alias, not a pointer. Perl doesn't
support aliasing too much (there is some magic using it, but not under
your control). You can't do that in C either.
Perl does have references, a pointer like mechanism. I'll let you read
the docs yourself to find out how this is done. "man perl" would be a
good start.
- doug
------------------------------
Date: 25 Sep 1997 18:14:08 GMT
From: emarshal@xnet.com (Edward S. Marshall)
Subject: Re: Perl5.004 and Solaris 2.6
Message-Id: <60e9lg$9mm$1@flood.xnet.com>
On Tue, 23 Sep 1997 13:03:50 -0600, Steve Wolfe <NerveGas@nospam.inconnect.com> wrote:
>> >I'm trying to get Perl5.004 to compile on a sparc machine running
>> >Solaris 2.6. I'm using the GCC 2.7.2.3 compiler on that machine
>> >(I don't want to install the SunSoft C compiler on that machine).
>
> If at all possible, I would install Sun's compiler, especially if it
>is Solaris for Sparc. Sun's compiler can optimize your binary much,
>much more than GCC will. If it were a simple cgi program that would get
>little use, it wouldn't matter... but as often as Perl can get used, the
>optimization can really pay off in performance.
Actually, now I'm interested. Has anyone done any real analysis of this
idea (that GCC produces slower or more memory-hungry code than Sun's
compiler), possibly using Perl as a testbed platform?
--
.-----------------------------------------------------------------------------.
| Edward S. Marshall <emarshal@xnet.com> | Systems/Network Administrator, |
| http://www.xnet.com/~emarshal/ | XNet Information Systems, Inc. |
`-----------------------------------------------------------------------------'
[ Are you a spammer looking for a great opportunity to be blacklisted? Then ]
[ have your automatic bots email spam@logic.net and secure a spot on my list! ]
------------------------------
Date: Thu, 25 Sep 1997 11:26:27 -0400
From: John Buelk <jcbuelk@charleston.net>
Subject: Re: Using sockets with WI N95
Message-Id: <342A82A3.258E@charleston.net>
Giorgio Ingrassia wrote:
>
> Hi everyone,
> looking for a little help.
> I've been writing a set of PERL scritps under UNIX using
> sockets to open a connection to a WEB server, send a request
> and manage the reply.
> Everything's OK so far.
> When I try to use them under WIN95 the connection won't open
> and PERL doesn't tell me much about the reason.
> I've been told that sockets work fine under NT4.0.
> Is this a WIN95 problem?
> Anyone under the sun who came across such a problem?
>
> I'm using PERL for WIN32 version 5.003_07 Build 310.
>
> Thank in advance.
>
> Giorgio
Are you using the Domain Name or the IP address to create the socket? If
I'm not mistaken, you need to use the IP address for Win95.
--
Have a great day!
John Buelk
CNI, MCNE, NCIP
Network Systems Management Department
Trident Technical College
------------------------------
Date: Thu, 25 Sep 1997 16:38:17 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Using sockets with WI N95
Message-Id: <342c9349.76669144@igate.hst.moc.com>
[cc'd automagically to original author]
On Thu, 25 Sep 1997 13:30:52 +0200, Giorgio Ingrassia
<giorgio@lii.unitn.it> wrote:
>I'm using PERL for WIN32 version 5.003_07 Build 310.
There have been reported problems with sockets in that build. I've
heard that they're mostly corrected in the 311 build.
You may also want to try the native 5.004 port for Win32.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 25 Sep 1997 16:26:02 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Using sockets with WI N95
Message-Id: <60e3aq$vv$1@mainsrv.main.nc.us>
Giorgio Ingrassia (giorgio@lii.unitn.it) wrote:
: When I try to use them under WIN95 the connection won't open
: and PERL doesn't tell me much about the reason.
: I've been told that sockets work fine under NT4.0.
: Is this a WIN95 problem?
: Anyone under the sun who came across such a problem?
I've used sockets for over a year under Windows 95, both on the client
and server end, and never had any problems at all. They work identical
to Perl on UNIX. One of my major Perl programs is an automated backup
system that e-mails me what it does at night.
I suspect the error is in your code. If Perl doesn't tell you much, try
to coax more out of it by using $! and -w. Also, you *are* on
an ethernet-TCP/IP network with a properly configured machine,
right?
Scott
------------------------------
Date: Thu, 25 Sep 1997 17:09:10 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Using sockets with WI N95
Message-Id: <34309a7c.78512264@igate.hst.moc.com>
[cc'd automagically to original author]
On 25 Sep 1997 16:26:02 GMT, scott@lighthouse.softbase.com (Scott
McMahan) wrote:
>I suspect the error is in your code. If Perl doesn't tell you much, try
>to coax more out of it by using $! and -w. Also, you *are* on
>an ethernet-TCP/IP network with a properly configured machine,
>right?
Perl sockets work on my Token Ring (TCP/IP) network, too. Not to
mention dial-up ISDN, standard analog, and so on... :-)
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Thu, 25 Sep 1997 17:44:47 +0100
From: Russell Odom <russ@mail.org.uk>
Subject: Re: What does the . operator do?
Message-Id: <342A94FF.ED648E9F@mail.org.uk>
Nate wrote:
>
> what exactly does the . operator do.. for instance:
>
> $data{'new_item'} .="; " if $data{'new_item'};
Concatenates strings.
RTFM.
In this case TFM to R is 'perldoc perlop'.
HTH,
Russ
---------------------------------------------------------------------
--[ R u s s e l l O d o m ]---[ *NEW:* mailto:russ@mail.org.uk ]--
--[ University of York, UK ]---[ http://www.york.ac.uk/~rjo100/ ]--
---------------------------------------------------------------------
--[ FAQ maintainer, news:comp.os.ms-windows.win95.moderated ]--
---------------------------------------------------------------------
------------------------------
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 1079
**************************************