[7861] in Perl-Users-Digest
Perl-Users Digest, Issue: 1486 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 16 19:07:28 1997
Date: Tue, 16 Dec 97 16:00:20 -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 Tue, 16 Dec 1997 Volume: 8 Number: 1486
Today's topics:
Re: <INPUT TYPE="file" (brian d foy)
Re: How do I send data to my perl script? (Martien Verbruggen)
Re: Is anything like this wonderful script available to (Martien Verbruggen)
Re: localtime() _is_ year-2000 compliant, right? <barnett@houston.Geco-Prakla.slb.com>
Re: localtime() _is_ year-2000 compliant, right? (Tad McClellan)
Re: localtime() _is_ year-2000 compliant, right? (brian d foy)
Re: localtime() _is_ year-2000 compliant, right? (Martien Verbruggen)
Re: perl http client via sockets (Jim Michael)
Perl Implementation of Checksum? (Roy S. Rapoport)
Re: Perl Implementation of Checksum? (brian d foy)
Re: Please advise. Fastest way to line-count files (Martien Verbruggen)
Problem Installing WAIT module (Chris McGuire)
Problem running perl from cron... <tcarey@ngdc.noaa.gov>
Re: Return value after OPEN() <reibert@mystech.com>
Re: Return value after OPEN() <rra@stanford.edu>
trouble compiling LWP <njk@odyssee.net>
Use of uninitialized value at ... (Chris McGuire)
Re: where did the newline come from? (Jeff Stampes)
Re: where did the newline come from? <reibert@mystech.com>
Re: where did the newline come from? <oberon@nospam.erols.com>
Re: Which language pays most 17457 -- C++ vs. Java? <yconstan@easynet.fr>
Re: Which language pays most 17457 -- C++ vs. Java? (Craig A. Johnston)
Re: WWW and Internet Books FS (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Dec 1997 18:42:22 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: <INPUT TYPE="file"
Message-Id: <comdog-ya02408000R1612971842220001@news.panix.com>
In article <3496F5BA.E34@cyberhighway.net>, cache@cyberhighway.net wrote:
>How do you handle a file being uploaded from the browser's machine with
>the html form element <INPUT TYPE="file">? The file NAME arrives as
>input to the element(post) or query string(get). But, where is the file
>and it's contents? And how do I direct where the file is saved and under
>what name? I'd really appreciate some help on this as Netscape's
>handbook offers no clues on what to do with this form element.
if you are using the CGI module, you shouldn't have to worry about
this!
check to see if you have the CGI module installed (if so, it should
also have the documentation, including a section called "Using the
File Upload Feature"), or check the web-version of the docs referenced
in the CGI Meta FAQ.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 16 Dec 1997 23:12:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How do I send data to my perl script?
Message-Id: <6771so$3tk$2@comdyn.comdyn.com.au>
In article <675c2k$3l1$1@cubacola.tninet.se>,
"Andrei Ignat" <t-n-g@algonet.se> writes:
> This a quite stupi question but I can't figure it out, what do I write in
> the address bar for IE or NN or an <A> tag? I found something like this:
This has nothing to do with perl.
You are probably better off asking this question in one of the
comp.infosystems.www.* groups.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd. | thing but mean your mother.
NSW, Australia |
------------------------------
Date: 16 Dec 1997 23:29:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Is anything like this wonderful script available to download from the web?
Message-Id: <6772so$43f$1@comdyn.comdyn.com.au>
In article <3496ba0b.92719303@news.demon.co.uk>,
cpickles@yahoo.com writes:
> I was surfing the net and came across one of the best uses of CGI I
> have ever seen at:
If it's available for download, check one of the download sites. Maybe
www.cgi-resources.com would be a good place to look.
comp.lang.perl.misc certainly isn't.
perl != CGI
> Any Ideas?
Lots. They don't have much to do with perl though, so I'll keep them
to myself.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Tue, 16 Dec 1997 16:32:34 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: localtime() _is_ year-2000 compliant, right?
Message-Id: <34970180.63534A98@houston.Geco-Prakla.slb.com>
--------------83BDB6AC8E0F1BE041C22C18
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Mark S. Reibert wrote:
> Michael Budash wrote:
>
> > The camel book says the $year portion of the list returned by localtime()
> > "has had 1900 subtracted from it".
That it does.
> Do i dare make the assumption that in
> > the year 2000, that value will be 100 and not 0?
Sure. AFAIK, 2000 - 1900 = 100. :-)
> I guess the more direct
> > question is: is $year limited to some set number of decimal places?
Only if you make it so.
> I
> > think not, but a fellow programmer disagrees.
Perl will have problems in 2038, but until then....For added insight, see
running conversation re: this topic about 2-3 weeks back.
HTH
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
--------------83BDB6AC8E0F1BE041C22C18
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Mark S. Reibert wrote:
<BLOCKQUOTE TYPE=CITE>Michael Budash wrote:
<P>> The camel book says the $year portion of the list returned by localtime()
<BR>> "has had 1900 subtracted from it".</BLOCKQUOTE>
That it does.
<BLOCKQUOTE TYPE=CITE>Do i dare make the assumption that in
<BR>> the year 2000, that value will be 100 and not 0?</BLOCKQUOTE>
Sure. AFAIK, 2000 - 1900 = 100. :-)
<BLOCKQUOTE TYPE=CITE>I guess the more direct
<BR>> question is: is $year limited to some set number of decimal places?</BLOCKQUOTE>
Only if you make it so.
<BLOCKQUOTE TYPE=CITE>I
<BR>> think not, but a fellow programmer disagrees.</BLOCKQUOTE>
Perl will have problems in 2038, but until then....For added insight, see
running conversation re: this topic about 2-3 weeks back.
<P>HTH
<BR>
<BR>Dave
<PRE>--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------</PRE>
</HTML>
--------------83BDB6AC8E0F1BE041C22C18--
------------------------------
Date: Tue, 16 Dec 1997 15:33:44 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: localtime() _is_ year-2000 compliant, right?
Message-Id: <o3s676.mq2.ln@localhost>
Michael Budash (mbudash@sonic.net) wrote:
: Could you please tell me where the FAQ is? Now _that_ would be really helpful...
The autoresponder that sends you email when you first post says:
--------------------------
5. Have you read the Perl FAQ? Many questions on sockets programming,
an important and common problem with Solaris, text manipulation and
the jargon of perl are answered in the FAQ. As well as being posted
regularly to comp.lang.perl.misc, the FAQ is on the web at:
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/index.html
--------------------------
The article frequently posted to c.l.p.m with Subject:
*** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
says:
--------------------------
5. Have you read the Perl FAQ? Many questions on sockets programming,
an important and common problem with Solaris, text manipulation and
the jargon of perl are answered in the FAQ. As well as being posted
regularly to comp.lang.perl.misc, the FAQ is on the web at:
http://language.perl.com/faq/
--------------------------
And the FAQ is shipped with the perl distribution itself
starting with v5.004
So you already know where the FAQ is, since you have read those. ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 16 Dec 1997 18:23:57 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: localtime() _is_ year-2000 compliant, right?
Message-Id: <comdog-ya02408000R1612971823570001@news.panix.com>
In article <3496EEB9.2A01E8DA@mystech.com>, "Mark S. Reibert" <reibert@mystech.com> wrote:
>Michael Budash wrote:
>
>> The camel book says the $year portion of the list returned by localtime()
>> "has had 1900 subtracted from it". Do i dare make the assumption that in
>> the year 2000, that value will be 100 and not 0? I guess the more direct
>> question is: is $year limited to some set number of decimal places? I
>> think not, but a fellow programmer disagrees.
>
>Hmmm, a small world indeed! I have pondered the same question but still don't
>have an answer.
perhaps somenone can rephrase the question, unless the answer that you
are looking for is that $year is an integer and has no decimal places.
perhaps you meant significant digits?
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 16 Dec 1997 23:34:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: localtime() _is_ year-2000 compliant, right?
Message-Id: <67736u$43f$2@comdyn.comdyn.com.au>
In article <3496EEB9.2A01E8DA@mystech.com>,
"Mark S. Reibert" <reibert@mystech.com> writes:
> Michael Budash wrote:
>
>> The camel book says the $year portion of the list returned by localtime()
>> "has had 1900 subtracted from it". Do i dare make the assumption that in
>> the year 2000, that value will be 100 and not 0? I guess the more direct
>> question is: is $year limited to some set number of decimal places? I
>> think not, but a fellow programmer disagrees.
>
> Hmmm, a small world indeed! I have pondered the same question but still don't
> have an answer.
This question comes up regularly in comp.lang.perl.misc. A search on
dejanews will give you an answer. Checking the perl FAQ will also give
you an answer (perldoc perlfaq). The man entry for localtime would
have given you the answer (perldoc -f localtime).
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd. | why kamikaze pilots wore helmets - Dave
NSW, Australia | Edison
------------------------------
Date: Tue, 16 Dec 1997 22:24:14 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: perl http client via sockets
Message-Id: <genepoolELAzKE.Mwt@netcom.com>
mikane@shell3.ba.best.com wrote:
: I want to write a perl script that will get an HTML
: page off a server on the Internet using http.
: I assume the way to go about it is to go the socket
: route. My perl 5 book is a bit skimpy on this subject.
LWP module.
: Can anyone suggest a reference?
Web Client Programming With Perl
ISBN 1-56592-214-x
Very helpful book.
Cheers,
Jim
------------------------------
Date: 16 Dec 1997 15:03:32 -0800
From: rsr@best.com (Roy S. Rapoport)
Subject: Perl Implementation of Checksum?
Message-Id: <6771c4$squ$1@shell3.ba.best.com>
I'm looking for an implementation of checksum in perl, or possibly an
idea on how I could implement it myself. A search on 'sum' on both
the FAQ and the CPAN module listing has come up with no relevant
matches ...
(Basically, I need a way to compare two files to see if they're
identical, and sum seems the quickest way to do it).
-roy
------------------------------
Date: Tue, 16 Dec 1997 18:33:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Implementation of Checksum?
Message-Id: <comdog-ya02408000R1612971833120001@news.panix.com>
In article <6771c4$squ$1@shell3.ba.best.com>, rsr@best.com (Roy S. Rapoport) wrote:
>I'm looking for an implementation of checksum in perl, or possibly an
>idea on how I could implement it myself. A search on 'sum' on both
>the FAQ and the CPAN module listing has come up with no relevant
>matches ...
>
>(Basically, I need a way to compare two files to see if they're
>identical, and sum seems the quickest way to do it).
a simple sum would have a lot of collisions (the various papers on
Tripwire, for instance, go into detail about this). it would be
very easy to have different data that had the same sum:
just another new york perl hacker
has the same sum as
just hacker perl york another new
you might want to look into the MD5 module, which would call this sort
of thing a "digest". using the module makes this task very simple.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 16 Dec 1997 22:49:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please advise. Fastest way to line-count files
Message-Id: <6770hf$3tk$1@comdyn.comdyn.com.au>
In article <3496B0CE.7B72@nospam.com>,
NerveGas <NerveGas@nospam.com> writes:
> #!/usr/local/bin/perl
> $result=`wc -l qq.pl`;
> $result =~ s/ //g;
> $result =~ s/qq\.pl//g;
> print($result);
>
> This will use the unix "wc" command, which is optimized for counting the
> lines, and can do so much more quickly than Perl can.
Did you read the whole thread? The original poster said:
> 1. I have found that perl is faster than wc(1)
I don't know what sort of system he's on, but still, he doesn't want
to use wc. Besides, it's not portable :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd. | inexactitude.
NSW, Australia |
------------------------------
Date: Tue, 16 Dec 1997 22:01:45 GMT
From: chris@i-outlet.com (Chris McGuire)
Subject: Problem Installing WAIT module
Message-Id: <3499fa44.8479952@news.mindspring.com>
Running BSDI 2.1 & Perl 5.004_04
While using CPAN to install Bundle::CPAN
I got the following error:
t/basic.............WAIT::Client: Interrupted system call at
blib/lib/CPAN/WAIT.pm line 44
Could not connect to the WAIT server at ls6.informatik.uni-dortmund.de
port 1404
You did not tell the CPAN module about an http proxy.
I could use such a beast instead of a direct connection.
No searching available!
Here is my CPAN Config.pm
# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/usr/root/.cpan/build],
'cpan_home' => q[/usr/root/.cpan],
'ftp' => q[/usr/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[/usr/contrib/bin/gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/usr/root/.cpan/sources],
'lynx' => q[/usr/contrib/bin/lynx],
'make' => q[/usr/local/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[],
'ncftp' => q[/usr/local/bin/ncftp],
'no_proxy' => q[],
'pager' => q[less],
'shell' => q[/bin/bash],
'tar' => q[/usr/root/bin/tar],
'unzip' => q[/usr/contrib/bin/unzip],
'urllist' => [q[ftp://ftp.cdrom.com/pub/perl/CPAN/]],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
};
1;
__END__
Thanks for any help you can pass along!
-Chris
------------------------------
Date: Tue, 16 Dec 1997 15:37:30 -0700
From: Tom Carey <tcarey@ngdc.noaa.gov>
Subject: Problem running perl from cron...
Message-Id: <349702AA.BC804563@ngdc.noaa.gov>
Help!
I have a problem where perl behaves diferently when run by cron than
when run on the command line. The basic problem is that $? is not set
correctly when run under cron.
The following script runs correctly on a RedHat 4.2 linux system (both
under cron
and on the command line). But, on a RedHat 5.0 linux system, running it
under cron,
$? is always set to -1. When run from the command line under RedHat
5.0, it
workd fine. Both the RedHat 4.2 and RedHat 5.0 systems mentioned are
unmodified
full installs. Has anyone seen this problem? I have tried upgrading to
the latest perl (5.004_04) on the RedHat 5.0 system, but that doesn't
change
anything. My next step is going to be to downgrade to the version of
perl on the RedHat 4.2 system (5.003). I may have to go back to RedHat
4.2 to solve the
problem. Does anyone have any ideas? Could this be glibc related?
Here is the script:
#!/usr/bin/perl
print "Here is the valid command:\n";
$? = 0;
$! = 0;
$@ = '';
print "Here is \$\? before the command: $?\n";
print "Here is \$\! before the command: $!\n";
print "Here is \$\@ before the command: $@\n";
$output = `/bin/date`;
print "Here is \$\? after the command: $?\n";
print "Here is \$\! after the command: $!\n";
print "Here is \$\@ after the command: $@\n";
print "Here is the output: $output\n\n\n";
print "Here is the invalid command:\n";
$? = 0;
$! = 0;
$@ = '';
print "Here is \$\? before the command: $?\n";
print "Here is \$\! before the command: $!\n";
print "Here is \$\@ before the command: $@\n";
$output = `/dev/null`;
print "Here is \$\? after the command: $?\n";
print "Here is \$\! after the command: $!\n";
print "Here is \$\@ after the command: $@\n";
print "Here is the output: $output\n\n\n";
Here is the output from the command line:
Here is the valid command:
Here is $? before the command: 0
Here is $! before the command:
Here is $@ before the command:
Here is $? after the command: 0
Here is $! after the command: Illegal seek
Here is $@ after the command:
Here is the output: Tue Dec 16 15:09:30 MST 1997
Here is the invalid command:
Here is $? before the command: 0
Here is $! before the command:
Here is $@ before the command:
Here is $? after the command: 256
Here is $! after the command:
Here is $@ after the command:
Here is the output:
Here is the output from cron:
Here is the valid command:
Here is $? before the command: 0
Here is $! before the command:
Here is $@ before the command:
Here is $? after the command: -1
Here is $! after the command: No child processes
Here is $@ after the command:
Here is the output: Tue Dec 16 15:13:00 MST 1997
Here is the invalid command:
Here is $? before the command: 0
Here is $! before the command:
Here is $@ before the command:
Here is $? after the command: -1
Here is $! after the command: No child processes
Here is $@ after the command:
Here is the output:
--
Tom Carey
NOAA/NGDC/SEG Email: tcarey@ngdc.noaa.gov
325 Broadway E/GC1 Voice: 303/497-6123
Boulder, CO 80303 Fax: 303/497-6513
------------------------------
Date: Tue, 16 Dec 1997 14:55:52 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: Return value after OPEN()
Message-Id: <3496F8E8.56E33F57@mystech.com>
Jerome O'Neil wrote:
> I have noticed recently that the "regulars" have been promoting the
> value of checking the return value of open() after opening a file. Very
> well and good.
>
> Is it good form to check the value after opening a pipe to another
> process?
You can never go wrong by checking the return value! If you use the standard
format such as
open( PIPE, "| more" ) or die "Hello! No pipe: $!\n";
than you pay no run-time penalty since "or" short-circuits.
Mark Reibert
-----------------------------
Mark S. Reibert, Ph.D.
Mystech Associates, Inc.
3233 East Brookwood Court
Phoenix, Arizona 85044
Tel: (602) 732-3752
Fax: (602) 706-5120
E-mail: reibert@mystech.com
-----------------------------
------------------------------
Date: 16 Dec 1997 15:12:00 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Return value after OPEN()
Message-Id: <m3u3c8hohr.fsf@windlord.Stanford.EDU>
Tom Christiansen <tchrist@mox.perl.com> writes:
> The parent can't know whether the exec() was successful or
> not - all it can return is whether the fork() succeeded or
> not. To find out if the command succeeded, you have to
> catch SIGCHLD and wait() to get the exit status.
That would require using signal handlers; wouldn't it be better in the
more common case to close your pipe and then check the value of $? ?
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Tue, 16 Dec 1997 18:56:09 -0400
From: Neil Kandalgaonkar <njk@odyssee.net>
Subject: trouble compiling LWP
Message-Id: <3497057B.B37@odyssee.net>
Perhaps I am missing something very basic (I'm still learning Unix) but
I'm having trouble compiling libwww-perl-5.18. I've been compiling other
Perl modules without problems.
It fails at the "make test" step. I get this output:
# make test
../../perl t/TEST 0
base/afm............dubious
Test returned status 1 (wstat 256, 0x100)
base/common-req.....dubious
Test returned status 1 (wstat 256, 0x100)
[and so on, all tests are "dubious", until...]
FAILED--29 test scripts could be run, alas--no output ever seen
*** Error code 2
Stop.
#
I tried "make install" anyway, but that didn't seem to work either.
The source is in /usr/src/Perl5.004_04/ext/libwww-perl-5.18/, which I
think is correct. The modules required in the README are installed. The
system is FreeBSD 2.2.2, on a PC clone which is somewhere across town.
:) It's a very vanilla system right now, no fancy libraries, but
everything else (perl5 & a few other modules) has compiled okay.
Thanks in advance for any help you can offer, even if it's a hint on
where to start investigating.
--
Neil Kandalgaonkar njk@odyssee.net
------------------------------
Date: Tue, 16 Dec 1997 23:29:16 GMT
From: chris@i-outlet.com (Chris McGuire)
Subject: Use of uninitialized value at ...
Message-Id: <34970e8b.13671472@news.mindspring.com>
Running BSDI 2.1 & Perl 5.004_04
While using CPAN to install various modules
I get the following error:
Use of uninitialized value at
/usr/local/lib/perl5/site_perl/Net/Domain.pm line 31.
Use of uninitialized value at
/usr/local/lib/perl5/site_perl/Net/Domain.pm line 88.
Here is my CPAN Config.pm
# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/usr/root/.cpan/build],
'cpan_home' => q[/usr/root/.cpan],
'ftp' => q[/usr/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[/usr/contrib/bin/gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/usr/root/.cpan/sources],
'lynx' => q[/usr/contrib/bin/lynx],
'make' => q[/usr/local/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => q[],
'ncftp' => q[/usr/local/bin/ncftp],
'no_proxy' => q[],
'pager' => q[less],
'shell' => q[/bin/bash],
'tar' => q[/usr/root/bin/tar],
'unzip' => q[/usr/contrib/bin/unzip],
'urllist' => [q[ftp://ftp.cdrom.com/pub/perl/CPAN/]],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
};
1;
__END__
Thanks for any help you can pass along! I'm learning slowly
and everybody has been very helpful so far. Thank you!
-Chris
------------------------------
Date: 16 Dec 1997 22:06:22 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: where did the newline come from?
Message-Id: <676u0u$18i$1@neocad.com>
oberon (oberon@nospam.erols.com) wrote:
: $num_date = <STDIN>;
: ($num_month = $num_date) =~ s/^(\d+) \d{4}/$1/;
: $num_date is set to "4 1997\n" via STDIN, and after my substitution,
: $num_month was "4\n". I may be missing something very basic here, but I
: have no idea how the newline got added to $num_month. As I see it, it
: should have value "4", and nothing else.
Then you aren't "seeing" your newline.
You have $num_date with a newline...we both see that. Let's look at
the second line. Make $num_month the same as $num_date..so it ow
has a newline on the end of it. Then you do a substitution:
Start at the beginning of $num_month, take all the digits to the
first space and group into $1. Now replace everything up to the
end of the last digit in a group of four with $1.
You never took the newline into account, so it's still there!
maybe you should try: s/^(\d+) \d{4}\n/$1/;
-Jeff
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Tue, 16 Dec 1997 15:19:24 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: where did the newline come from?
Message-Id: <3496FE6C.C55F9EFF@mystech.com>
oberon wrote:
> I've got a script, with the following code fragment in it:
>
> $num_date = <STDIN>;
> ($num_month = $num_date) =~ s/^(\d+) \d{4}/$1/;
>
> $num_date is set to "4 1997\n" via STDIN, and after my substitution,
> $num_month was "4\n". I may be missing something very basic here, but I
> have no idea how the newline got added to $num_month. As I see it, it
> should have value "4", and nothing else.
Easy if you just cross you T's and dot your I's! Your string is "4 1997\n".
You search for "4 1997" and replace with "4", leaving a grand total of
"4\n". The key here is the "\n" is not part of the pattern match, so it gets
left behind. You need to search for any whitespace at the end of the string:
s/^(\d+) \d{4}\s*$/$1/;
Actually, I suggest whitespace searches all around:
s/^(\d+)\s+\d{4}\s*$/$1/;
HTH,
Mark Reibert
-----------------------------
Mark S. Reibert, Ph.D.
Mystech Associates, Inc.
3233 East Brookwood Court
Phoenix, Arizona 85044
Tel: (602) 732-3752
Fax: (602) 706-5120
E-mail: reibert@mystech.com
-----------------------------
------------------------------
Date: Tue, 16 Dec 1997 20:08:25 -0500
From: oberon <oberon@nospam.erols.com>
Subject: Re: where did the newline come from?
Message-Id: <34972609.F05B428@nospam.erols.com>
Thanks to all responders. I now understand exactly what my error was,
and what I can do to avoid it. In reply to one of the responses:
brian d foy wrote:
>
> In article <3496EE62.3D9CCCDA@nospam.erols.com>, oberon <oberon@nospam.erols.com> wrote:
>
> [ sorry - no email for you :( ]
Quite all right. I'd far rather read many answers in the newsgroup than
get one answer via email.
> $num_date = m/^(\d+)/;
> my $num_month = $1;
>
> so that the original input is unchanged, and the program flow is a bit
> more clear.
Um, my original input _is_ unchanged. Or at least $num_date remains
unchanged, which is what I think you meant. But I'll agree yours reads
a bit easier. I'm sorta learning in a vacuum, and I twiddle things
untill they do what I want. I originally did something like:
$num_month = split / /, $num_date, 1;
But I got yelled at for assigning a list to a scalar. So I thrashed
around untill I found something that worked.
Since, I've figured out that I can () a scalar to make it an array, if
I'm saying this right, so I think I'll play with this for a while to see
how many ways it can be done.
--Ken Taborek
--oberon at erols dot com
------------------------------
Date: Tue, 16 Dec 1997 22:59:46 +0100
From: Yves CONSTANTINIDIS <yconstan@easynet.fr>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <3496F9D2.5BF0@easynet.fr>
Roy Smith wrote:
>
> In article <34958D16.190C@gsg.eds.com>, nospam@gsg.eds.com wrote:
> > The complexity of the syntax involves a lot more than the number of
> > keywords.
>
> Can anybody explain to me why this thread is appearing in nyc.food?
> Granted, a lot of code probably gets written in coffee shops and diners,
> but that hardly makes programing language syntax complexity an appropriate
> topic for nyc.food!
:-) Maybe our anonymous HACKER is an expert in SPAGHETTI CODE !
Yves
------------------------------
Date: 16 Dec 1997 17:00:38 -0600
From: caj@urth.autarch.com (Craig A. Johnston)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <67716m$6f0@urth.autarch.com>
COBOL. COBOL pays the most. Get to it, son.
--
Craig A. Johnston <> UNIX/TCP-IP/LAN consulting and custom programming
caj@autarch.com <> in C/perl/shell. Qmail spoken here.
------------------------------
Date: 16 Dec 1997 23:17:43 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: WWW and Internet Books FS
Message-Id: <67726n$3tk$3@comdyn.comdyn.com.au>
In article <67645t$3o5$3@gail.ripco.com>,
saxmania@ripco.com (Sax Therapy) writes:
> The Internet Business Book
> J & M Ellsworth Wiley 1994 376pp 4.00
Only 4.00 pesos? I'll have one.
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1486
**************************************