[17056] in Perl-Users-Digest
Perl-Users Digest, Issue: 4468 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 29 11:07:25 2000
Date: Fri, 29 Sep 2000 08:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970239911-v9-i4468@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 29 Sep 2000 Volume: 9 Number: 4468
Today's topics:
Re: ASAP: How $SCALAR = $LIST <ren.maddox@tivoli.com>
Re: Assigning to this scalar ${num}{'hex'} ? (Keith Calvert Ivey)
Re: attachment not in body of email (Gwyn Judd)
Re: Better way to split <ren.maddox@tivoli.com>
Re: bin2hex <mjcarman@home.com>
Converting Text? <gary@prosport.uk.com>
Re: Converting Text? <jeffp@crusoe.net>
Re: Converting Text? (David Wall)
CORE: alternative to PL_siggv? <kov@veko.ne.mediaone.net>
Re: DBI/MySQL Question for the WISE <clochard@nortelnetworks.com>
Form-email <mislam@students.uiuc.edu>
Re: Form-email (Abigail)
help renaming a file <tlos@UNSOLICITEDtlos.org>
Re: help renaming a file (Rafael Garcia-Suarez)
how to generate C-code from *.pl-file? <m.marks@web.de>
Re: how to generate C-code from *.pl-file? <bmb@ginger.libs.uga.edu>
Re: How to get length of scalar? (Abigail)
Re: How to get length of scalar? (Anthony Peacock)
Re: HTML Email <mari@civil.columbia.edu>
Re: Inconsistant cookie setting <anders@wall.alweb.dk>
Re: Just Another Perl Hacker <graham.wood@iona.com>
Re: Just Another Perl Hacker (Randal L. Schwartz)
Re: Just Another Perl Hacker <lmoran@wtsg.com>
Re: Just Another Perl Hacker <mjcarman@home.com>
Re: Just Another Perl Hacker (Anno Siegel)
Re: newbie question <tzz@iglou.com>
Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl <jhalpin@nortelnetworks.com.nospam>
Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl (Keith Calvert Ivey)
Re: Perl trouble <mjcarman@home.com>
Re: Salary Range for Perl Programmers <nico@monnet.to>
Re: Setting remote values (Win32::TieRegistry) <Alessandro.Augusto@br.bosch.com>
Re: Sorting problem <ren.maddox@tivoli.com>
Re: splitting lines with a regex <tzz@iglou.com>
Re: telnet, ftp module <tzz@iglou.com>
Re: What could this mean? <mjcarman@home.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Sep 2000 23:50:48 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: ASAP: How $SCALAR = $LIST
Message-Id: <m34s2zajiv.fsf@dhcp11-177.support.tivoli.com>
jason <elephant@squirrelgroup.com> writes:
> Ren Maddox wrote ..
> >jason <elephant@squirrelgroup.com> writes:
> >
> >> amonotod wrote ..
> >> >You already have... $columns is a scalar value of the number of fields
> >> >in $properties->{columns}, and @columns is an array (with a hash as the
> >> >first field).
> >>
> >> look again amonotod .. $properties->{columns} contains a reference to an
> >> empty list .. which is also what $columns contains
> >>
> >> >Try :
> >> >print $columns ,"\n";
> >>
> >> I think you should try this .. you might see the error of your ways ;)
> >
> >You neglected to quote the very next thing that amonotod wrote:
>
> I'm at a loss to understand how it's relevant ?
>
> >> >At this point, since you had
> >> >$properties->{columns}=[]; #This is empty, as in 0 fields.
> >> >
> >> >you should get
> >> >
> >> >
> >> >Yeah, nothing.
> >
> >(Except that you should get "0", not nothing.)
>
> someone else who hasn't tried it (or is this some stupid joke)
>
> you'll actually get something like this
>
> ARRAY(0x1b9f0d0)
>
> because $columns is an array ref .. try it yourself and you might see
> the error of your ways ;)
Of course you are correct. I'd like to say that when amonotod made
reference to @columns, my internal parser automatically converted that
to @$columns, and everything else followed from that. But it isn't
true. I made the exact mistake that you were pointing out to amonotod
-- I mistook the array reference for an array. I'm not even going to
explain what I thought you were implying....
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 29 Sep 2000 13:59:22 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Assigning to this scalar ${num}{'hex'} ?
Message-Id: <39d59f7c.47237916@news.newsguy.com>
Uri Guttman <uri@sysarch.com> wrote:
>it is very simple but you have it all backwards. it is not a scalar you
>want and you can't create or assign to $1, $2, etc. they are special to
>regexes
But he wasn't trying to use $1, $2, etc. He was trying to use
%1, %2, etc., which are perfectly assignable. Of course it's
still a very bad idea, and he should be using an array of hash
refs, as you recommended.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Fri, 29 Sep 2000 14:17:47 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: attachment not in body of email
Message-Id: <slrn8t99bk.1q4.tjla@thislove.dyndns.org>
I was shocked! How could Hugo Bouckaert <hugo@fractalgraphics.com.au>
say such a terrible thing:
>Hi
>
>In reply to Gwyn's email (who I cannot email directly, it seems)
>I am going to write some more terrible things. By the way, thanks for
>the example Gwyn.
>
>Anyway, after receiving Gwyn's code, I tried to duplicate it as much as
>possible in my script, and I am
>finding it still does not work, thatis, I cannot get attachments NOT to
>reside in the body of the email.
This beats me. The example I gave works fine for me. Are you sure it's
not just your email client doing it for you? A lot of email clients will
display attachments inline.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
You can fool some of the people all of the time,
and all of the people some of the time,
but you can make a fool of yourself anytime.
------------------------------
Date: 29 Sep 2000 00:57:07 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Better way to split
Message-Id: <m3og1791vw.fsf@dhcp11-177.support.tivoli.com>
Jeff Pinyan <jeffp@crusoe.net> writes:
> On Sep 28, Gopi Sundaram said:
>
> >($field1, $field2) = split /:/;
> >($field1, $field2, $junk) = split /:/, $_, 3;
> >($field1, $field2, @junk) = split /:/;
>
> Junk variables should be avoided at all costs. Method 1 is preferred.
Well, not at *all* costs. Perhaps not even for a little cost. But
certainly when it is free (or better, as in this case).
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 29 Sep 2000 07:54:30 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: bin2hex
Message-Id: <39D49106.77C8953E@home.com>
Mauro Manfrin wrote:
>
> I'm trying to write a little perl function
> that converts an integer (like 5632445)
> in to an hex number (like 55F1BD).
sprintf("%X", 5632445)
But that doesn't agree with your subject, which states a binary to
hexadecimal conversion:
sub bin2dec {
return unpack('N', pack('B32', substr('0' x 32 . shift, -32)));
}
sprintf("%X", bin2dec('11110101')); # F5
HTH
-mjc
------------------------------
Date: Fri, 29 Sep 2000 15:52:32 +0100
From: Gary Mayor <gary@prosport.uk.com>
Subject: Converting Text?
Message-Id: <39D4ACAF.26A355D5@prosport.uk.com>
Hi,
I'm using perl and need to know how to convert the string,
$a = "hello out there";
to
$a = "hello%20out%20there";
I need to add the %20 because something happens between netscape and
explorer when they send these strings.
Thanks
Gary
------------------------------
Date: Fri, 29 Sep 2000 10:21:22 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Converting Text?
Message-Id: <Pine.GSO.4.21.0009291019520.5957-100000@crusoe.crusoe.net>
On Sep 29, Gary Mayor said:
>I'm using perl and need to know how to convert the string,
>$a = "hello out there";
>to
>$a = "hello%20out%20there";
That's called URL encoding. Use either the CGI module or the URI::Escape
module.
use CGI;
$safe = CGI::escape("what's up?!");
use URI::Escape;
$safe = uri_escape("oh, nuttin' much.");
They treat the strings slightly differently.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 29 Sep 2000 10:44:36 -0400
From: darkon@one.net (David Wall)
Subject: Re: Converting Text?
Message-Id: <8FBE6EFC4darkononenet@206.112.192.118>
gary@prosport.uk.com (Gary Mayor) wrote in
<39D4ACAF.26A355D5@prosport.uk.com>:
>I'm using perl and need to know how to convert the string,
>$a = "hello out there";
>
>to
>
>$a = "hello%20out%20there";
>
>I need to add the %20 because something happens between netscape and
>explorer when they send these strings.
Take a look at URI::Escape. From the docs: "This module provides functions
to escape and unescape URI strings as defined by RFC 2396."
BTW, it's probably not a good idea to use $a as your variable, since it has
a special meaning to the sort function (but I do realize the above was just
demo code).
--
David Wall
darkon@one.net
------------------------------
Date: Fri, 29 Sep 2000 14:54:12 GMT
From: Ken Overton <kov@veko.ne.mediaone.net>
Subject: CORE: alternative to PL_siggv?
Message-Id: <o22B5.29912$pu4.3098630@typhoon.ne.mediaone.net>
I'm trying to install apache+mod_perl(1.21) on a Sun with Perl 5.6, but
I consistently get the following failure:
[src/modules/perl]: make
gcc -O -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE -DMOD_PERL_VERSION=\"1.21\"
-DMOD_PERL_STRING_VERSION=\"mod_perl/1.21\" -I../..
-I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE -I../../os/unix -I../../include
-DSOLARIS2=270 -DMOD_PERL -DUSE_PERL_SSI -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DEAPI -DUSE_EXPAT
-I../../lib/expat-lite `../../apaci` -c mod_perl.c
mod_perl.c: In function `perl_handler':
mod_perl.c:783: `PL_siggv' undeclared (first use in this function)
mod_perl.c:783: (Each undeclared identifier is reported only once
mod_perl.c:783: for each function it appears in.)
make: *** [mod_perl.o] Error 1
It appears to me that Perl 5.6.0 does not define PL_siggv at all, while
older Perls do:
kov@hosta:{209}> cd /usr/local/lib/perl5
kov@hosta:{210}> nm 5.00503/sun4-solaris/CORE/libperl.a|grep PL_siggv
U PL_siggv
U PL_siggv
00000004 C PL_siggv
kov@hostb: cd /usr/local/lib/perl5
kov@hostb: nm 5.6.0/sun4-solaris/CORE/libperl.a|grep PL_siggv
kov@hostb:
So I think my question is: what are programmers expected to use in cases
where they used to use PL_siggv? How do I patch this so that it will work?
I did a search through all the source for Perl5.6 and did not find any
occurrences of the string "PL_siggv".
-- kov
------------------------------
Date: Fri, 29 Sep 2000 12:50:12 +0100
From: "Clochard, Nicolas [BOIS:4974:EXCH]" <clochard@nortelnetworks.com>
Subject: Re: DBI/MySQL Question for the WISE
Message-Id: <39D481F4.EF17857D@nortelnetworks.com>
Hi,
for postgresql in perl, this is solved by:
http://www.postgresql.org/docs/faq-english.html#4.16.2
PS: I know, it's MySQL, but maybe the same method can be apply
NC
>
------------------------------
Date: Fri, 29 Sep 2000 09:05:13 -0500
From: Sharif Islam <mislam@students.uiuc.edu>
Subject: Form-email
Message-Id: <Pine.GSO.4.10.10009290902560.6517-100000@ux11.cso.uiuc.edu>
I need a script that will send email to the visitor at my web site.
For example:
<form>
Name your favorite food:
-----
Your email: -------
<Submit> //send email to yourself
</form>
I couldnt find any script like that. Any help will be appreciated.
thanks
------------------------------
Date: 29 Sep 2000 14:40:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Form-email
Message-Id: <slrn8t9ac7.k0e.abigail@alexandra.foad.org>
Sharif Islam (mislam@students.uiuc.edu) wrote on MMDLXXXVI September
MCMXCIII in <URL:news:Pine.GSO.4.10.10009290902560.6517-100000@ux11.cso.uiuc.edu>:
&&
&& I need a script that will send email to the visitor at my web site.
&&
&& For example:
&& <form>
&& Name your favorite food:
&& -----
&&
&&
&& Your email: -------
&&
&& <Submit> //send email to yourself
&& </form>
&&
&& I couldnt find any script like that. Any help will be appreciated.
Here's a hint on how to get started:
#!/opt/perl/bin/perl -wT
use strict;
use CGI;
# Fill in the blanks here!
__END__
Good luck!
--
perl -wle 'eval {die [[qq [Just another Perl Hacker]]]};; print
${${${@}}[$#{@{${@}}}]}[$#{${@{${@}}}[$#{@{${@}}}]}]'
------------------------------
Date: Fri, 29 Sep 2000 10:31:36 -0400
From: "TLOS" <tlos@UNSOLICITEDtlos.org>
Subject: help renaming a file
Message-Id: <8r28sk$plu$1@nntp9.atl.mindspring.net>
I'm just moving into a new level and have a question about a Web CGI
What I'm attempting to do is to change the name of a file and leave all the
data in the file intact. I want to leave the file in the same directory and
just change its name - the input can change the filename and the CGI will
set the extension. Here's what I have that isn't working:
sub manageFile {
print("<div align=\"center\"><table width=\"500\"><tr><td>\n");
print("<form method=\"post\" action=\"pgadmin.cgi\">");
print("<input type=\"text\" name=\"newfile\" value=\"$datafile\">
Rename file - one word, no spaces<br>");
print("<input type=\"submit\" value=\"Submit\"></form>\n");
print("</td></tr></table></div>");
$newfile = $input{'newfile'};
rename("$datafile", $newfile) || die("Cannot rename file");
}
1;
I have the form parser at the top of the CGI
I was probably closer to having it working last night but made some changes
after sleeping on it and the above is the result. As you probably can easily
see with your experienced eyes .... this ain't working. Permission on the
directory is 766 and permission on the file is 766
------------------------------
Date: Fri, 29 Sep 2000 14:49:07 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: help renaming a file
Message-Id: <slrn8t9bbm.mem.rgarciasuarez@rafael.kazibao.net>
TLOS wrote in comp.lang.perl.misc:
>I'm just moving into a new level and have a question about a Web CGI
>
>What I'm attempting to do is to change the name of a file and leave all the
>data in the file intact. I want to leave the file in the same directory and
>just change its name - the input can change the filename and the CGI will
>set the extension. Here's what I have that isn't working:
>
>sub manageFile {
>
> print("<div align=\"center\"><table width=\"500\"><tr><td>\n");
> print("<form method=\"post\" action=\"pgadmin.cgi\">");
> print("<input type=\"text\" name=\"newfile\" value=\"$datafile\">
>Rename file - one word, no spaces<br>");
> print("<input type=\"submit\" value=\"Submit\"></form>\n");
> print("</td></tr></table></div>");
[style note] You should really read about the print <<"EOF" shell-like
construct instead of mutiplying the print statements and mangling them
with \" and \n.
> $newfile = $input{'newfile'};
You're not using the CGI module, are you? You should use it, for many
reasons; it has less bugs that most homegrown form parsers, and leads
to smaller and more maintainable code.
> rename("$datafile", $newfile) || die("Cannot rename file");
Is the working directory of your script correct? Have you made a chdir
to the directory where $datafile lives? You should print the $! variable
in your error message; it contains the system error string and is useful
to debug.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Fri, 29 Sep 2000 13:37:14 +0200
From: Matthias <m.marks@web.de>
Subject: how to generate C-code from *.pl-file?
Message-Id: <39D47EEA.DBD3DCD2@web.de>
Hallo,
I have some *pl-files in my applications, but nobody should see their
sources !
I want to use the Perl included c-code generator by using perl -MO=c,
xxxxx xxx.pl
but the compiler stops working after found an error:
cant call method "can" without a package or object at
dir/perl/lib/b/c.pm line 1341
check failed--call queue aborted
Does anybody know a way to handle this, or another way to produce C-COde
??
Matthias
------------------------------
Date: Fri, 29 Sep 2000 09:03:41 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: how to generate C-code from *.pl-file?
Message-Id: <Pine.A41.4.21.0009290903340.10690-100000@ginger.libs.uga.edu>
On Fri, 29 Sep 2000, Matthias wrote:
> Hallo,
>
> I have some *pl-files in my applications, but nobody should see their
> sources !
> I want to use the Perl included c-code generator by using perl -MO=c,
> xxxxx xxx.pl
> but the compiler stops working after found an error:
>
> cant call method "can" without a package or object at
> dir/perl/lib/b/c.pm line 1341
> check failed--call queue aborted
>
> Does anybody know a way to handle this, or another way to produce C-COde
> ??
>
> Matthias
>
>
perldoc -q "hide the source"
Brad
------------------------------
Date: 29 Sep 2000 11:35:16 GMT
From: abigail@foad.org (Abigail)
Subject: Re: How to get length of scalar?
Message-Id: <slrn8t8vh3.k0e.abigail@alexandra.foad.org>
Anthony Peacock (a.peacock@chime.ucl.ac.uk) wrote on MMDLXXXVI September
MCMXCIII in <URL:news:8r1n54$kkq$1@uns-a.ucl.ac.uk>:
,,
,, Yes, my fault for using the word format in a very lazy way. But the
,, original point remians, the OP was trying to claim that the "INTERNET"
,, uses HTML, my point was that HTML is the markup language of the World
,, Wide Web. The Internet is a greater being than the World Wide Web and I
,, get very frustrated with people who use the two as synonyms.
I get very frustrated with people who think that the World Wide Web is a
subset of the Internet, or with people who think that all there's to the
World Wide Web is HTTP and HTML.
The World Wide Web and the Internet are like cars and roads. Saying that one
is bigger than the other shows a clear misunderstanding in grasping their
concepts. As for HTML, HTML is *a* markup language that's used on the
World Wide Web, and outside of that. But so is LaTeX.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>=>'
------------------------------
Date: 29 Sep 2000 12:50:46 GMT
From: a.peacock@chime.ucl.ac.uk (Anthony Peacock)
Subject: Re: How to get length of scalar?
Message-Id: <8r2376$9js$1@uns-a.ucl.ac.uk>
In article <slrn8t8vh3.k0e.abigail@alexandra.foad.org>, abigail@foad.org
says...
>
>Anthony Peacock (a.peacock@chime.ucl.ac.uk) wrote on MMDLXXXVI September
>MCMXCIII in <URL:news:8r1n54$kkq$1@uns-a.ucl.ac.uk>:
>,,
>,, Yes, my fault for using the word format in a very lazy way. But the
>,, original point remians, the OP was trying to claim that the "INTERNET"
>,, uses HTML, my point was that HTML is the markup language of the World
>,, Wide Web. The Internet is a greater being than the World Wide Web and I
>,, get very frustrated with people who use the two as synonyms.
>
>I get very frustrated with people who think that the World Wide Web is a
>subset of the Internet, or with people who think that all there's to the
>World Wide Web is HTTP and HTML.
>
>The World Wide Web and the Internet are like cars and roads. Saying that one
>is bigger than the other shows a clear misunderstanding in grasping their
>concepts. As for HTML, HTML is *a* markup language that's used on the
>World Wide Web, and outside of that. But so is LaTeX.
Yup! I agree with all of that.
I think we are all making the same point about the OP post, but in ever
increasing strictness of definition.
And because it appears that I am being very lazy in the way that I express
myself today, I think I will leave it at that :-)
------------------------------
Date: Fri, 29 Sep 2000 09:03:20 -0400
From: mari <mari@civil.columbia.edu>
Subject: Re: HTML Email
Message-Id: <Pine.LNX.4.10.10009290859390.15513-100000@civil.columbia.edu>
On Fri, 29 Sep 2000, jason wrote:
> joshfeingold@my-deja.com wrote ..
> >I imagine that I am doing the MIME header incorrectly but am not sure
> >how. I have looked around the discussion boards but have not found
> >anyone addressing the exact text that should be printed at the header
> >for it to be read as HTML by the email application (in my case Outlook).
>
> back in my day you'd send yourself one of these fancy shmancy emails ..
> and then just telnet into the POP server to have a look at the raw email
> before Outlook (or whatever) had a chance to process it
can't you just look at the full headers? (that's a legit question, i dont
use outlook).... but for HTML email testing i use yahoo.com mail and you
can view the full headers.
these are the headers i use for HTML email and they work in Outlook (i
assume, bc it's what my boss uses :D) and in my yahoo mail:
MIME-Version: 1.0
Content-type: text/html
Content-Transfer-Encoding: 7bit
m.
------------------------------
Date: Fri, 29 Sep 2000 16:49:24 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Inconsistant cookie setting
Message-Id: <Z_1B5.418$MD.25672@news010.worldonline.dk>
Pasquale wrote:
> My problem is, sometimes the cookie is set and sometimes it doesn't. Or
> I have to do it more than once. The reason I think it is the setting
> and not the getting is because after I set the cookie I go and see if
> the file has been created and it isn't.
> Once the cookie is set with the info I haven't had a problem getting the
> info.
> I have read docs and even looked at other scripts to compare, but
> nothing. Any help would be much appreciated.
> Thanks
> Pasquale
>
This is not a perl question.
Your code looks ok, and I'm sure it does what's required.
Your users may not have cookies enabled (or even support them), in which
case you get no values, so you might want to handle checking of that! I
usually redirets users whose browsers dosen't return cookies to a page
politely explaining what cookies are, why I use them and how to enable them.
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Fri, 29 Sep 2000 11:04:30 +0100
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: Just Another Perl Hacker
Message-Id: <8r1pu3$a6m$1@bvweb.iona.com>
It obviously isn't infinite or you wouldn't have finished reading it.
Graham
Sid Malhotra <sxm124@po.cwru.edu> wrote in message
news:39D41BB6.CF9B60A4@po.cwru.edu...
> http://www.cpan.org/misc/japh
>
> I recently read the infinite list of Randal Schwartz's signatures and it
> definately expresses the perl theme: There's more than one way to do it.
>
> Sid.
>
------------------------------
Date: 29 Sep 2000 04:03:38 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Just Another Perl Hacker
Message-Id: <m1bsx731f9.fsf@halfdome.holdit.com>
>>>>> "Graham" == Graham Wood <graham.wood@iona.com> writes:
Graham> It obviously isn't infinite or you wouldn't have finished reading it.
Nor would I have finished writing it. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 29 Sep 2000 09:28:08 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Just Another Perl Hacker
Message-Id: <5469tsgi77b4mlbi72g7lmqmpunqlct4u6@4ax.com>
On Fri, 29 Sep 2000 00:33:58 -0400, Sid Malhotra <sxm124@po.cwru.edu>
wrote:
>http://www.cpan.org/misc/japh
>
>I recently read the infinite list of Randal Schwartz's signatures and it
>definately expresses the perl theme: There's more than one way to do it.
^^^^^^^^
This drives me insane!
deFINITEly
finite
definite
definitely
There's more than one way to do it in perl...
ghoti != fish no matter what anyone says!
>
>Sid.
Registered Linux user number 187055
------------------------------
Date: Fri, 29 Sep 2000 07:44:32 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Just Another Perl Hacker
Message-Id: <39D48EB0.3A52AE0C@home.com>
"Randal L. Schwartz" wrote:
>
> >>>>> "Graham" == Graham Wood <graham.wood@iona.com> writes:
>
> Graham> It obviously isn't infinite or you wouldn't have
> Graham> finished reading it.
>
> Nor would I have finished writing it. :)
Of course, there's always this approach:
while(1) {
print "Just Another Perl Hacker\n";
}
-mjc
------------------------------
Date: 29 Sep 2000 14:39:07 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Just Another Perl Hacker
Message-Id: <8r29ib$23h$1@lublin.zrz.tu-berlin.de>
Randal L. Schwartz <merlyn@stonehenge.com> wrote in comp.lang.perl.misc:
>>>>>> "Graham" == Graham Wood <graham.wood@iona.com> writes:
>
>Graham> It obviously isn't infinite or you wouldn't have finished reading it.
>
>Nor would I have finished writing it. :)
So have you?
Anno
------------------------------
Date: 29 Sep 2000 09:32:03 -0500
From: Ted Zlatanov <tzz@iglou.com>
Subject: Re: newbie question
Message-Id: <970234124.15669@iglou.com>
In article <39d36ce1.10106853@news.earthlink.net>, Jon S. wrote:
>Is there an easy way to check if a scalar is a number?
>
>When I came across this, I couldn't figure out a regexp that would
>work, but I was using Perl DBI/DBD, so I used the "lookslikenumber"
>function. (I forget the exact name now.)
>
>But, how would I check if I wasn't using that module? I couldn't find
>it in any of the FAQ's or my books... just lots of references to the
>fact that Perl doesn't care if it's a number or a string.
"perldoc -q number" gives a reference to perlfaq4: How do I determine whether a
scalar is a number/whole/integer/float?
So you just didn't look in the FAQs hard enough :)
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
------------------------------
Date: 29 Sep 2000 08:34:13 -0500
From: Joe Halpin <jhalpin@nortelnetworks.com.nospam>
Subject: Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl
Message-Id: <yxs7k8bvmiei.fsf@nortelnetworks.com.nospam>
Uri Guttman <uri@sysarch.com> writes:
> >>>>> "a" == amonotod <amonotod@netscape.net> writes:
>
> a> Okay, I guess it was... Al Gore is the erstwhile Vice President of the
> a> United States. He has made a lot of rather loony comments about the
> a> Internet, and has taken a lot of (deserved) media heat for them.
>
> actually he was very misquoted but what else is new in the media. he was
> trying to point out the work he did in converting the net from a NSF
> (gus government) funded thing to a privatized one. he worked on that
> legislation but it came out like he invented the internet. oh, well,
> once that version came out it became gospel.
Well, what he said was:
"During my service in the United States Congress, I took the
initiative in creating the Internet."--- Albert Gore on CNN's "Late
Edition with Wolf Blitzer" (March 9, 1999).
What he did (as I understand it) was to help broker a deal which
stopped direct government funding of NSF, and let the private sector
run with it.
That was a good thing, but I think he's catching flak because he tried
to claim more than he deserved from it. He didn't create the internet,
I don't think he really understood what he was doing. I suspect he
found it politically advantageous for some reason, not that he was
the technological visionary he portrayed himself to be.
Just my $.02 U.S.
Joe
------------------------------
Date: Fri, 29 Sep 2000 13:47:16 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: OFFTOPIC: Was: Al Gore's Mother Invented Perl
Message-Id: <39d49c82.46475498@news.newsguy.com>
tony@svanstrom.com (Tony L. Svanstrom) wrote:
>I don't see why that one stuck, because when I first heard about it it
>didn't take that long to figure out what really had happened.
>
>I guess it's one of those "only in America"-thing.
The stupidest recent one is that when speaking to an audience of
union members he said his mother used to sing him to sleep with
"Look for the Union Label". Now idiots are complaining that the
song wasn't written until Gore was 27. Apparently for some
people you need to hold up a sign saying "This is a joke".
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Fri, 29 Sep 2000 07:55:40 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Perl trouble
Message-Id: <39D4914C.F9C2B053@home.com>
"Godzilla!" wrote:
>
> [...]
> then work on writing higher quality troll articles. This one
> is inanely annoying.
Pot. Kettle. Black.
-mjc
------------------------------
Date: Fri, 29 Sep 2000 16:01:11 +0100
From: "Nicolas MONNET" <nico@monnet.to>
Subject: Re: Salary Range for Perl Programmers
Message-Id: <fn1B5.86$N3.5835@tengri.easynet.fr>
What the fuck was Jonathan Stowe <gellyfish@gellyfish.com> trying to say:
> On Wed, 27 Sep 2000 10:55:14 +0100 Nicolas MONNET wrote:
>> What the fuck was Tom Briles <sariq@texas.net> trying to say:
>>
>>> Any class that allows its students to leave calling 'Perl' 'PERL'
>>> isn't worth two cents, much less four hundred bucks.
>>
>> It's spelled A-N-A-L R-E-T-E-N-T-I-V-E.
>>
>
> Its spelt K-I-L-L-F-I-L-E actually.
Offtopic: I'd never get around to understand why some people
seem to be so proud to announce to the world the content
of their killfile.
--
perl -e 'print `echo Just a Lame Perl Luser | gzip -9 | cat | gzip -cd`'
------------------------------
Date: Fri, 29 Sep 2000 07:55:24 -0300
From: Alessandro Augusto <Alessandro.Augusto@br.bosch.com>
To: jason <elephant@squirrelgroup.com>
Subject: Re: Setting remote values (Win32::TieRegistry)
Message-Id: <39D4751B.A6A338F9@br.bosch.com>
Thank you Jason,
It worked very good now.
alessandro
jason wrote:
> # this refers to the SOFTWARE section of the current machine
> $Registry->{'LMachine\SOFTWARE\\'};
>
> # this refers to the same section of the ws_a machine
> $Registry->{'\\\ws_a\LMachine\SOFTWARE\\'};
------------------------------
Date: 29 Sep 2000 00:36:56 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Sorting problem
Message-Id: <m3wvfv92tj.fsf@dhcp11-177.support.tivoli.com>
>>>>> "JE" == Justin England <jengland@enetis.net> writes:
[snip]
JE> $data{$sum[0]}{$sum[1]}{foo} += $sum[3];
JE> $data{$sum[0]}{$sum[1]}{bar} += $sum[4]; }
JE> foreach $year ( sort { $data{$::a} <=> $data{$::b} }
JE> keys(%data) ) { foreach $month ( sort { $data{$year}{$::b} <=>
JE> $data{$year}{$::a} } keys(%{$data{$year}})) {
[snip]
Your problem is in your sort comparisons. You are sorting the keys of
the hash based on the values -- which in this case are hash
references. You really just want to sort on the keys themselves, so
you want:
foreach $year ( sort { $a <=> $b } keys %data ) {
foreach $month ( sort { $a <=> $b } keys %{$data{$year}} ) {
HTH,
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 29 Sep 2000 09:26:31 -0500
From: Ted Zlatanov <tzz@iglou.com>
Subject: Re: splitting lines with a regex
Message-Id: <970233816.15311@iglou.com>
In article <NIKA5.563$uO1.45819@typhoon1.ba-dsg.net>, Alex Hart wrote:
>I have text coming in from an email. Sometimes the text contains
>carriage returns, and sometimes not. I want to split up the lines into
>pieces that can easily fit on the screen. I figure that 60 chars or so
>is safe, but 80 might be OK too. What I'd like to do is split the line
>at 60 characters (at the next space at least), unless there's a \n
>within 80 characters (from the beginning.).
While pure regex solutions such as the ones presented by others in this thread
are great, you might also want to try the CPAN Text::Reflow module
(http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Reflow/Reflow.html)
It has good paragraph formatting options, and uses an algorithm that's probably
good enough to fit your needs.
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
------------------------------
Date: 29 Sep 2000 09:39:58 -0500
From: Ted Zlatanov <tzz@iglou.com>
Subject: Re: telnet, ftp module
Message-Id: <970234631.16301@iglou.com>
In article <8r01tt$eob$1@nnrp1.deja.com>, hao7@yahoo.com wrote:
>I am using perl on the Solaris 2.6 box and there are no modules for
>telnet or ftp. I want to put some files from a client to a server
>machine. Suppose, that i can not install ftp or telnet modules on this
>Solaris server, is there another way to do it? Can we use system
>command like "system(cp "a", "b");" as a substitution for using perl
>copy modules? Thanks a lot.
In the order of things I'd try:
- install the Net::Telnet and Net::FTP modules (in a private directory, with
"use lib ...", if you have no authority to install those modules)
- scp/ssh
- rcp/rsh
--
Teodor Zlatanov <tzz@iglou.com>
"Brevis oratio penetrat colos, longa potatio evacuat ciphos." -Rabelais
------------------------------
Date: Fri, 29 Sep 2000 07:41:30 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: What could this mean?
Message-Id: <39D48DFA.8FFBA817@home.com>
Enchanted wrote:
>
> At the very end of my perl script, I'm getting this generated to
> STDERR (runs on FreeBSD)
>
> 21.098u 0.195s 0:48.40 43.9% 10+7145k 46+149io 0pf+0w
>
> One wild guess I have is that I may have some illegal division
> somewhere or something but if you look at it, it looks like it means
> something.
Yes, I'd wager that it does, and it's not a div by zero.
> Anyone have an idea what, or advice on how to investigate further?
> (and why it appears)
It looks like usage stats for system resources to me. The first chunk
(up to the 43.9%) is timing, the later stuff looks lime memory usage. Do
you have a call to the *system* time function anywhere in your script?
Or is something set up in your FreeBSD install to always report this
info when running scripts? (i.e. do other Perl scripts do the same
thing?)
-mjc
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 4468
**************************************