[13301] in Perl-Users-Digest
Perl-Users Digest, Issue: 711 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 3 12:07:22 1999
Date: Fri, 3 Sep 1999 09:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 3 Sep 1999 Volume: 9 Number: 711
Today's topics:
Re: appending one file to another (M.J.T. Guy)
Re: Case insensitive SQL query <hartleh1@westat.com>
Does Perl have regexpr macros? <letsgo_7@lava.net>
Re: Does Perl have regexpr macros? (Bill Moseley)
Re: Does Perl have regexpr macros? <lakerDeleteThisBit@tcp.co.uk>
Re: END blocks and STDERR (Bill Moseley)
File handles, forks, objects and scope sSPAM_ME_NOTjones@icubed.com
Re: glob w/spaces in dir names (M.J.T. Guy)
How do I open a HANDLE to two destination akluyskens@my-deja.com
Re: Image Size in Bytes <gellyfish@gellyfish.com>
Re: IPC::open2 duplicates output (M.J.T. Guy)
Looking for tools. <orret@wmn.net>
Re: Looking for tools. <bowman@montana.com>
Newbie Q: Page redirection based on URL <dobelle@ix.netcom.com>
Re: Newbie Q: Page redirection based on URL <rhomberg@ife.ee.ethz.ch>
Newbie Question... <clavikal@voicenet.com>
Re: Newbie Question... <rhomberg@ife.ee.ethz.ch>
Re: PPT I have a diff XSUB agutier@my-deja.com
Re: printing <flavell@mail.cern.ch>
Re: Problems accessing child package variables <garethr@cre.canon.co.uk>
Re: Q: How to communicate with the serial port? (Bbirthisel)
Re: reference to a partial array, and magic Lvalue!!! (M.J.T. Guy)
Resolving Symbols in Perl - Anybody? <bholness@nortelnetworks.com>
Script to create subshell that sends input/output to a <dsdasilva@earthlink.net>
Socket:: relocation error ... <D.Haywood@btinternet.com>
Re: Socket:: relocation error ... <rhomberg@ife.ee.ethz.ch>
Solaris useradd permission problem with Perl CGI <john@hendigital.com.au>
Re: Solaris useradd permission problem with Perl CGI <rhomberg@ife.ee.ethz.ch>
Re: tee cmd in PERL? <tchrist@mox.perl.com>
Re: tee cmd in PERL? <kenhirsch@myself.com>
Re: tee cmd in PERL? (Matthew Bafford)
Re: That Cargo Date Code ( was Re: Y2K) <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Sep 1999 14:11:13 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: appending one file to another
Message-Id: <7qoku1$k5b$1@pegasus.csx.cam.ac.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
>In article <slrn7srk03.5q7.gyepi@magnetic.praxis-sw.com> on Wed, 1 Sep
>1999 21:13:17 -0400, Gyepi SAM <gyepi@magnetic.praxis-sw.com> says...
>> On Wed, 01 Sep 1999 17:30:34 GMT, marcza@my-deja.com <marcza@my-deja.com> wrote:
>> >If I want to append the contents of one file to another I could do that
>> >by
>> >...
>> > open(OUTF, ">>app.out") || die "Error";
>> > open(WORKFILE, "<in.dat") || die "Error";
>> > print OUTF <WORKFILE>;
>
>...
>
>> All other solutions I can think of are more complex but not necessarily
>> faster.
>
> print OUTF while <WORKFILE>;
>
>works without reading the whole file into memory at once. This may have
>a significant impact if the file is large.
And conversely, when the file *isn't* too large,
{ local $/; print OUTF <WORKFILE> }
should be faster. And a sysread/syswrite loop is probably faster still
and safe against very large files.
Mike Guy
------------------------------
Date: Fri, 03 Sep 1999 10:12:53 -0400
From: HHH <hartleh1@westat.com>
Subject: Re: Case insensitive SQL query
Message-Id: <37CFD765.FCFEA6F3@westat.com>
mrbog@my-deja.com wrote:
> Yes, I did consult the documentation and no it didn't solve my problem.
> All the documentation says is to do something like "LIKE '%joe%'" and
> that doesn't solve my problem.
That's certainly not ALL the documentation says. You didn't look hard
enough. A simple search of the documentation for MySQL 3.23.3
(http://www.tcx.se/Manual/manual.html) found the following section:
-----------------------------
18.14 Case sensitivity in searches
By default, MySQL searches are case-insensitive (although there are some
character sets that are never case insensitive, such as czech). That
means that if you search with col_name LIKE 'a%', you will get all
column values that start with A or a. If you want to make this search
case-sensitive, use something like INDEX(col_name, "A")=0 to check a
prefix. Or use STRCMP(col_name, "A") = 0 if the column value must be
exactly "A".
Simple comparison operations (>=, >, = , < , <=, sorting and grouping)
are based on each character's "``sort value''. Characters with the same
sort value (like E, e and 'e) are treated as the same character!
LIKE comparisons are done on the uppercase value of each character (E ==
e but E <> 'e)
If you want a column always to be treated in case-sensitive fashion,
declare it as BINARY. See section 7.6 CREATE TABLE syntax.
If you are using Chinese data in the so-called big5 encoding, you want
to make all character columns BINARY. This works because the sorting
order of big5 encoding characters is based on the order of ASCII codes.
-----------------------------
If your copy of MySQL does not behave like this, it's time to upgrade.
Henry Hartley
------------------------------
Date: Thu, 02 Sep 1999 11:43:12 -1000
From: David Pautler <letsgo_7@lava.net>
Subject: Does Perl have regexpr macros?
Message-Id: <37CEEF70.1F281544@lava.net>
I have searched the FAQ at www.perl.com and the index of the Camel book.
Does Perl have regexpr macros like those of Lex? For example, I would
like to define this,
word_style ( </?B> | </?I> )
and use it like this:
m| {word_style} (.*?) {word_style} |six
-dp-
------------------------------
Date: Fri, 3 Sep 1999 07:09:27 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Does Perl have regexpr macros?
Message-Id: <MPG.123976716d584f119896fe@nntp1.ba.best.com>
David Pautler (letsgo_7@lava.net) seems to say...
> I have searched the FAQ at www.perl.com and the index of the Camel book.
Now, quickly, on to the documentation!
>
> Does Perl have regexpr macros like those of Lex? For example, I would
> like to define this,
>
> word_style ( </?B> | </?I> )
>
> and use it like this:
>
> m| {word_style} (.*?) {word_style} |six
Take a look at qr// in perldoc perlop and see if that can work for you.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Fri, 03 Sep 1999 15:46:46 +0100
From: Markus Laker <lakerDeleteThisBit@tcp.co.uk>
Subject: Re: Does Perl have regexpr macros?
Message-Id: <1dbPN0Oeag56Ml72w0rXLlD7BxTe@4ax.com>
David Pautler <letsgo_7@lava.net> wrote:
> Does Perl have regexpr macros like those of Lex? For example, I would
> like to define this,
>
> word_style ( </?B> | </?I> )
>
> and use it like this:
>
> m| {word_style} (.*?) {word_style} |six
Perl can do that. Open a document called 'perlre' (it's part of the
documentation that came with your copy of Perl) and find the section
near the bottom called 'Creating custom RE engines'.
Markus
--
Delete the 'delete this bit' bit of my address to reply
------------------------------
Date: Fri, 3 Sep 1999 06:44:56 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: END blocks and STDERR
Message-Id: <MPG.123970af3eedfd759896fb@nntp1.ba.best.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
Rick Delaney (rick.delaney@home.com) seems to say...
> > 2) Should I open() and flock() my file in the END block, or would it be
> > better to open() the file in a BEGIN and then flock and write
> > $log_message in the END block. This would be to catch any STDERR
> > messages that I couldn't capture during the execution of the program.
>
> You can usually get by without locking if your file is opened in append
> mode. It should be sufficient for an error log unless you get lots of
> long errors.
Do you mean without locking at all?
In other words, If I'm going to write a log file _anyway_, and I want
to capture any STDERR output also, I might as sell just open STDERR to a
file first thing in the program with a shared lock.
Since there's buffering in perl and the OS, I can go ahead and write to
STDERR during the program and not worry about locking (because it's
unlikely that someone else would be writing at the same time, and that
the actual write to the file will probably happen on one chunk when the
file is closed -- or when the lock changes). And this way I don't have
to use a $SIG{__WARN__} handler to capture warnings -- just write my
messages to STDERR along with any warnings.
And if I open with a shared lock, I can always ask for an exclusive lock
later, or in another program, and get exclusive access.
Am I on track, or is my lack of sleep making me see things? Or both?
Thanks for the help,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 3 Sep 1999 15:03:14 GMT
From: sSPAM_ME_NOTjones@icubed.com
Subject: File handles, forks, objects and scope
Message-Id: <7qonvi$671@news.icubed.com>
Should I be able to use file handle GLOBs across object
namespaces?
What I've attempted is this:
I have an app that forks a variable number of children and
uses the pipe() command to read from them. What I do is I
loop over wait() in the parent and read what each child
writes as they die. I keep the read handle corresponding to
each child in a hash that indexes on the pid of the dying
child. This works wonderfully until I take the next step...
The plan is to implement the children in a class and things
abruptly stop working when I do. I have verified that the
value of the GLOB for the filehandles are the same for the
parent as for the child. But attempts to dup it:
# in the child object
my $wh = $this->{wh};
open(STDOUT, ">&=$wh) or croak "Can't dupe write handle";
fails. Note that $wh is passed to the child object something
like this:
# in the parent, just prior to forking
$child->{wh} = \*WRITE;
pipe($rh, WRITE) or croak "Can't create pipes: $!";
I didn't resort to this till I tried the class
implementation. In the procedural model, using WRITE in
both the parent and child worked just fine (as expected).
However, WRITE in the child object is a different GLOB than
WRITE in the parent causing (I surmise) the dupe to fail.
And the dupe continues to fail even after I pass the glob
in.
Any ideas on handing the handles in the case where the
forked children are encapsulated in objects?
--
Steve Jones sSPAM_ME_NOTjones@icubed.com
"Outside of a dog, a book is man's best friend. Inside of
a dog, it's too dark to read."
-- G. Marx
------------------------------
Date: 3 Sep 1999 14:49:00 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: glob w/spaces in dir names
Message-Id: <7qon4s$ln2$1@pegasus.csx.cam.ac.uk>
Brian Williams <tuzen@hotmail.com> wrote:
> I'm trying to get a list of files in this directory with:
>
>if ($s eq "Some Folder" )
>{
> @MORE = glob( "$s\\*" );
> print "@MORE\n";
>}
>
> It just prints "Some\n". It works great if I take the space out of the
>dir name, but I think this should work... Am I missing something? I've got
>ActiveState perl on WinNT.
@MORE = glob( "\Q$s\E\\*" );
That works on Unix; dunno about NT.
Mike Guy
------------------------------
Date: Fri, 03 Sep 1999 13:14:50 GMT
From: akluyskens@my-deja.com
Subject: How do I open a HANDLE to two destination
Message-Id: <7qohk0$brb$1@nnrp1.deja.com>
Hi,
Does someone know how to open a filehandle to two different destination
(<STDOUT> and a file). I need the same behavior as the "tee" command.
Thank you for your help
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 3 Sep 1999 15:47:23 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Image Size in Bytes
Message-Id: <37cfdf7b_2@newsread3.dircon.co.uk>
Jimmy Humphrey <jimmy@blackhole-designs.com> wrote:
> I was wondering how it's possible for me to get an "image size" by bytes
> on a CGI upload? I'd like to avoid having to write to the server to get
> the size and then deleting it if it's not the write size.
>
You already posted this question and got several answers.
This is a CGI question really - if you are not happy with the answers
you already have got then you should ask in a more appropriate group.
/J\
--
"I thought homogenous culture was a kind of yogurt used to alleviate
thrush" - Ben Elton
------------------------------
Date: 3 Sep 1999 14:26:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: IPC::open2 duplicates output
Message-Id: <7qolqf$knq$1@pegasus.csx.cam.ac.uk>
In article <FHG0Mu.L0x@csc.liv.ac.uk>, I.J. Garlick <ijg@connect.org.uk> wrote:
[ snip messy solution ]
>It's not pretty but it does work and the only way I ever found of getting
>around the problem. Unless anyone else has a solution?
No need for all that stuff.
The usual solution is to flush all relevant filehandles, as Bill Moseley
pointed out.
Mike Guy
------------------------------
Date: Fri, 3 Sep 1999 06:04:23 -0700
From: "Sidney Orret" <orret@wmn.net>
Subject: Looking for tools.
Message-Id: <7qohbu$grj$1@madmax.keyway.net>
Hello
What are the best enviroment and tools for PERL's programming??????????????
Currently I am using Viotix PERLPad 3.5, and the Programmer's File Editor
1.01, but I am looking for something with more facilities as sintax highligt
for example. Also I am looking for a shareware, and better for a freeware.
Good luck
Sidney
--
+++
************************************************************************
Sidney Orret
Addr: 1444 Via Zurita.
Claremont. CA. 91711-2743.
Phone:1-909-625 8510
Email: orret@wmn.net
************************************************************************
------------------------------
Date: Fri, 03 Sep 1999 07:54:30 -0600
From: bowman <bowman@montana.com>
Subject: Re: Looking for tools.
Message-Id: <37CFD316.D0085A91@montana.com>
Sidney Orret wrote:
>
> Hello
>
> What are the best enviroment and tools for PERL's programming??????????????
Same as any other language: Vim.
Stop by www.vim.org for a free download for the platform of your choice.
Then hit
http://www.etla.net/~n_hibma/vim/
for the latest, greatest Perl syntax file.
--
Bear Technology Making Montana safe for Grizzlies
http://people.montana.com/~bowman/
------------------------------
Date: Fri, 3 Sep 1999 10:27:09 -0400
From: "Dobelle/Avery Laboratories" <dobelle@ix.netcom.com>
Subject: Newbie Q: Page redirection based on URL
Message-Id: <7qomb8$aoi@dfw-ixnews7.ix.netcom.com>
First off, let me say right off the bat that I know >>nothing<< about perl.
From postings to other newsgroups, perl appears to be the way to accomplish
what I need to, so here I am groveling for some direction.
I have one domain, www.abc.com , hosted by an outside company.
I have a second domain name, www.xyz.com, pointed to the same IP address as
the first domain.
This obviously results in both domain names sharing a common index.html
file.
What I need to do is write the index.html file so that it routes the viewer
to a particular page. IE,
If the viewer types www.abc.com, it redirects to www.abc.com/index1.html ,
but if the viewer types www.xyz.com, it redirects them to
www.abc.com/index2.html .
I'm guessing that some combination of GET and POST could get this to work,
but I haven't got a clue where to start.
The server is running Apache (don't know what version) and supports SSI.
All suggestions gratefully appreciated.
Ken
------------------------------
Date: Fri, 03 Sep 1999 17:40:30 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: Dobelle/Avery Laboratories <dobelle@ix.netcom.com>
Subject: Re: Newbie Q: Page redirection based on URL
Message-Id: <37CFEBEE.6059C5CD@ife.ee.ethz.ch>
Dobelle/Avery Laboratories wrote:
> If the viewer types www.abc.com, it redirects to www.abc.com/index1.html ,
> but if the viewer types www.xyz.com, it redirects them to
> www.abc.com/index2.html .
> The server is running Apache (don't know what version) and supports SSI.
I'm pretty sure you can set up Apache, so that
www.xyz.com gives out ~xyz/index.html and
www.abc.com gives ~abc/index.html
No perl needed at all, just configure Apache correctly
- Alex
------------------------------
Date: Fri, 3 Sep 1999 11:40:35 -0400
From: "clavikal" <clavikal@voicenet.com>
Subject: Newbie Question...
Message-Id: <3URz3.506$uq.11352@news2.voicenet.com>
I am completely new to Perl, so please pardon any questions that may seem
stupid, as you will probably be hearing a lot of them ;o).
How can I simply include a .txt file into a perl script ( dynamic-gen web
page ).? i.e. want to include "doc1.txt" residing in /htdocs/docs/doc1.txt
( I'm using Apache )
Thanks,
clavikal
------------------------------
Date: Fri, 03 Sep 1999 17:55:32 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: clavikal <clavikal@voicenet.com>
Subject: Re: Newbie Question...
Message-Id: <37CFEF74.26CBC7D1@ife.ee.ethz.ch>
clavikal wrote:
>
> I am completely new to Perl, so please pardon any questions that may seem
> stupid, as you will probably be hearing a lot of them ;o).
>
> How can I simply include a .txt file into a perl script ( dynamic-gen web
> page ).? i.e. want to include "doc1.txt" residing in /htdocs/docs/doc1.txt
Simply learn perl
perldoc perlop (see I/O Operators)
- Alex
#!/usr/local/bin/perl -w
open BLOPS, "blops" or die; # open file called blops
my @textfile = <BLOPS>; # read all from filehandle BLOPS, one line per
# array element
print @textfile; # feed the complete file to STDOUT
------------------------------
Date: Fri, 03 Sep 1999 14:52:54 GMT
From: agutier@my-deja.com
Subject: Re: PPT I have a diff XSUB
Message-Id: <7qonbv$gci$1@nnrp1.deja.com>
In article <slrn7sr083.bf8.jdporter@min.net>,
jdporter@min.net (John Porter) wrote:
> It sounds very useful. Have you considered uploading it to CPAN?
>
> --
> John Porter
>
Sure, but I think I need some help with this. I would like to provide
an interface to the algorithm that would make sense to people. Before I
were to create a general purpouse module I would want feedback. Can I
submit an alpha? Who do I contact?
I also have a lot of RCS written in Perl, as well as the start of an
XSUB. I'd love to make this all available.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 3 Sep 1999 15:59:35 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: printing
Message-Id: <Pine.HPP.3.95a.990903155503.23956B-100000@hpplus03.cern.ch>
On Fri, 3 Sep 1999 dgold1@my-deja.com wrote:
> Is there a way to include printer control characters in an HTML doc.
If there is then you'll find it in the published HTML specs, not here.
(I can tell you that the published HTML specs say that there isn't).
> need to force page breaks, adjust headers and footers while printing
> some pages.
"Need" (something that is defined to not exist)? "Force" (on a medium
that is well known to not be amenable to force)? You are indeed an
unhappy camper, and until you learn what HTML is, there is no point in
trying to write CGI scripts that are meant to produce it.
> I am using a PERL cgi-script
Well, well. And I expect you're using a keyboard to type it on, so why
not ask comp.hardware.keyboards about it?
> Any ideas?
No, you haven't.
------------------------------
Date: Fri, 3 Sep 1999 15:39:30 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: talexb@tabsoft.on.ca (T. Alex Beamish)
Subject: Re: Problems accessing child package variables
Message-Id: <sik8q8ovgt.fsf@cre.canon.co.uk>
T. Alex Beamish <talexb@tabsoft.on.ca> wrote:
> my @Array;
> @EXPORT = qw ( Array );
First, you can't export a lexically scoped variable. You should write
`use vars qw(@Array)' instead of `my @Array' if you want @Array to be
exportable to code in other lexical scopes.
Second, you're exporting the function `Array', not the array `@Array'.
You should write `@EXPORT = qw(@Array)'.
--
Gareth Rees
------------------------------
Date: 03 Sep 1999 13:39:33 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Q: How to communicate with the serial port?
Message-Id: <19990903093933.01041.00000461@ng-cl1.aol.com>
Hi Jonathan:
>There may be a module available from CPAN that has sufficient abstraction
>to do that in a Platform independent way - but generally you will have
>to do it in the way described in perlfaq8:
>
> =head2 How do I read and write the serial port?
>
>Which will *not* be platform independent.
Two modules on CPAN. One POSIX.pm-based and one for
Win32. The FAQ is seriously out of date on this point (but
TomC was spam-filtering all of AOL the last time I tried to
send a patch). Example script:
======== any_os.plx ===========
#!/usr/bin/perl
#---------------------------------------------------------------------------
# Title:
# Cross-Platform Demo - "use" right module on either Win32 or linux
# Usage:
# perl any_os.plx PORT
# Author:
# Bruce Winter brucewinter@home.net http://members.home.net/winters
#---------------------------------------------------------------------------
# must be LF-only line ends to run on both platforms
use strict;
use vars qw($OS_win);
BEGIN {
$OS_win = ($^O eq "MSWin32") ? 1 : 0;
print "Perl version: $]\n";
print "OS version: $^O\n";
# This must be in a BEGIN in order for the 'use' to be conditional
if ($OS_win) {
print "Loading Windows module\n";
eval "use Win32::SerialPort";
die "$@\n" if ($@);
}
else {
print "Loading Unix module\n";
eval "use Device::SerialPort";
die "$@\n" if ($@);
}
} # End BEGIN
die "\nUsage: perl any_os.plx PORT\n" unless (@ARGV);
my $port = shift @ARGV;
my $serial_port;
if ($OS_win) {
$serial_port = Win32::SerialPort->new ($port,1);
}
else {
$serial_port = Device::SerialPort->new ($port,1);
}
die "Can't open serial port $port: $^E\n" unless ($serial_port);
my $baud = $serial_port->baudrate;
print "\nopened serial port $port at $baud baud\n";
$serial_port->close || die "\nclose problem with $port\n";
undef $serial_port;
======================
Addtional documentation on CPAN with the modules or at:
http://members.aol.com/bbirthisel/alpha.html
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: 3 Sep 1999 15:04:25 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: reference to a partial array, and magic Lvalue!!!
Message-Id: <7qoo1p$mhr$1@pegasus.csx.cam.ac.uk>
John Lin <johnlin@chttl.com.tw> wrote:
>>> Can we get a reference to a partial array?
>
>>No. You can get a reference to one scalar element of an array,
>>but that won't help you.
>
>
>Hey, I've got an idea. Since the following code works
>
>@a=('a'..'z');
>@a[7..10]=('J','I','H','G'); # magic Lvalue!!!
No magic at all. @a[7..10] is a *list* of four lvalues.
>I think it won't be too difficult for Perl to do
>
>$reference= \@a[7..10]; # Sorry, currently not available
Sorry, currently available. In list context, the rhs is a list of
four references. But here we have a scalar context, and we get the
fourth element of the list.
>Hey, what about dangling reference problem?
>
>Currently the following code works,
>
>$x=5;
>$reference= \$x;
>undef $x;
>print $$reference;
What dangling reference? undef $x doesn't cause the variable to
disappear, just its value. And in any case, in Perl reference counting
prevents dangling references.
To find out what's happening in examples like this, it's a good idea to
try them out in the Perl debugger, and print out the various references
so you can see which variable is which:
DB<1> @a = (1..20)
DB<2> x \@a[7..10]
0 SCALAR(0x182358)
-> 8
1 SCALAR(0x182364)
-> 9
2 SCALAR(0x182370)
-> 10
3 SCALAR(0x18237c)
-> 11
DB<3> x scalar \@a[7..10]
0 SCALAR(0x18237c)
-> 11
DB<4> $x = 5
DB<5> x \$x
0 SCALAR(0x185ca4)
-> 5
DB<6> undef $x
DB<7> x \$x
0 SCALAR(0x185ca4) <----------- note same reference as last time
-> undef
DB<8>
Mike Guy
------------------------------
Date: Fri, 3 Sep 1999 16:44:58 +0100
From: "Ben Holness" <bholness@nortelnetworks.com>
Subject: Resolving Symbols in Perl - Anybody?
Message-Id: <7qoqff$b0p$1@bcrkh13.ca.nortel.com>
Hi all,
Is there no-one that knows the answer to this?
Can anyone suggest another group who may have a better idea?
Cheers,
Ben
--
Hi all,
Following a post to comp.infosystems.www.authoring.cgi, which I have
included at the bottom of this post, I would like to ask if anyone knows how
to solve the following problem, which appears in my server error log, when
the script at the bottom of this post is run:
/usr/sbin/httpd: can't resolve symbol 'Perl_markstack_ptr'
/usr/sbin/httpd: can't resolve symbol 'Perl_stack_sp'
/usr/sbin/httpd: can't resolve symbol 'Perl_sv_yes'
/usr/sbin/httpd: can't resolve symbol 'Perl_stack_base'
/usr/sbin/httpd: can't resolve symbol 'Perl_Sv'
/usr/sbin/httpd: can't resolve symbol 'Perl_na'
Many thanks for your help,
Ben
--
Original post to comp.infosystems.www.authoring.cgi follows
Hi all,
I am having a problem with using enctype=multipart/form-data in my forms.
I have a simple HTML file that calls a simple perl file, which prints out a
few lines of text (eventually it will do more than that, which is why I need
CGI).
If I do not have the 'enctype' parameter in the form tag of the HTML file,
everything works OK. However, if I wish to upload files, I realise that I
will require the 'enctype' parameter.
My problem occurs when the 'enctype' parameter is in the form tag. The perl
file only gets as far as printing the "Hello?" out and then nothing happens.
Does anyone know why this is happening, or what I am doing wrong? I am
running Suse Linux 5.3, the Apache server that comes with it and Perl
5.004_04
Cheers,
Ben
HTML file:
<html>
<body>
<form method=POST enctype=multipart/form-data
action="http://192.168.0.2/cgi-bin/upload.pl">
Select File: <input type="file" name="newfile">
Filename: <input name="filename">
Press to: <input type="submit" name="Action" value="Upload">
</form>
Perl file:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title>Adding file</title></head><body>";
print "Hello?";
use CGI;
$query=new CGI;
$file=$query->param('newfile');
$save=$query->param('filename');
print "newfile=$file<br>save=$save<br>It Worked!</body></html>";
------------------------------
Date: Fri, 03 Sep 1999 09:43:45 -0500
From: Dominic Da Silva <dsdasilva@earthlink.net>
Subject: Script to create subshell that sends input/output to a socket
Message-Id: <37CFDEA1.9AACAC21@earthlink.net>
I am trying to write a script to start of a shell (ie take commands and
execute them),
but also have any screen info sent to a socket.
It would be basically like the typescript command, except that out put
will be redirected
to a socket rather than a file.
Any help will be appreciated.
Thanks
-Dominic.
------------------------------
Date: Fri, 3 Sep 1999 10:32:24 +0100
From: "Dave Haywood" <D.Haywood@btinternet.com>
Subject: Socket:: relocation error ...
Message-Id: <7qo4jc$gm8$1@plutonium.btinternet.com>
Hi,
I'd appreciate some help with the following error - ie, what I need to do
to fix it! I have included an example program which causes the crash. I
have read the FAQ and trawled CPAN. Please help!
perl 5.00503. Perl built with no errors and "make test" ran with no
failures.
Solaris 2.6.
Example program (nmsw01 is the local host):
#!/bin/perl
use Socket;
$packed_ip=inet_aton("nmsw01");
printf "IP addr: %s\n",inet_ntoa($packed_ip) if defined ($packed_ip);
NMSW01> perl demo.pl
ld.so.1: perl: fatal: relocation error: file
/opt/gnu/lib/perl5/site_perl/5.005/sun4-solaris/auto/Socket/Socket.so:
symbol __inet_ntoa: referenced symbol not found
Killed
---
Site configuration information for perl 5.00503:
Configured by dhay001 at Thu Sep 2 18:34:49 BST 1999.
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris
uname='sunos nmsw01 5.6 generic_105181-09 sun4u sparc sunw,ultra-1 '
hint=previous, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='gcc', optimize='-O', gccversion=2.8.1
cppflags='-I/opt/gnu/include'
ccflags ='-I/opt/gnu/include'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/opt/gnu/lib'
libpth=/lib /usr/lib /usr/ccs/lib /opt/gnu/lib
libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/opt/gnu/lib'
Locally applied patches:
---
@INC for perl 5.00503:
/opt/gnu/lib/perl5/5.00503/sun4-solaris
/opt/gnu/lib/perl5/5.00503
/opt/gnu/lib/perl5/site_perl/5.005/sun4-solaris
/opt/gnu/lib/perl5/site_perl/5.005
.
---
Environment for perl 5.00503:
HOME=/
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/sbin:/usr/sbin:/opt/gnu/sbin:/opt/local/sbin:/opt/gnu/bin:/usr/bin:/us
r/dt/bin:/usr/openwin/bin:/opt/local/bin:/usr/contrib/bin
PERL_BADLANG (unset)
SHELL=/sbin/sh
------------------------------
Date: Fri, 03 Sep 1999 17:19:29 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: Dave Haywood <D.Haywood@btinternet.com>
Subject: Re: Socket:: relocation error ...
Message-Id: <37CFE701.53CD3525@ife.ee.ethz.ch>
[curtesy email sent, newsgroups reduced]
Dave Haywood wrote:
> Example program (nmsw01 is the local host):
>
> #!/bin/perl
>
> use Socket;
>
> $packed_ip=inet_aton("nmsw01");
> printf "IP addr: %s\n",inet_ntoa($packed_ip) if defined ($packed_ip);
>
> NMSW01> perl demo.pl
> ld.so.1: perl: fatal: relocation error: file
> /opt/gnu/lib/perl5/site_perl/5.005/sun4-solaris/auto/Socket/Socket.so:
> symbol __inet_ntoa: referenced symbol not found
> Killed
This works fine on my systems (Solaris 2.5, perl 5.004 & 5.00503/
Linux, perl 5.00503/Solaris 2.6, perl 5.00503)
on Solaris, inet_ntoa is defined in /usr/lib/libnsl.so
I doubt if anything would work in your system if this wasn't in the
right place and on your dynamic linker path.
Check for it with "nm /usr/lib/libnsl.so|grep ntoa" (which here gives:
[3509] | 237872| 244|FUNC |GLOB |0 |12 |inet_ntoa
[1465] | 0| 0|FILE |LOCL |0 |ABS |inet_ntoa.c
[3218] | 98712| 72|FUNC |GLOB |0 |12 |inet_ntoa_r
Somehow, your perl decided not to look in libnsl.so ???
Something is wrong with your Perl or Solaris setup
- Alex
------------------------------
Date: Fri, 03 Sep 1999 23:43:10 +0800
From: John Hennessy <john@hendigital.com.au>
Subject: Solaris useradd permission problem with Perl CGI
Message-Id: <37CFEC8D.4A29F1E8@hendigital.com.au>
I have written a Perl CGI to take form input and execute the Solaris
"useradd" with the entered values.
I have run the Perl CGI as root and achieve the desired results but when
run via the Web server, Apache's SuExec wrapper ensures that it is not
run with roots permission.
How can I achieve the root execution level that the Solaris "useradd"
insists on ?
John.
------------------------------
Date: Fri, 03 Sep 1999 18:00:02 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
To: John Hennessy <john@hendigital.com.au>
Subject: Re: Solaris useradd permission problem with Perl CGI
Message-Id: <37CFF082.81E48EE3@ife.ee.ethz.ch>
John Hennessy wrote:
>
> I have written a Perl CGI to take form input and execute the Solaris
> "useradd" with the entered values.
>
> I have run the Perl CGI as root and achieve the desired results but when
> run via the Web server, Apache's SuExec wrapper ensures that it is not
> run with roots permission.
>
> How can I achieve the root execution level that the Solaris "useradd"
> insists on ?
use suidperl and set the script to suid root. And make sure you do not
open major security holes.
- Alex
------------------------------
Date: 3 Sep 1999 07:04:33 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: tee cmd in PERL?
Message-Id: <37cfc761@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
akluyskens@my-deja.com writes:
:I need the PERL equivalent of the unix "tee" command to redirect the
:output of a function to <STDOUT> and a FILE(HANDLE). Can anyone help me
:out of this problem.
If you want Unix, you know where to find it.
--tom
--
During the next two hours, the VAX will be going up and down several
times, often with lin~po_~{po ~poz~ppo\~{ o n~po_^G~{o[po ~y
oodsou>#w4k**
n~po_^G~{ol;lkld;f;g;dd;po\~{o
------------------------------
Date: Fri, 3 Sep 1999 09:42:01 -0400
From: "Ken Hirsch" <kenhirsch@myself.com>
Subject: Re: tee cmd in PERL?
Message-Id: <7qojf4$gqi$1@birch.prod.itd.earthlink.net>
Tom Christiansen <tchrist@mox.perl.com> wrote: in message
news:37cfc761@cs.colorado.edu...
> [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
> akluyskens@my-deja.com writes:
> :I need the PERL equivalent of the unix "tee" command to redirect the
> :output of a function to <STDOUT> and a FILE(HANDLE). Can anyone help me
> :out of this problem.
>
> If you want Unix, you know where to find it.
>
> --tom
Only eight responses! What's the matter, aren't TMT8WTDI?
------------------------------
Date: Fri, 03 Sep 1999 14:40:48 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: tee cmd in PERL?
Message-Id: <slrn7svlqj.1ae.*@dragons.duesouth.net>
On 3 Sep 1999 07:03:47 -0700, Tom Christiansen <tchrist@mox.perl.com>
poured coffee onto a keyboard, producing the following in
comp.lang.perl.misc:
: I could tell you
Make up your mind!
:-)
: --tom
--Matthew
------------------------------
Date: 3 Sep 1999 15:45:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: That Cargo Date Code ( was Re: Y2K)
Message-Id: <37cfdf0d_2@newsread3.dircon.co.uk>
George White <aa056@chebucto.ns.ca> wrote:
>
> I expect we will start to see greater reliance on peer review and
> "publishers" like Red Hat to help filter out the junk, much as scientists
> rely on peer reviewed publications.
>
I thought that was part of what this newsgroup is for unfortunately those
reviewed tend to ignore their peers ;-}
/J\
--
"Nourishes at the root and penetrates right to the tip" - Pantene
Advertisement
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 V9 Issue 711
*************************************