[12595] in Perl-Users-Digest
No subject found in mail header
daemon@ATHENA.MIT.EDU (John Stanley)
Fri Jul 2 01:17:28 1999
Date: Thu, 1 Jul 1999 22:06:32 -0700 (PDT)
From: John Stanley <stanley@ruby.OCE.ORST.EDU>
To: perlusers-hutyt@ruby.OCE.ORST.EDU
Return-Path: <Perl-Users-Request@ruby.oce.orst.edu>
Precedence: bulk
From: Perl-Users Digest <Perl-Users-Request@ruby.oce.orst.edu>
To: Perl-Users@ruby.oce.orst.edu (Perl-Users Digest)
Subject: Perl-Users Digest, Issue: 3 Volume: 9
Message-Id: <930891992-v9-i3@ruby.oce.orst.edu>
Perl-Users Digest Thu, 1 Jul 1999 Volume: 9 Number: 3
Today's topics:
Re: Perl or PNP...which is better? <danielrod@nts.co.jp>
Re: Perl or PNP...which is better? <danielrod@nts.co.jp>
Re: Perl Problem with Netscape, but not lynx... <palincss@his.com>
Re: Perl Problem with Netscape, but not lynx... (Abigail)
Re: Picture doesn't appear (Abigail)
Re: Picture doesn't appear (Abigail)
Re: q qq or qw <cyberjeff@sprintmail.com>
Re: q qq or qw <tchrist@mox.perl.com>
reading log files <jaimedp@pacbell.net>
Re: reading log files (Martien Verbruggen)
Re: reading log files <jaimedp@pacbell.net>
Re: regex to match nested paranthesis <calciii@my-deja.com>
Re: regex to match nested paranthesis <calciii@my-deja.com>
return value from inside foreach <r28629@email.sps.mot.com>
Re: return value from inside foreach <rick.delaney@home.com>
Re: returning a hash from a function <derek@realware.com.au>
Re: returning a hash from a function <derek@realware.com.au>
Re: Robot email/poster (new proposal) <gt7202e@prism.gatech.edu>
Re: Robot email/poster for this group <keithmur@mindspring.com>
Re: rough time with files <uri@sysarch.com>
Script Wanted (POP/Web) (Joe Zobkiw)
Re: Script Wanted (POP/Web) (Martien Verbruggen)
Second Try: Perl Sockets Problem kennedy_clark@my-deja.com
Send HTML command to a browser, easy but problems!!! dtillaud@hot=
mail.com
Re: Socket error : Prototype not supported <ppith@my-deja.com>
Re: strange regex behaviour - don't understand what's g <rick.delaney=
@home.com>
Re: Top 10 responses to the Robot/email idea nospam@domain.com
Try this! (5.00404 - 5.00503 I think) ()
Re: Try this! (5.00404 - 5.00503 I think) <rick.delaney@home.com>
Trying again (Joan Richards)
Re: unix passwd auth in CGI <hiller@email.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest=
Admin)
----------------------------------------------------------------------
Date: Fri, 02 Jul 1999 02:11:36 GMT
From: Daniel <danielrod@nts.co.jp>
Subject: Re: Perl or PNP...which is better?
Message-Id: <7lh74h$v34$1@nnrp1.deja.com>
Thanks for your response. Yes, that was mistake on my part. I mean to
say PHP. Thanks for pointing that out.
> Are you asking about "future market potential" for yourself?
I am referring more to the future demand of such programming skills by
employers, along with the long term prospects for solving real-life
business problems.
In article <7l9civ$e10$1@Starbase.NeoSoft.COM>,
claird@Starbase.NeoSoft.COM (Cameron Laird) wrote:
> In article <7l98ue$2kt$1@nnrp1.deja.com>, Daniel
<danielrod@nts.co.jp> wrote:
> >I am a beginning programmer, interested in web programming. I have
> >read much about Perl, mod_perl, PNP, Java servlets, ASP, etc.
> >
> >I am interested in knowing which might be the more beneficial tool to
> >learn, coming from a "no previous experience" background. I.e., If I
> >am not a Perl programmer, and I am not a PNP programmer, which has
the
> >best future potential? (both technical and careerwise)
> >
> >Please understand that I am a student, not an IT manager, and hence I
> >am trying to get a feel for future market potential, not trying to
> >solve a particular real-live IT problem.
> >
> >Insofar as Perl is concerned, lets assume mod_perl, so as to put it
on
> >an equal field as PNP.
> .
> .
> .
> I assume your question is about PHP, not PNP.
>
> Are you asking about "future market potential" for yourself?
> We'd need to know more about you. The cheap answer is that
> Perl is likely to outlive PHP, but it's hard to know how that
> relates to your career.
>
> Technical comparisons of the two languages appear in <URL:http://
>
starbase.neosoft.com/~claird/comp.lang.misc/language_comparisons.html#sc
ripting>
>
> Learn 'em both. College's good time for that.
> --
>
> Cameron Laird http://starbase.neosoft.com/~claird/home.html
> claird@NeoSoft.com +1 281 996 8546 FAX
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 02 Jul 1999 02:57:59 GMT
From: Daniel <danielrod@nts.co.jp>
Subject: Re: Perl or PNP...which is better?
Message-Id: <7lh9rj$vv0$1@nnrp1.deja.com>
My apologies to all for creating a monster! It's PHP, not PNP!!! (A
mere mistype!) ...but a small glimpse into the inherent pitfalls of
using acronyms as a logical naming convention!
Well, at least I learned what PERL stands for.
--Daniel
"The difference between the right word and an almost right word is like
the difference between lightning and the lightning bug."
--Benjamin Franklin
In article <7l98ue$2kt$1@nnrp1.deja.com>,
Daniel <danielrod@nts.co.jp> wrote:
> I am a beginning programmer, interested in web programming. I have
> read much about Perl, mod_perl, PNP, Java servlets, ASP, etc.
>
> I am interested in knowing which might be the more beneficial tool to
> learn, coming from a "no previous experience" background. I.e., If I
> am not a Perl programmer, and I am not a PNP programmer, which has the
> best future potential? (both technical and careerwise)
>
> Please understand that I am a student, not an IT manager, and hence I
> am trying to get a feel for future market potential, not trying to
> solve a particular real-live IT problem.
>
> Insofar as Perl is concerned, lets assume mod_perl, so as to put it on
> an equal field as PNP.
>
> Thanks to all!
>
> --Daniel
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 19:59:23 -0400
From: Steve Palincsar <palincss@his.com>
To: illiath@my-deja.com
Subject: Re: Perl Problem with Netscape, but not lynx...
Message-Id: <377C00DB.F613CB0F@his.com>
illiath@my-deja.com wrote:
>=20
> I'm just starting to learn perl/cgi programming, and I've got a small
> problem here.
>=20
> I have written a small script (it doesn't do all it's supposed to do bu=
t
> that's not important really), and it displays fine (when using lynx),
> but netscape refuses to display it at all.
Rubbing up my crystal ball I gather the "it" in this question is
some kind of HTML page generated by your CGI script. I also gather
that Netscape doesn't display your page, but when you "view source"
you see your code there.=20
If so, I would immediately suspect some kind of table coding error
in your HTML.
Perhaps you should try running your CGI script at the command
line, redirecting output to a file. Then examine the file,
and feed it to HTML tidy, which you can obtain from www.w3.org,
from Bill Raggett's page. This will report on coding errors
and fix them. It's a useful tool in any event, since it does
a very nice job removing MS botched HTML crap.
> I'm not sure whether this is just a problem with netscape, or whether m=
y
> code is faulty, and unfortunately as I am posting this from deja I am
> unable to attach the script... so... umm.. yeah...
Oh, it's a pretty safe bet that it's your code... ;-)
> Everything else seems to be saying it is fine, If I ask netscape to
> display the source of the page (the output from the script), it display=
s
> the source code properly.
What is "it" that is fine? Your script can run perfectly well, but=20
produce faulty HTML code, and I'm pretty sure that's exactly what
is happening.
> I can't see what's causing this problem as I've based the script on a
> lot of example scripts I've seen, or got here, and the initial headers
> appear fine in comparison.
Problems with the headers would generate an error, not a page that
doesn't display. That's almost always a table coding problem, in
my experience, for what that's worth.
> As I say, lynx works fine (I have not been able to check it with IE as =
I
> only have the one machine <grin>).
Phrasing it this way is directing your attention in the wrong
direction.
Perhaps you should say "lynx has no problem displaying my HTML, but it
appears as though Netscape does." This focuses you on your code not
on
the browser. Good code will display on all browsers. And you may
take
that to mean that IMO code that requires one specific browser (e.g.,
Internet Explorer) to display correctly is bad code, no matter how
well
it displays on IE. But that's a value judgment...
HTH
------------------------------
Date: 1 Jul 1999 19:01:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Problem with Netscape, but not lynx...
Message-Id: <slrn7no09h.31h.abigail@alexandra.delanet.com>
illiath@my-deja.com (illiath@my-deja.com) wrote on MMCXXX September
MCMXCIII in <URL:news:7lf030$4m1$1@nnrp1.deja.com>:
$$=20
$$ Hope someone can tell me what I am doing wrong here.
You're posting in the wrong newsgroup. I suggest going to a group
about browsers, as you seem to have a browser issue. Or perhaps
you can call Netscape tech support.
Abigail
--=20
sub _'_{$_'_=3D~s/$a/$_/}map{$$_=3D$Z++}Y,a..z,A..X;*{($_::_=3Dsprintf+q=3D=
%X=3D=3D>"$A$Y".
"$b$r$T$u")=3D~s~0~O~g;map+_::_,U=3D>T=3D>L=3D>$Z;$_::_}=3D*_;sub _{print=
+/.*::(.*)/s}
*_'_=3D*{chr($b*$e)};*__=3D*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))=
))))))
-----------=3D=3D Posted via Newsfeeds.Com, Uncensored Usenet News =3D=3D=
----------
http://www.newsfeeds.com The Largest Usenet Servers in the World=
!
------=3D=3D Over 73,000 Newsgroups - Including Dedicated Binaries Serv=
ers =3D=3D-----
------------------------------
Date: 1 Jul 1999 19:21:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Picture doesn't appear
Message-Id: <slrn7no1gh.31h.abigail@alexandra.delanet.com>
Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote on MMCXXX September
MCMXCIII in <URL:news:1du8ha4.bqpyae1u629drN@p0.tc8.metro.ma.tiac.com>:
{} <j_a_p@my-deja.com> wrote:
{}=20
{} > I am trying to show a picture from one of my perl scripts.
{} >=20
{} > #!/usr/local/bin/perl
{} >=20
{} > print "Content-type: text/html\n\n";
{} >=20
{} > print "<IMG SRC=3D\"picture.gif\">";
{} >=20
{} > however the picture doesn't show up. Is there something special tha=
t
{} > needs to be done in order to display a picture.
{}=20
{} That's not valid HTML. You're missing <HTML>, <HEAD>, and <BODY>.
It is indeed not valid HTML. However, that has nothing to do with the
missing *OPTIONAL* tags of the HTML, HEAD and BODY elements.
However, the TITLE element is required.
Followups set, as this has nothing to do with Perl.
Abigail
--=20
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q=
{print=20
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | per=
l -w
-----------=3D=3D Posted via Newsfeeds.Com, Uncensored Usenet News =3D=3D=
----------
http://www.newsfeeds.com The Largest Usenet Servers in the World=
!
------=3D=3D Over 73,000 Newsgroups - Including Dedicated Binaries Serv=
ers =3D=3D-----
------------------------------
Date: 1 Jul 1999 19:24:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Picture doesn't appear
Message-Id: <slrn7no1kr.31h.abigail@alexandra.delanet.com>
that's my address' Newton (nospam.newton@gmx.net) wrote on MMCXXX
September MCMXCIII in <URL:news:377B3B95.8C12A4FC@gmx.net>:
;; Ronald J Kimball wrote:
;; >=20
;; > That's not valid HTML. You're missing <HTML>, <HEAD>, and <BODY>.
;;=20
;; Not to mention <!DOCTYPE....> if he's really going for the "valid"
;; thingy.
Wrong again. He wasn't using anything that isn't HTML 2.0, for which
<!DOCTYPE> is optional.
Please people, it's easy to critise someone, but make sure you get your
own facts straight. The HTML specification isn't exactly rocket science.
Followups set.
Abigail
--=20
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------=3D=3D Posted via Newsfeeds.Com, Uncensored Usenet News =3D=3D=
----------
http://www.newsfeeds.com The Largest Usenet Servers in the World=
!
------=3D=3D Over 73,000 Newsgroups - Including Dedicated Binaries Serv=
ers =3D=3D-----
------------------------------
Date: Thu, 01 Jul 1999 20:29:09 -0400
From: Jeff Thies <cyberjeff@sprintmail.com>
Subject: Re: q qq or qw
Message-Id: <377C07D5.95942567@sprintmail.com>
> There are also qx{} and qr{}.
>=20
> Which part of the manual didn't you understand?
I don't have your familiarity with where everything is in the manual. I
spent some time trying to find this before I posted. Thanks to Martien I
have the answer and the reference to where it is.
Are you just trying to make me feel bad or have I misunderstood?
Jeff
------------------------------
Date: 1 Jul 1999 18:56:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: q qq or qw
Message-Id: <377c0e2c@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
Cursed to annoy himself and others using the risible Mozilla 4.5
[en] (Win95; I) as though it were a proper newsreader, Jeff Thies
<cyberjeff@sprintmail.com> writes in comp.lang.perl.misc:
:> There are also qx{} and qr{}.
:> Which part of the manual didn't you understand?
:
:I don't have your familiarity with where everything is in the manual. I
:spent some time trying to find this before I posted. Thanks to Martien I
:have the answer and the reference to where it is.
:Are you just trying to make me feel bad or have I misunderstood?
You are not expected to read it. You are expected to search it.
Asking in this newsgroup about something whose answer resides in the
standard Perl documentation on your is always going to be met with
bristles.
Imagine going to a C newsgroup and asking what the arguments to
open(2) were. You'd be shot.
Same here.
Hm... I see you're a Prisoner of Bill. Perhaps in that particular
postliterate hell, it is common to pull this kind of thing. That
doesn't fly here. If you won't search the docs, you really can't
expect someone else to do it for you.
--tom
--=20
"A well-written program is its own heaven;
a poorly-written program its own hell."
------------------------------
Date: Thu, 01 Jul 1999 18:42:46 -0700
From: "Jaime D. Perez" <jaimedp@pacbell.net>
Subject: reading log files
Message-Id: <377C1916.A8848F78@pacbell.net>
Has anybody created a program to read the log files?
I need to read my log files to find out who and how many people have
downloaded files
from one of my Internet file servers.
TIA
-Jaime
------------------------------
Date: Fri, 02 Jul 1999 02:07:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: reading log files
Message-Id: <S9Ve3.137$VK2.6017@nsw.nnrp.telstra.net>
In article <377C1916.A8848F78@pacbell.net>,
"Jaime D. Perez" <jaimedp@pacbell.net> writes:
> Has anybody created a program to read the log files?
$ cat logfiles
> I need to read my log files to find out who and how many people have
> downloaded files
$ wc logfiles
HTH
Martien
--=20
Martien Verbruggen |=20
Interactive Media Division | In a world without fences, who need=
s
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |=20
------------------------------
Date: Thu, 01 Jul 1999 20:34:53 -0700
From: "Jaime D. Perez" <jaimedp@pacbell.net>
Subject: Re: reading log files
Message-Id: <377C335D.C40D1818@pacbell.net>
Martin, I need to create a report on the log file.
wc mainly print 0 0 /var/log/htmlaccess.log
-Jaime
Martien Verbruggen wrote:
> In article <377C1916.A8848F78@pacbell.net>,
> "Jaime D. Perez" <jaimedp@pacbell.net> writes:
> > Has anybody created a program to read the log files?
>
> $ cat logfiles
>
> > I need to read my log files to find out who and how many people have
> > downloaded files
>
> $ wc logfiles
>
> HTH
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | In a world without fences, who ne=
eds
> Commercial Dynamics Pty. Ltd. | Gates?
> NSW, Australia |
------------------------------
Date: Thu, 01 Jul 1999 22:39:06 GMT
From: girish deodhar <calciii@my-deja.com>
Subject: Re: regex to match nested paranthesis
Message-Id: <7lgqm9$qv7$1@nnrp1.deja.com>
In article <7lghh7$ndm$1@nnrp1.deja.com>,
bhaskaracharya@my-deja.com wrote:
> hi
>
> i need a regex to match the ending parenthesis. There maybe several
> nested paranthesis included within. Also the data is over multiple
> lines. i need to grab everything enclosed(starting from Data( upto
> the next program_type) and store it in a hash as out->data[8], and so
> on if Program_type is Data.
>
> i tried various regex and ended up with parsing line by line until i
> detect next Program_type. Is there a neat regex or better solution?
>
> thanks
> -bhaskar
>
> sample data in text file:
> Program_type Data (
> .out (data[8] ),
> .d0 (data[8] ),
> .d1 (data[8] );
> .d2 (input[8]; ),
> .s0 (out[{1 +15}] ;);
> .s1 (s_bus[16] );
> dummy (d_bus[17] ) );
>
> Program_type perl (
> (though),
> perl is kool,
> alas this one,
> stumps me; );
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
what you essentially want is to *count* the number of
opening parens '(' and the number of closing parens ')'
from a specified location in the input string to another
specified location in the input string. BUT 'regex'es
cannot *count*.
you have stumbled upon (or cleverly noticed) a basic
limitation of "finite automata" which is how 'regex'es
are implemented.
to specify a matching parenthisis you need a 'language grammar'
for example ( a crude one )
statement :=3D (any alphabet)
statement :=3D (stament)
hope i made myself clear
and hope that this helps :)
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 22:48:47 GMT
From: girish deodhar <calciii@my-deja.com>
Subject: Re: regex to match nested paranthesis
Message-Id: <7lgr8c$r57$1@nnrp1.deja.com>
In article <7lgqm9$qv7$1@nnrp1.deja.com>,
girish deodhar <calciii@my-deja.com> wrote:
> In article <7lghh7$ndm$1@nnrp1.deja.com>,
> bhaskaracharya@my-deja.com wrote:
> > hi
> >
> > i need a regex to match the ending parenthesis. There maybe several
> > nested paranthesis included within. Also the data is over multiple
> > lines. i need to grab everything enclosed(starting from Data( upto
> > the next program_type) and store it in a hash as out->data[8], and
so
> > on if Program_type is Data.
> >
> > i tried various regex and ended up with parsing line by line until i
> > detect next Program_type. Is there a neat regex or better solution?
> >
> > thanks
> > -bhaskar
> >
> > sample data in text file:
> > Program_type Data (
> > .out (data[8] ),
> > .d0 (data[8] ),
> > .d1 (data[8] );
> > .d2 (input[8]; ),
> > .s0 (out[{1 +15}] ;);
> > .s1 (s_bus[16] );
> > dummy (d_bus[17] ) );
> >
> > Program_type perl (
> > (though),
> > perl is kool,
> > alas this one,
> > stumps me; );
> >
> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.
> >
>
> what you essentially want is to *count* the number of
> opening parens '(' and the number of closing parens ')'
> from a specified location in the input string to another
> specified location in the input string. BUT 'regex'es
> cannot *count*.
>
> you have stumbled upon (or cleverly noticed) a basic
> limitation of "finite automata" which is how 'regex'es
> are implemented.
>
> to specify a matching parenthisis you need a 'language grammar'
> for example ( a crude one )
> statement :=3D (any alphabet)
> statement :=3D (stament)
>
> hope i made myself clear
> and hope that this helps :)
>
> ~girish
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
i mean 'Finite State Machine (FSM)' where i have written
'Finite Automata' in the earlier post.
sorry for the goof up
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 15:48:09 -0500
From: TK Soh <r28629@email.sps.mot.com>
Subject: return value from inside foreach
Message-Id: <377BD409.7C9C5463@email.sps.mot.com>
I have found this strange (?) behaviour of foreach() when putting it
inside a sub. Wonder if there is something I did wrong. I tried it with
Perl 5.005_01 on HPUX 10.20 and Solaris 2.5.1.
-TK
--------------------------------------------------------
#!/usr/local/bin/perl -w
sub foo1 {
foreach my $n (1..9) {=20
return $n if $n > 7;
}
=09
return -1;
}
sub foo2 {
foreach my $n (1..9) {=20
my $x =3D $n;=20
return $x if $n > 7;
}
return -1;
}
sub foo3 {
foreach my $n (9) {
return $n if $n > 7;
}
=09
return -1;
}
$rv =3D foo1();
print "foo1 returns $rv\n";
$rv =3D foo2();
print "foo2 returns $rv\n";
$rv =3D foo3();
print "foo3 returns $rv\n";
__END__
host [47]% perl trial.pl
Use of uninitialized value at trial.pl line 29.
foo1 returns
foo2 returns 8
foo3 returns 9
host [48]%
------------------------------
Date: Thu, 01 Jul 1999 21:16:34 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: return value from inside foreach
Message-Id: <377BDA7E.A6B457BD@home.com>
[posted & mailed]
TK Soh wrote:
>=20
> I have found this strange (?) behaviour of foreach() when putting it
> inside a sub. Wonder if there is something I did wrong. I tried it with
> Perl 5.005_01 on HPUX 10.20 and Solaris 2.5.1.
It's a bug. I think it was fixed for 5.005_02, but it is definitely
gone in 5.005_03.
--=20
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Fri, 02 Jul 1999 10:25:06 +1000
From: Derek Lavine <derek@realware.com.au>
Subject: Re: returning a hash from a function
Message-Id: <377C06E2.B3E03B6A@realware.com.au>
Martin,
Thanks for your input but I am still getting errors. These are my functio=
ns
# this is in my object module
#
sub var_all_get {
my ($self) =3D @_;
return %$self->{"variables"}; # this is a hash and I know it
contains variables as I am able to view them
# using my var_get meth=
od
# I have also tried, return $self->{"variables"};
# and return \%$self->{"variables"};
}
sub var_get {
my ($self, $name) =3D @_;
return $self->{"variables"}->{$name};
}
# this is in my test file
#
use strict;
....
my %all_vars =3D $file_ini1->var_all_get; # this is line 52
foreach $key (keys %all_vars) {
print "$key =3D> ";
print $all_vars{$key}; # line 56
print "\n";
}
These are my errors
# when var_get_all, returns %$self->{"variables"};
[Fri Jul 2 10:15:23 1999] RW_FileINI_test.pl: Reference found where
even-sized list expected at ./RW_FileINI_test.pl line 52.
HASH(0x813d21c) =3D> [Fri Jul 2 10:15:23 1999] RW_FileINI_test.pl: Use o=
f
uninitialized value at ./RW_FileINI_test.pl line 56.
# I also get this message sometimes (with some variations of return from
var_gat_all, but I cannot seem to reproduce it now
[Fri Jul 2 10:01:04 1999] RW_FileINI_test.pl: Odd number of elements in
hash assignment at ./RW_FileINI_test.pl line 52.
[Fri Jul 2 10:01:04 1999] RW_FileINI_test.pl: Use of uninitialized value
at ./RW_FileINI_test.pl line 52.
=3D> [Fri Jul 2 10:01:04 1999] RW_FileINI_test.pl: Use of uninitialized
value at ./RW_FileINI_test.pl line 56.
If you are able to offer any more assistance I will be very grateful.
Regards
Derek
redmondm@yahoo.com wrote:
> In article <377ABD42.73F0F614@realware.com.au>, Derek Lavine wrote:
> >I have a problem with returning a hash from a function of an object.
> >
> >I want to say something like
> >
> >use strict;
> >...
> >
> >my %hash =3D $obj->get_hash_func;
> >
> >foreach $key (keys %hash ) {
> > print "$key =3D> %hash->{$key} \n";
> >}
> >
> %hash is a hash, not as reference to one, so the %hash->{$key} above is
> incorrect. Also, the hash value is a scalar. It should be:
> print "$key =3D> $hash{$key}\n";
>
> Martin
--
Derek Lavine
Director Custom Software
Realware Systems Pty Limited
Sydney - Australia
Mobile: 0417 249 569
Tel: 61 2 9212 4462
Fax: 61 2 9212 4463
<http://www.realware.com.au>
------------------------------
Date: Fri, 02 Jul 1999 10:49:58 +1000
From: Derek Lavine <derek@realware.com.au>
Subject: Re: returning a hash from a function
Message-Id: <377C0CB5.6F7E6C44@realware.com.au>
I have managed to get it working with
sub var_all_get {
my ($self) =3D @_;
my $hash =3D $self->{"variables"};
return %$hash;
}
for some reason
return %$self->{"variables"};
does not work, probably to do with operator precedence. I am new to perl
(about 3-4 weeks) so am still feeling this stuff out. Thanks for your hel=
p
One new question. Would you know if it is possible to determine whether =
a
variable e.g. $myvar, contains a regular scalar, an array, or a hash. I a=
sk
as the hash returned by var_get_all has values which are themselves array=
s,
but this may not always be the case. The code I am now using to obtain th=
e
values from the hash is
my %all_vars =3D $file_ini1->var_all_get;
foreach $key (keys %all_vars) {
print "$key =3D> ";
$ini_vars =3D $all_vars{$key};
$result =3D "";
# I really only want to do this if $ini_vars is an array of values
#
foreach $value (@$ini_vars) {
$result .=3D "$value, ";
}
chop $result;
chop $result;
print $result;
print "\n";
}
thanks again,
derek
redmondm@yahoo.com wrote:
> In article <377ABD42.73F0F614@realware.com.au>, Derek Lavine wrote:
> >I have a problem with returning a hash from a function of an object.
> >
> >I want to say something like
> >
> >use strict;
> >...
> >
> >my %hash =3D $obj->get_hash_func;
> >
> >foreach $key (keys %hash ) {
> > print "$key =3D> %hash->{$key} \n";
> >}
> >
> %hash is a hash, not as reference to one, so the %hash->{$key} above is
> incorrect. Also, the hash value is a scalar. It should be:
> print "$key =3D> $hash{$key}\n";
>
> Martin
--
Derek Lavine
Director Custom Software
Realware Systems Pty Limited
Sydney - Australia
Mobile: 0417 249 569
Tel: 61 2 9212 4462
Fax: 61 2 9212 4463
<http://www.realware.com.au>
------------------------------
Date: Thu, 01 Jul 1999 23:35:40 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: Robot email/poster (new proposal)
Message-Id: <377C338C.CA0D0E37@prism.gatech.edu>
John Stanley wrote:
>=20
> In article <377BB333.20354F5E@prism.gatech.edu>,
> andy barfoot <gt7202e@prism.gatech.edu> wrote:
>
>>the moderator was a bot. It could accept all postings that contain a
>>line /^\s*--\s*$/, which with we would prefix our sigs.
>=20
> And, of course, those without "sigs" will be prevented from posting.
> If you are going to limit those who can post to those who have correct
> sigdashes, then you should learn what a sigdash is and the correct rege=
x
> for it.
I'm lenient when accepting input and strict when producing output. :)
Anyway, the point is not to force people to use sigdashes, but to reduce
traffic by redirecting one-time posters to the FAQs with polite
messages. We could do a keyword scan of their message to suggest
specific entries in the FAQ; this is a much easier then what miscy was
to do! We could even say stuff like "On MS Windows systems, this FAQ's
answer is usually at 'file:...'", and give them something to click on.
I don't see how to reduce traffic without using a filter of _some_ kind,
and requiring sigdashes is the least inconvenient form of
self-moderation i could think of. I'm interested in any suggestions you
might have (xor your reasons for believing a high-volume, low S/N is a=20
better resource for learning perl), since your posts so far have been
without content.
andy
------------------------------
Date: Thu, 01 Jul 1999 15:00:32 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Robot email/poster for this group
Message-Id: <377BC8E0.601E9550@mindspring.com>
John Stanley wrote:
>=20
> In any case, this is not a robot group. It is a discussion group. The
> robot belongs elsewhere. Mail, e.g..
Or on www.perl.com.
-----------------
Out, damned spot!
Out, spot, out!
-- Shakespeare for First Grade
------------------------------
Date: 01 Jul 1999 22:23:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: rough time with files
Message-Id: <x7wvwj3i3b.fsf@home.sysarch.com>
>>>>> "JO" =3D=3D Jerome O'Neil <jeromeo@atrieva.com> writes:
JO> [Posted and mailed]
JO> In article <377b87bc.76026870@news2.channel1.com>,
JO> pontz@channel1.com (Brian Pontz) writes:
>> On Thu, 01 Jul 1999 14:56:29 GMT, mike cardeiro <mikecard@my-deja.co=
m>
>> wrote:
>> while(<NUTS>) {
>> $nut =3D $_;
>> chop($nut);
>> print $nut;
>> }
JO> Or even more brief.
JO> while(<NUTS>){chomp; print}=20
why the chop/chomp? that will not print any newlines so the output will
be all the lines of the file as one long output string.
so this could be logically reduced to:
perl -0777p -e 'tr/\n//d' nuts
but i doubt that is what is really desired by the original poster.
BTW: note that this reply has no sarcasm or snide remarks. :-)
so here is a (maybe) funny comment:
here is your brain.
here is your brain processing files with perl.
(insert appropriate imagery).
uri
--=20
Uri Guttman ----------------- SYStems ARCHitecture and Software Enginee=
ring
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consul=
ting
Have Perl, Will Travel ----------------------------- http://www.sysarch=
.com
The Best Search Engine on the Net ------------- http://www.northernlight=
.com
------------------------------
Date: Thu, 01 Jul 1999 19:21:05 -0400
From: zobkiw@triplesoft.com (Joe Zobkiw)
Subject: Script Wanted (POP/Web)
Message-Id: <zobkiw-0107991921060001@user-2ivf6se.dialup.mindspring.com>
I'm looking for a script that can (run via CRON or somesuch) will check a
POP account and...
1) forward it to another email address
2a) split the msg up into 100 character chunks
2b) submit each chunk using a form-like HTTP mechanism
Anyone know of anything like this that already exists? Or the pieces that
I might put together easily? Thanks in advance.
------------------------------
Date: Fri, 02 Jul 1999 02:15:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Script Wanted (POP/Web)
Message-Id: <fhVe3.139$VK2.6017@nsw.nnrp.telstra.net>
In article <zobkiw-0107991921060001@user-2ivf6se.dialup.mindspring.com>,
zobkiw@triplesoft.com (Joe Zobkiw) writes:
> I'm looking for a script that can (run via CRON or somesuch) will check=
a
> POP account and...
Have a look at one of the POP modules on CPAN.
> 1) forward it to another email address
Why don't you just use a .forward file together with maybe procmail
instead of a cron job?
> 2a) split the msg up into 100 character chunks
mayny ways to do this.=20
> 2b) submit each chunk using a form-like HTTP mechanism
form-like?=20
Have a look at the LWP module.
> Anyone know of anything like this that already exists? Or the pieces th=
at
> I might put together easily? Thanks in advance.
Yep, see above.
Martien
--=20
Martien Verbruggen |=20
Interactive Media Division | +++ Out of Cheese Error +++ Reinsta=
ll
Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
NSW, Australia |=20
------------------------------
Date: Fri, 02 Jul 1999 01:54:26 GMT
From: kennedy_clark@my-deja.com
Subject: Second Try: Perl Sockets Problem
Message-Id: <7lh64f$umn$1@nnrp1.deja.com>
I have been having problems getting the following
script to work. When I connect to it using a web
browser, the contents of the "page" is transfered,
but the connection is not cleanly shut down (TCP
uses the RESET bit instead of the FIN bit...
resulting in a "this connection was hosed" type
of message). I've tried everything. Help!
TIA,
Kennedy
kennedy_clark@my-deja.com
~~~~~~~~~~~~~~~
#!/usr/bin/perl -w
use Socket;
use strict;
my ( $packed_client_addr, $packed_svr_socket, $svr_port_num );
socket( SVR_SOCKET, PF_INET, SOCK_STREAM, getprotobyname("tcp")) or
die
"socket: $!";
setsockopt( SVR_SOCKET, SOL_SOCKET, SO_REUSEADDR, pack("l",1) );
$packed_svr_socket =3D pack_sockaddr_in( 8080, INADDR_ANY );
bind( SVR_SOCKET, $packed_svr_socket )
or die "Couldn't bind to port $svr_port_num :$!\n"; listen(
SVR_SOCKET, SOMAXCONN )
or die "Can't listen";
$packed_client_addr =3D accept( CLIENT_SOCKET, SVR_SOCKET );
print CLIENT_SOCKET "<html>Test</html><body>Test</body>\n";
close CLIENT_SOCKET;
~~~~~~~~~~~~~~~~~~~~
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 02 Jul 1999 02:01:57 GMT
From: dtillaud@hotmail.com
Subject: Send HTML command to a browser, easy but problems!!!
Message-Id: <7lh6if$usa$1@nnrp1.deja.com>
hi,
From my PERL program, I send some HTML to generate a webpage. The
problem is that, I want to use this symbol: "
And I have some problems. Indeed, I write in PERL:
print "<HTML>HI<Body><HI>HELLO</HI></BODY></HTML>"; #No problem
But I'd like add :
<img src=3D"../images/hello.gif">
so:
print "<img src=3D"../images/hello.gif">";
It does'nt work because there are some " and even if I
write "" like in C or pascal, there is a problem.
HOW CAN I DO, PLEASE????????
David
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 22:58:05 GMT
From: Howard Jow <ppith@my-deja.com>
Subject: Re: Socket error : Prototype not supported
Message-Id: <7lgrpo$rbj$1@nnrp1.deja.com>
In article <3779556F.7C704BF2@sitedesignonline.com>,
jon@sitedesignonline.com wrote:
<massive MIME snip>
> I know nothing of sockets, but i looked up the system getprotobyname
> call and the /etc/protocols file looks in order, complete with 'tcp'
> entry - what am I missing?
Why not use the IO::Socket library? I like the interface and
documentation.
ftp://ftp.cdrom.com/pub/perl/CPAN/doc/manual/html/lib/IO/Socket.html
Or, www.perl.com->documentation->HTML individually->manpages for
libraries->IO::Socket
The basic Perl socket library is fairly cryptic, and you have to learn
a little about bind and such before you can use it.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 01 Jul 1999 21:48:32 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: strange regex behaviour - don't understand what's going on
Message-Id: <377BE1FC.7E0FC69C@home.com>
[posted & mailed]
I.J. Garlick wrote:
>=20
> Hmmmm. Rick Delaney sent me email stating that he doesn't get said erro=
r
> in 5.005_03 only in 5.004_04. This probably explains a few things since=
we
> are running 5.004_04 here :-) (His post hasn't shown up here yet, at le=
ast
> on my news feed)
Glad you got it. Lately everything I email bounces back to me. Stupid
ISP.
> He's a very nice man though as he supplied a fix as well (for 5.004_04
> that is)
*blush*
The fix was relevant for 5.005_03 also, though. Observe.
$_ =3D "abc abc_abc\n";
s/([^ ])?(abc)/$1$2/g;
print;
Gives:
aabc aabc_abc
--=20
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 01 Jul 1999 22:44:57 GMT
From: nospam@domain.com
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <377bef69.3d6b$346@news.op.net>
I R A Aggie (fl_aggie@thepentagon.com) wrote:
: On 1 Jul 1999 18:30:17 GMT, revjack <revjack@radix.net>, in
: <7lgc3p$lpo$1@news1.Radix.Net> wrote:
: + Notice I don't post many questions here? It's not because I don't hav=
e=20
: + any perl questions - I got a million of 'em. I just know how to=20
: + find most of the answers now. It works.
: <mr. burns>Excellent</mr. burns>
Yes, I agree with you. I myself fall into the same category.
I don't post many questions either, and I post answers
where I can. I don't think people should post FAQs.=20
What I was objecting to was the snide/rude comments that accompany
the replies. I think there's too much of it. I think the
gurus are generally not aware of just how arrogant they seem
to outsiders (not all the gurus, but many of them). =20
I think this Robot Usenet moderator was a particularly bad idea.
It's just my opinion -- and this whole topic has been discussed=20
here ad nauseam before, there's not much point in my trying=20
to rehash it. =20
My real hope (I'm quite naive and idealistic) is that
one of the more level-headed and less insulting gurus
will someday try take a greater leadership role and ask=20
the other gurus to be a little more polite and respectful=20
to everyone else. Some gurus (Tom Phoenix is one of them)=20
already take great pains to act polite on this newsgroup. =20
But many gurus simply enjoy insulting people. It's just childish. =20
I think the net effect of this is not to improve the dialog,=20
but rather just to chill the dialog, and make people afraid=20
to speak up. =20
Even after all these years of Perl programming,=20
I still think that there's no such thing as a stupid question. =20
A person who posts a FAQ is not a moron, and does not deserve=20
to be mocked or hounded out because of it. Gurus should think=20
of these people as their students and should think of=20
themselves as mentors. You should consider it beneath you=20
to mock someone because their question seems "stupid" to you. =20
You need to show some respect.=20
But it's just my opinion. :)=20
--
##--------------------------------
## John Nolan
##-------------------------------- =20
------------------------------
Date: Thu, 1 Jul 1999 21:22:54 -0700
From: cabneySPAM@SPAM.SPAMcyberpass.net ()
Subject: Try this! (5.00404 - 5.00503 I think)
Message-Id: <slrn7nofku.vk8.cabneySPAM@localhost.localdomain>
Keywords: bug
First the wierd one:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/usr/bin/perl -w
use Getopt::Std;
getopts('pDd:f:');
print "opt-D is: $opt_D\n";
# if it's on the command line w/no arg it gets a 1
#$opt_D ? $DEBUG =3D 1 : $DEBUG =3D 0;
print "opt-D is: $opt_D\n";
print "DEBUG is: $DEBUG\n";
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Now how it should work:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/usr/bin/perl -w
use Getopt::Std;
getopts('pDd:f:');
print "opt-D is: $opt_D\n";
# if it's on the command line w/no arg it gets a 1
$opt_D ? foo( 1 ) : foo( 0 );
print "opt-D is: $opt_D\n";
print "DEBUG is: $DEBUG\n";
sub foo {=20
$DEBUG =3D shift;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Forgive me if this is a faq, but it looks like any assignment operations
in the x ? y : z thinger aren't evaluated.
Any hints or flames are welcome <g>.
-C
--=20
How could anyone but a radical anarchist support a concept like "free
software"? It may seem like a boon for consumers. But they should realiz=
e
that a market totally free of prices is not likely to produce quality
merchandise and will quickly collapse. --capitalresearch's Patrick Reill=
y
------------------------------
Date: Fri, 02 Jul 1999 04:41:19 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Try this! (5.00404 - 5.00503 I think)
Message-Id: <377C42B5.A293806A@home.com>
cabneySPAM@SPAM.SPAMcyberpass.net wrote:
>=20
> Forgive me if this is a faq, but it looks like any assignment operation=
s
> in the x ? y : z thinger aren't evaluated.
>=20
> Any hints or flames are welcome <g>.
perldoc perlop
Pay particular attention to precedence.
--=20
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 01 Jul 1999 23:38:13 GMT
From: richj@home.com (Joan Richards)
Subject: Trying again
Message-Id: <377b8bb7.97772148@24.0.3.71>
I sent this in yesterday, however, i never saw my message appear in my
newsreader (and yes I refreshed it). So, I'm gonna post again. Sorry
if you are seeing this for a second time.
I'm trying to recurse through directories locating any file, and
dumping it's contents to an already open file descriptor. Essentially
what I'm wanting this to do is take a directory and it's subsequent
subdirecotries/file and put them into one file. So, naturally I
started using the File::Find module, however, I must be doing
something wrong because I'm getting some wierd stuff printing to my
file.
So, I have my find call -> find(\&wanted, '/directory');
Then my wanted routine ->
sub wanted {
my $tmp;
my $tmp2;
open(FOO, ">/directory/dump") || die "Couldn't open $!";
print FOO "######$File::Find::name\n" if ! -d; # I do
this so I can know which file I"m looking at
$tmp2 =3D "$File::Find::name";
open(TEMP, "$tmp2") || die "Coudln't open $!";
print FOO while (<TEMP>);
close(TEMP);
close(FOO);
}
Now, I the "dump" file contains a bunch of garbage. So, I went in and
put print statement to try and figure out what $tmp2 was getting. And
it appeared to me to be getting only the directory names instead of
the filename. Which seemed strange to me because I thought
$File::Find::dir got the directory name, and $File::Find::name got the
filename?
Anyway, and example of what I'm trying to get the output to look like
is:
######/directory/subdirectory/some_file
text etc will
be contained here.
######/directory/subdirectory2/another_file
obviously more
text will go here
So, I suppose the crux of my problem seems to be that I"m getting the
directory name instead of the filename. Why? Also, will I be able to
get all the file contained in /directory with the logic I have above?
If not, what am I doing wrong (examples etc.).
Much appreciated,
-J
------------------------------
Date: Fri, 02 Jul 1999 03:42:27 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: unix passwd auth in CGI
Message-Id: <377C356D.D7A08417@email.com>
I have a very easy-to use script that should work, but I'm not very fluen=
t with
Unix. Is the /etc/shadow in the format of:
username:cryptedpassword
username2:cryptedpassword2
etc.
If not what format is it? I'd be happy to send you the script but I'm not=
sure
if it'll work with your format...
Jordan
Ameet Chaubal wrote:
>=20
> Hi all
>=20
> I am trying to write a form in CGI which would allow the user to change=
his
> unix passwd.
> If I run the "passwd" command; it asks the user to enter the passwd aga=
in in
> order to confirm it.
> Is there any other way to get the passwd twice on a form and match it
> against the encrypted passwd in
> /etc/shadow?
>=20
> Thanks
>=20
> Ameet
--=20
Jordan Hiller
hiller@email.com
:=FE
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)=20
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. =20
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 V9 Issue 3
***********************************