[11284] in Perl-Users-Digest
Perl-Users Digest, Issue: 4884 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 12 19:07:26 1999
Date: Fri, 12 Feb 99 16:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 12 Feb 1999 Volume: 8 Number: 4884
Today's topics:
Re: \n won't work (Larry Rosler)
choosing start_element() vs. startElement() <ken@bitsko.slc.ut.us>
Re: choosing start_element() vs. startElement() <jglascoe@giss.nasa.gov>
Re: choosing start_element() vs. startElement() (Larry Rosler)
Creating variables from variables <mslade@fidler.co.uk>
Re: Creating variables from variables <sergey@boxhill.com>
Re: Easy Q for a Perl Pro (Dustin Christopher Preuitt)
Help deleting corrupted Unix file <Sam@nospam.com>
Re: Help deleting corrupted Unix file <brett_s_r@hotmail.com>
Re: Help deleting corrupted Unix file <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: How do you get SSI to work? (brian d foy)
Re: How to create a directory using perl on linux? (Eddie Cheng)
Re: How to create a directory using perl on linux? (Tad McClellan)
IP Address of Client Machine <yyy@hotmail.com>
Re: modifying a file in place <indy@NOSPAMdemobuilder.com>
Re: Negative lookahead problem (Tad McClellan)
perl for Solaris 1.1?? <tharold@portal.ca>
Re: Perl function to reboot NT Server? droby@copyright.com
Re: Perl programmers wanted <dont@send.me.nothing>
Re: Perl programmers wanted (brian d foy)
PFR: mkpath (Was: Re: How to create a directory using p (Larry Rosler)
Re: PFR: UTC_to_Epoch (Larry Rosler)
Re: reference problem <jglascoe@giss.nasa.gov>
Re: reference problem <jglascoe@giss.nasa.gov>
retrieving java with pearl (Frank Di Vita)
Re: Simple question for a complex PERLie <jglascoe@giss.nasa.gov>
Re: String Terminator <gala@sonic.net>
Trying to get IP of a client machine <rjsing@hotmail.com>
Re: using perl to talk to oracle database jjds@para-protect.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Feb 1999 13:27:47 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: \n won't work
Message-Id: <MPG.112e3caea52eb72b989a31@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <36C48426.1F49BDA9@hamilton.net> on Fri, 12 Feb 1999 11:42:32
-0800, Bill Garrett <bgarrett@hamilton.net> says...
> So how would i do it if I took out the print "Content-type: text/html\n\n";
> ?
>
> CybnR wrote:
>
> > If you are trying to print this to an html document you need a <br> tag
> > inbetween the lines, \n just makes a new line in the html source.
...
> > Bill Garrett wrote:
> >
> > > #!/usr/local/bin/perl
> > > print "Content-type: text/html\n\n";
> > > print "hello world\n";
> > > print "how come the new line character won't work?\n";
> > > print "I sure wish it would!\n";
> > >
> > > Could someone please tell me why \n doesn't cause this to go onto a new
> > > line. ...
None of this has anything to do with Perl, rather HTML. However...
If you want to see the new-lines without putting in the <BR>s, either
bracket the text with <PRE> and </PRE>, or replace the
print "Content-type: text/html\n\n";
by
print "Content-type: text/plain\n\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 12 Feb 1999 22:39:30 GMT
From: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: choosing start_element() vs. startElement()
Message-Id: <m3pv7g46pz.fsf@biff.bitsko.slc.ut.us>
We've had an issue come up on the Perl-XML mailing list that I'd like
to get a larger group of potential users to comment on.
The background is that the majority of XML toolkit standards have
started using Java as their reference language for creating APIs.
Java's style for method names is mixed-case with initial lower case,
like `startElement()'.
Perl's recommended style, as I'm sure you know, is to use all lower
case seperated with underscores, like `start_element()'.
As we author Perl modules that implement these broader standards it
becomes an issue of whether to use the style given in the reference
implementation (Java usually) or localize it to Perl style.
Please take a moment to think about and comment on issues of
portability of source code and design, consistency of naming within
the XML set of modules and the rest of Perl modules, adherence to
standards vs. localization, and interfacing to other languages through
things like CORBA, RPC, or other bridges.
Thank you,
--
Ken MacLeod
ken@bitsko.slc.ut.us
------------------------------
Date: Fri, 12 Feb 1999 17:50:24 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Ken MacLeod <ken@bitsko.slc.ut.us>
Subject: Re: choosing start_element() vs. startElement()
Message-Id: <36C4B030.F5F1D273@giss.nasa.gov>
[courtesy copy of post sent to cited author, Ken, via email]
Ken MacLeod wrote:
>
<snip>
> like `startElement()'.
>
> case seperated with underscores, like `start_element()'.
<snip>
Ken, words cannot convey my intense feelings of displeasure
for the whole "guessTheCapitalizationOfThisLetter"
game... <shudder>. It's also hard to read. Really.
$ guess_the_capitalization_of_this_letter | Jay > foo
$ cat foo
uhh... lower case, right?
--
"Narf."
-- Pinky
------------------------------
Date: Fri, 12 Feb 1999 15:47:06 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: choosing start_element() vs. startElement()
Message-Id: <MPG.112e5d58e15cad30989a34@nntp.hpl.hp.com>
In article <36C4B030.F5F1D273@giss.nasa.gov> on Fri, 12 Feb 1999
17:50:24 -0500, Jay Glascoe <jglascoe@giss.nasa.gov> says...
...
> Ken, words cannot convey my intense feelings of displeasure
> for the whole "guessTheCapitalizationOfThisLetter"
> game... <shudder>. It's also hard to read. Really.
Especially for people for whom English is not their native language.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 12 Feb 1999 22:55:43 +0000
From: Mark Slade <mslade@fidler.co.uk>
Subject: Creating variables from variables
Message-Id: <36C4B16F.68494CC0@fidler.co.uk>
I've gone through the Lama book and the Camel book and I can't suss this
one out. I want to create a new variable from other variables.
The best way t explain is by an example.
$name = mark
$prefix = cl_
and I want to create a variable called cl_name, and that variable
contain 'mark'
I started out with somthing like:-
$."$prefix"."name" = $name
I've tried double quoting the $prefix, backslashing the dollar, but I
keep getting errors talking about concatenating problems. Is this just
a sytax error, or am I trying to do the impossible.
Any help gratefully received.
Mark Slade
mslade@fidler.co.uk
------------------------------
Date: Fri, 12 Feb 1999 18:55:14 -0500
From: "Sergey Gleizer" <sergey@boxhill.com>
Subject: Re: Creating variables from variables
Message-Id: <7a2f1b$i00$1@news.monmouth.com>
>I've gone through the Lama book and the Camel book and I can't suss this
>one out. I want to create a new variable from other variables.
>
>The best way t explain is by an example.
>
>$name = mark
>$prefix = cl_
>
>and I want to create a variable called cl_name, and that variable
>contain 'mark'
>
>I started out with somthing like:-
>
>$."$prefix"."name" = $name
>I've tried double quoting the $prefix, backslashing the dollar, but I
>keep getting errors talking about concatenating problems. Is this just
>a sytax error, or am I trying to do the impossible.
${$prefix . 'name'} = $name;
or
eval '$' . $prefix . "name = $name";
Or other similar eval kludge.
But why????
---Sergey
------------------------------
Date: 12 Feb 1999 22:19:05 GMT
From: preuitt@ix.cs.uoregon.edu (Dustin Christopher Preuitt)
Subject: Re: Easy Q for a Perl Pro
Message-Id: <7a29cp$osr$1@helix.cs.uoregon.edu>
Thank you to all who replied! It worked great!
and I understand!!
Ka-shu Wong (kswong@bigpond.com) wrote:
: On Fri, 12 Feb 1999, Abigail wrote:
: > ($str = lc $str) =~ s/\((.*))/uc $1/e;
: ($str = lc $str) =~ s/\((.*?)\)/'('.uc $1.')'/eg;
:
: You forgot the ?
: and the g - there might be more than one set of parenthesis...
: oh... and the backslash for the ) too :)
: and the () around the uppercased string... :))
: KS
------------------------------
Date: 12 Feb 1999 21:36:35 GMT
From: Sam <Sam@nospam.com>
Subject: Help deleting corrupted Unix file
Message-Id: <36C49F61.5ADB@nospam.com>
Does anyone know how to delete a corrupted file on a Unix server. I'm
using an FTP program.
The file has a vertical solid black bar at the end of the filename as in
the following: filename|
The FTP programs delete doesn't work on this file. I also manually
entered the command DELE filename| and tried to rename it using RNFR &
RNTO, but the server doesn't recognize the file. I can't seem to use any
Unix commands ie: rm filename| or ls -i. I can only enter raw commands
(DELE, RNFR, RNTO...). Is there a certain way to use Unix commands to
delete this filename? Can I use wildcards? I've tried DELE filename* and
DELE filename? but it also didn't work.
I read the following in a newsgroup, (sounds logical) but couldn't get
it to work:
One possibility is to figure out the inode number of the problem file
(use "ls -i .") and then use find . -inum 12345 -ok rm '{}' \;
or
find . -inum 12345 -ok mv '{}' new-file-name \;
Please respond to this newsgroup and explain the procedure in detail.
(Due to excess spam, I can't post a reply e-mail.)
Thanks,
Sam
------------------------------
Date: Sat, 13 Feb 1999 08:46:12 +1100
From: Brett Randall <brett_s_r@hotmail.com>
Subject: Re: Help deleting corrupted Unix file
Message-Id: <36C4A124.B2C4BA27@hotmail.com>
rm "filename|" works fine for me on bash.
Sam wrote:
> Does anyone know how to delete a corrupted file on a Unix server. I'm
> using an FTP program.
>
> The file has a vertical solid black bar at the end of the filename as in
> the following: filename|
>
<snip>
>
> Thanks,
> Sam
------------------------------
Date: 12 Feb 1999 23:00:50 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Help deleting corrupted Unix file
Message-Id: <83vhh78ep9.fsf@vcpc.univie.ac.at>
Re: Help deleting corrupted Unix file, Sam
<Sam@nospam.com> said:
Sam> Does anyone know how to delete a corrupted file
Sam> on a Unix server. I'm using an FTP program.
Why are you posting this to comp.lang.perl.misc?
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 12 Feb 1999 16:48:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How do you get SSI to work?
Message-Id: <comdog-ya02408000R1202991648530001@news.panix.com>
In article <Pine.SOL.3.96.990212005908.11620A-100000@ux10.cso.uiuc.edu>, seong joon bae <seongbae@students.uiuc.edu> posted:
> I'm trying to get SSI to work.
> I looked at documents for SSI but couldn't find out how to use it.
this is a server configureation issue, so it's better handled in
another group.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 12 Feb 1999 21:20:06 GMT
From: echeng@holmium.CChem.Berkeley.EDU (Eddie Cheng)
Subject: Re: How to create a directory using perl on linux?
Message-Id: <7a25u6$ohi$1@agate.berkeley.edu>
In article <7a20cj$nhc$1@nnrp1.dejanews.com>, <jjds@para-protect.com> wrote:
>The command to make a directory via perl is .... as you should guess
>
>mkdir (DIRNAME, MODE);
I would wish we could do a `mkdir -p x/xx/xxx` in Perl without having
to use the system call... Also not having to specify the MODE each
time would be nice too.
Eddie
------------------------------
Date: Fri, 12 Feb 1999 14:14:36 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to create a directory using perl on linux?
Message-Id: <c322a7.gav.ln@magna.metronet.com>
Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote:
: perl_beginner@my-dejanews.com <perl_beginner@my-dejanews.com> wrote:
: > What is the best way to create a directory using perl effectively/securely
: >in Linux. I intended to use it as a cgi script. Thanks!
: Why don't you have a guess and see if the coudmentation agrees with you.
Guess the same name that you would use in the shell.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Feb 1999 14:23:36 -0800
From: yyy <yyy@hotmail.com>
Subject: IP Address of Client Machine
Message-Id: <36C4A9E8.83662A8@hotmail.com>
I am currently facing a problem in obtaining IP address of a client
machine that is sending a request to my server. I am using
$ENV{REMOTE_ADDR} to obtain the IP address of the client. But what I am
getting is the IP address of the proxy server to which the client is
connected.
Could anyone please suggest if there is a way out to get the actual IP
address of the client.
If possible pls reply at rjsing@hotmail.com
------------------------------
Date: Fri, 12 Feb 1999 17:43:39 -0500
From: "Indy Singh" <indy@NOSPAMdemobuilder.com>
Subject: Re: modifying a file in place
Message-Id: <7a2apj$rk1$1@nntp2.uunet.ca>
Try this approach:
@news = <NEWS>;
shift @news; shift @news; # discard first two lines
close NEWS;
@nichtnews = <NICHTNEWS>;
close NICHTNEWS;
print NICHTNEWS_TMP @news;
print NICHTNEWS_TMP @nichtnews;
close NICHTNEWS_TMP;
--
Indy
www.perl2exe.com
Tools for software developers
Philippe Oesch wrote in message <36C419DB.F02F3797@bluewin.ch>...
>PerlMongers et al.,
>
>how would i get lines 2 to eof of NEWS to the top of NICHTNEWS?
>just got a problem with the following chunk:
>
>while (<NEWS>){
>if (2 .. eof()) {$transfer = $_}
>while (<NICHTNEWS>) {
> if ($. == 1) {
>print NICHTNEWS_TMP $transfer;
>}
>}
>}
>
>
>i am trying to edit the file with a backup copy (as in the perl
>cookbook, recipe 7.8). $transfer seems to be empty in the second while
>statement. stupid me can't fix it right now, err...
>
>could you...?
>
>--
>Philippe Oesch
>PGP Key ID: 0x6F293ADC
------------------------------
Date: Fri, 12 Feb 1999 15:40:42 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Negative lookahead problem
Message-Id: <q472a7.4rv.ln@magna.metronet.com>
Antti Boman (antti.boman***NOSP@M***helsinki.fi) wrote:
: $tmp1="Check http://something.com/ out.";
: $tmp2="Check <a href="http://something.com/">this</a> out.";
: How can substitute the URL in $tmp1 to <a href="http://something.com/">, but
: still, with the same piece of code, not affect $tmp2?
You realize that doing a simulated parse instead of a real
parse is very fragile and easily broken?
You cannot do a real parse with only a regex.
Using one of the HTML::* modules would be much more proper.
But if you want a Dirty Hack instead of Doing It Right,
here you go:
s#([^"])(http://something.com/)([^"])#$1<a href="$2">$3#g;
This will, of course, ignore any in double quotes without regard
to whether or not it appears inside of an anchor tag.
I told you it was dirty :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Feb 1999 15:13:29 -0600
From: Terry Haroldson <tharold@portal.ca>
Subject: perl for Solaris 1.1??
Message-Id: <36C49979.7F8725D4@portal.ca>
Is there a compiled version of perl that will run on Solaris 1.1?
When I run 5.00404, I get:
Cannot execute binary file.
perl: Exec format error
Or am I missing something?
Terry.,
------------------------------
Date: Fri, 12 Feb 1999 21:15:24 GMT
From: droby@copyright.com
Subject: Re: Perl function to reboot NT Server?
Message-Id: <7a25l3$sd7$1@nnrp1.dejanews.com>
In article <7a01hc$lvb$1@client2.news.psi.net>,
abigail@fnx.com wrote:
> \\
> \\ I guess that if there's a way to do it from an NT command line, you could
use
> \\ 'system' to run that command. Maybe someone knows in an NT group?
>
> Any command NT has a certain chance to reboot the machine, hasn't it?
>
Well, yes, but I think he wants a sure thing. Predictable reaults may of
course be difficult on NT. Commands sometimes actually work, and sometimes
they just freeze the machine instead of rebooting, and you have to hit the
power switch.
Which brings to mind a sure-fire method, with some robotics programming on a
second machine (Unix of course). ;-)
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 13:16:52 -0800
From: KC <dont@send.me.nothing>
Subject: Re: Perl programmers wanted
Message-Id: <36C49A44.98B5C845@send.me.nothing>
Martien Verbruggen wrote:
> - We don't talk about PERL here. We talk about Perl and perl.
> Occasionally we talk about the best recipes for baked bananas, but
> mainly about Perl and perl.
I still new to Perl and can't tell if you're joking or not. What's the
differance between PERL, Perl, and perl???
--
-----
KC
------------------------------
Date: Fri, 12 Feb 1999 16:47:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl programmers wanted
Message-Id: <comdog-ya02408000R1202991647140001@news.panix.com>
In article <36C49A44.98B5C845@send.me.nothing>, KC <dont@send.me.nothing> posted:
> Martien Verbruggen wrote:
> > - We don't talk about PERL here. We talk about Perl and perl.
> > Occasionally we talk about the best recipes for baked bananas, but
> > mainly about Perl and perl.
>
> I still new to Perl and can't tell if you're joking or not. What's the
> differance between PERL, Perl, and perl???
PERL - caps lock abberration. some people think Perl is an acronym
and deserves all caps. that's just not so.
Perl - the language itself, as in C, Java, and so on.
perl - the interpreter, as in cc, javac, and so on.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 12 Feb 1999 14:24:42 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: PFR: mkpath (Was: Re: How to create a directory using perl on linux?)
Message-Id: <MPG.112e4a00db2d506f989a33@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7a25u6$ohi$1@agate.berkeley.edu> on 12 Feb 1999 21:20:06
GMT, Eddie Cheng <echeng@holmium.CChem.Berkeley.EDU> says...
> In article <7a20cj$nhc$1@nnrp1.dejanews.com>, <jjds@para-protect.com> wrote:
> >The command to make a directory via perl is .... as you should guess
> >
> >mkdir (DIRNAME, MODE);
>
> I would wish we could do a `mkdir -p x/xx/xxx` in Perl without having
> to use the system call... Also not having to specify the MODE each
> time would be nice too.
OK, so here once again (it is already in DejaNews, of course) is my
function mkpath, this *last* time for the Perl Function Repository.
#!/usr/local/bin/perl -w
use strict;
# mkpath: Create a directory path (like `mkdir -p`).
# Larry Rosler, 12 February, 1999
sub mkpath {
local $_ = shift;
m%(.*)/[^/]*$% and mkpath($1) or return until -d || mkdir $_, 0755;
1 # Success.
}
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 12 Feb 1999 14:12:40 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: PFR: UTC_to_Epoch
Message-Id: <MPG.112e47327d4f1184989a32@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <36C3E784.9B2AC0A4@CompuServe.com> on Fri, 12 Feb 1999
09:34:12 +0100, H.Merijn Brand <PROCURA_BV@CompuServe.com> says...
> Is the PFR for pur perl only or will XS do too?
>
> I've done Larry's UTC function this in an xs module using native mktime ()
> function like:
IMO, XS functions should not be part of the repository. They are C, not
Perl; they require other resources (a capable C compiler); and they may
have portability problems.
> Larry Rosler wrote:
...
> > Documentation is 'good', but test code might not be necessary, to keep
> > the volume down.
>
> If this a 'one-to-one' interface to existing unix functions, unix man
> pages should do :)
But my function UTC_to_Epoch is *not* a one-to-one interface to C's
mktime() function. The latter specifically converts its input
"expressed as local time" to epoch time. I was trying to separate out
the issue of converting local time to and from UTC (which I will submit
to the PFR as a separate function), which different systems may handle
differently (or wrong). Also, UTC has no summer-time-transition
singularities, so it is monotonic, as is epoch time.
The following C program prints 28800, which is 1970-01-01 08:00:00 UTC,
but Your Results Might Vary. So would your Perl interface function. On
the other hand, UTC_to_Epoch(1970, 1, 1) would print 0 wherever it was
run.
#include <stdio.h>
#include <time.h>
static struct tm time_str = { 0, 0, 0, 1, 1 - 1, 1970 - 1900 };
main()
{
printf("%d\n", mktime(&time_str));
}
> > As you can see, the setup and argument checking for this function are
> > trivial but space-consuming. The guts of the algorithm is also
> > 'trivial', but quite inscrutable (to me). Comments, suggestions, and
> > brickbats are welcome, of course!
>
> I've done none whatsoever in above example, couse (HP) doc's said that
> illegal values will be used to calculate legal values:
>
> 32 Jan 1999 = 1 Feb 1999 (Fun isn't it)
So does the ANSI/ISO C Standard. If one wants unchecked ranges, it is
easy to clip or comment the code out of one's own copy of the function.
That's one of the beauties of having all the code fit on a page or so,
without one having to wade through all of a big module.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 12 Feb 1999 15:58:52 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: "Micah G. Cook" <mgcook@ic.delcoelect.com>
Subject: Re: reference problem
Message-Id: <36C4960C.30F896B5@giss.nasa.gov>
"Micah G. Cook" wrote:
>
> @node_list = `cat node_list` ;
no... why? Surely it's best to use
perl's buit-in IO rather than make
a system call...
>
> foreach $line (@node_list) {
> @line = split(/\s+/, $line) ;
>
> if ($line[0] !~ /^#/) {
> $node = $line[0] ;
> @name = $line[0] ;
> $status = "active" ;
> push (@name, $status) ;
> $$node{$node) = @name ;
^ ^
| |
oops! --------/------/
additionally, I think
${$node}{$node} = [@name];
is what you're after.
> }
> }
>
> $test = "koicds02" ; #this is my node name
> print "$$test{$test}\n" ;
symbolic references, blech... how about:
%all_my_nodes = ();
....
foreach
{
...
while
{
...
$all_my_nodes{$node} = [@name];
> ok, this works, but is prints out 2 instead of koicds02 active
>
> this is a reference problem i want it to print out koicds02 active
> instead of the number of elements in the array.
okay,
%foo = %{ $test };
$num = $foo{$test};
>
> please, i donot need a lecture on programming style, this is a quick
> test, it is not my code, i donot want to change my programming style
> to yours.
woops! I can't be expected to read the *whole* post
prior to responding to it! do I.... ;)
> this simply prints out 2
> and i want it to print out koicds02 active
I hear ya man, I really do.
--
"I discount everything Djikstra has to say
because he doesn't actually run his programs"
--Rob Pike, on Djikstra's belief that bugs in
your program are a moral failure to prove your
program mathematically correct.
------------------------------
Date: Fri, 12 Feb 1999 16:08:18 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: jglascoe@giss.nasa.gov
Subject: Re: reference problem
Message-Id: <36C49842.73EE5841@giss.nasa.gov>
[courtesy cc of this posting sent to cited author; Micah]
Jay Glascoe wrote:
>
> "Micah G. Cook" wrote:
> >
AAAAHHHH!!!! I forgot the "[courtesy cc" thing! :-()
anyhoo,
> additionally, I think
>
> ${$node}{$node} = [@name];
>
> is what you're after.
yeah, right. Self-proclaimed guru Jay screws it up again...
It should read like this:
${$node}{$node} = \@name;
the difference is that "[@name]" will actually copy the entire
list "@name" prior to stuffing it into a reference.
--
Fiery Phoenix
Oh seven-record splendor
We will correct you
------------------------------
Date: Fri, 12 Feb 1999 21:17:26 GMT
From: frank@divita.com (Frank Di Vita)
Subject: retrieving java with pearl
Message-Id: <36c49a07.16571906@news.megsinet.net>
i am looking for a method of retrieving java applet information. Does
anyone have any experience using Perl for this. If so, what shouls I
be looking at?
Any help would be appreciated.
Frank Di Vita
------------------------------
Date: Fri, 12 Feb 1999 16:16:53 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Gregg Yows <gyows@globeset.com>
Subject: Re: Simple question for a complex PERLie
Message-Id: <36C49A45.42FEDD8D@giss.nasa.gov>
[courtesy cc of this posting sent to cited author; Gregg]
Gregg Yows wrote:
>
> OK, so it's been awhile since I was a PERLie. But, I'm back in the
> game-feelin' the pain.
:(
> while(<>){
It looks like you're reading from standard in.
Assigning lines implicitly to $_. But I can't
see any reference (implicit or explicit) to $_
in the rest of your code.
> open (TESTPLAN, "testplantest.htm") || die "Can't open
> testplantest.htm\n";
you open your "TESTPLAN" file handle.... but you don't use it!
> if ($a eq "/<tr>\w+<\\tr><tr> <\\tr>/"){
$a ???? ahhhhhhhhh..... ;)
> s/\ /$newstring/g; # I know this line is probably hosed
I've read/re-read your post, but still I just can't divine
the meaning... Give me a rosetta stone?
--
MSDOS was created to keep idiots away from Unix
------------------------------
Date: Fri, 12 Feb 1999 15:17:31 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: Re: String Terminator
Message-Id: <7a2cno$l8u$1@ultra.sonic.net>
I tried this and got the same error. I assume now it must be something else
gone wrong that is making it not go to the end.
Gala
Tony Curtis wrote in message <83aeyjqun4.fsf@vcpc.univie.ac.at>...
>Re: String Terminator, Gala <gala@sonic.net> said:
>
>Gala> I have a script with this in it: print
>Gala> <<"_END_"; </BODY> </HTML> _END_
>
>Gala> when I compile the program it says that the
>Gala> string terminator _END_ couldn't be found
>
>try it as
>
> print <<_EOT_;
> ...
> _EOT_
>
>
------------------------------
Date: Fri, 12 Feb 1999 14:24:58 -0800
From: R J SIngh <rjsing@hotmail.com>
Subject: Trying to get IP of a client machine
Message-Id: <36C4AA3A.9E850BB6@hotmail.com>
I am currently facing a problem in obtaining IP address of a client
machine that is sending a request to my server. I am using
$ENV{REMOTE_ADDR} to obtain the IP address of the client. But what I am
getting is the IP address of the proxy server to which the client is
connected.
Could anyone please suggest if there is a way out to get the actual IP
address of the client.
If possible pls reply at rjsing@hotmail.com
------------------------------
Date: Fri, 12 Feb 1999 20:56:34 GMT
From: jjds@para-protect.com
Subject: Re: using perl to talk to oracle database
Message-Id: <7a24hs$rcd$1@nnrp1.dejanews.com>
Does everything work alright on simple comments. ie a one word string? If
so, then it is a special char problem. If you are only storing the data in
the database for further use with other perl scripts then you can just HEX
pack the info and HEX unpack it later, once you retrieve it from the
database. Otherwise, I would slowly add specical characters until it breaks.
Good Luck,
Jeremiah Sahlberg
Computer Security Engineer
Para-Protect Services, Inc.
jjds@para-protect.com
http://www.para-protect.com
In article <7a1o7r$db3@netline.jpl.nasa.gov>,
psl@euclid.jpl.nasa.gov (Peter Scott) wrote:
> Perhaps your Comments variable contains a single quote.
>
> Get and build DBI and DBD::Oracle so you can talk directly to the
> database instead of these strange circumlocations. They work well,
> and you won't have any problem getting the quoting right after that.
>
> --
> This is news. This is your | Peter Scott, NASA/JPL/Caltech
> brain on news. Any questions? | (psl@euclid.jpl.nasa.gov)
>
> Disclaimer: These comments are the personal opinions of the author, and
> have not been adopted, authorized, ratified, or approved by JPL.
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4884
**************************************