[11197] in Perl-Users-Digest
Perl-Users Digest, Issue: 4797 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 1 12:07:43 1999
Date: Mon, 1 Feb 99 09:00:19 -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 Mon, 1 Feb 1999 Volume: 8 Number: 4797
Today's topics:
** Newbie has production Perl problem, please help ** <no_spam@no_spam.com>
Re: alternative perl NG for newbies? <ludlow@us.ibm.com>
Re: alternative perl NG for newbies? <23_skidoo@geocities.com>
Re: ancestry of perl features <jjfink@searle.monsanto.com>
Re: Can't assign an array to a hash key in a dbm file? <cdkaiser@delete.these.four.words.concentric.net>
Catching TSTP (OS, Perl, or Programmer bug?) <macintsh@cs.bu.edu>
Re: CGI form processing (Tad McClellan)
Re: CGI/PERL execution problem, GRAVE (Steve Linberg)
Re: code to recurse directories (Clay Irving)
Re: How to do query in a list? (Larry Rosler)
Re: How to get Perl for Red Hat Linux 5.2? (Tad McClellan)
Re: How to support both short and long option styles? (Abigail)
modules on NT? (Decision Systems Inc)
Re: Newbie question on regular expressions (Tad McClellan)
OO Perl: Contained objects (Lee Mulleady)
Re: Perl Crashes IIS4! (I R A Aggie)
Re: Perl Crashes IIS4! (Abigail)
Re: regex lib or Perl linked in? <jimmy@globalSpam.org>
regexp match fail: <charlesjourdan@worldnet.att.net>
Re: Regexp problem [possible] (Tad McClellan)
Scripts on CPAN (was Re: ok please don't shoot me for t (Tad McClellan)
Re: Soft reference question (Larry Rosler)
UNC-Path under windows NT ? <Pothmann@liquidvision.de>
Re: Using use base... (M.J.T. Guy)
Re: Win95 and perl5 <ebohlman@netcom.com>
Re: Win95 and perl5 (William D. Reardon)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 1 Feb 1999 09:24:20 -0600
From: "Ban Spam Now" <no_spam@no_spam.com>
Subject: ** Newbie has production Perl problem, please help **
Message-Id: <794h3p$d3r@dfw-ixnews12.ix.netcom.com>
Hi all I am maintaining a Perl script for the first time. I am happy with my
logic, but I am getting these messages:
Use of inherited AUTOLOAD for non-method Globs::start_procstats() is
deprecated
at ./test.prl line 43.
Use of inherited AUTOLOAD for non-method Globs::record_run_stats() is
deprecated
at ./test.prl line 44.
Use of inherited AUTOLOAD for non-method Globs::get_timestamp() is
deprecated at
Globs.pm (autosplit into auto/Globs/record_run_stats.al) line 143.
Use of inherited AUTOLOAD for non-method
Globs::initialize_global_variables() is
deprecated at ./test.prl line 86.
Use of inherited AUTOLOAD for non-method Globs::display_global_variables()
is de
precated at ./test.prl line 89.
Use of uninitialized value at Globs.pm (autosplit into
auto/Globs/display_global
_variables.al) line 340.
Use of uninitialized value at Globs.pm (autosplit into
auto/Globs/display_global
_variables.al) line 342.
Use of uninitialized value at ./test.prl line 98.
Use of inherited AUTOLOAD for non-method Globs::DEBUGMSG() is deprecated at
../te
st.prl line 101.
Use of inherited AUTOLOAD for non-method Globs::open_files() is deprecated
at ./
test.prl line 105.
I am in one of those situations where I have no experts to call and little
in the way of manuals:
I suspect that these statements may have something to do with the problem:
package Globs;
use Exporter;
use AutoLoader;
If you notice it complains about open_files
It stops when I call that function. I do have a function called open_files.
Id appreciate any help I can get on this
Thanks :)
------------------------------
Date: Mon, 01 Feb 1999 09:31:32 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: alternative perl NG for newbies?
Message-Id: <36B5C8D4.A0371906@us.ibm.com>
23_skidoo wrote:
> would _have_ to use it, perhaps no one would but it would give a more
> helpful direction for the busy people to point rather than 'rtfm' or
> references to 'perlfunc, perlfaq4, and perlre manuals'.
This comes up a lot. "RTFM" is usually the best answer to a lot of
these questions. It's certainly better than another newbie giving out
the wrong answer. Think of this group as the newbie group. No one
forces the experienced people to read clpm. There's always
clp.moderated.
> whatcha all think?
I think that if you really want to see what people think, you should try
starting your own 'clp.newbie' newsgroup. Just be prepared for possibly
one the longest threads in news.groups history. And if you succeed, be
prepared for the biggest mess in the clp.* hierarchy.
Just ask yourself a couple questions.
1. How would the newbie group be any different clpm if experienced
people did, in fact, read it?
2. If experienced people didn't follow it, what value would there be in
incorrect answers to problems that could have been solved by simply
reading the docs?
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Mon, 01 Feb 1999 16:20:47 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: Re: alternative perl NG for newbies?
Message-Id: <36B5D444.18F5@geocities.com>
fair points,
i'm not planning on starting a newbie NG, i just wondered if it would be
helpful, 'not really' seems to be the main response and i wasn't aware
there was a moderated NG. it sometimes seems like newbie questions
aren't welcome here, perhaps it's just people being occasionally crabby,
well that's just life that is :)
i don't feel the need to take this thread any further (before it takes
over the NG) i was just curious.
-23
------------------------------
Date: 1 Feb 1999 16:10:20 GMT
From: "Joel Finkle" <jjfink@searle.monsanto.com>
Subject: Re: ancestry of perl features
Message-Id: <01be4dfd$29034f60$12322389@Joel.monsanto.com>
Larry Rosler <lr@hpl.hp.com> wrote in article
<MPG.111027517359d2ef9899b2@nntp.hpl.hp.com>...
> In article <393e5531xn.fsf@ibnets.com> on 20 Jan 1999 19:27:32 -0500,
> Uri Guttman <uri@ibnets.com> says...
> >
> > i have been pondering perl's ancestry and for curiosity's sake i have
> > been thinking about which languages (if any) influenced various perl
> > feature.
...
> > statement modifiers perl?
>
> I believe Snobol, but it's been SOOOO long!
Various flavors of BASIC have used statement modifiers for many years,
especially those created by Digital (DEC).
------------------------------
Date: 01 Feb 1999 08:36:28 PST
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: Can't assign an array to a hash key in a dbm file?
Message-Id: <794l6c$acu@journal.concentric.net>
Rick Delaney <rick.delaney@home.com> writes:
>> @{ \@dog }[0] = 10;
>I find it interesting that this doesn't produce a warning, whereas
> @dog[0] = 10;
>does. Regardless, you should still write
> ${ \@dog }[0] = 10;
Oops. My bad. Thanks.
--
Cameron Kaiser * cdkaiser.cris@com * powered by eight bits * operating on faith
-- supporting the Commodore 64/128: http://www.armory.com/~spectre/cwi/ --
head moderator comp.binaries.cbm * cbm special forces unit $ea31 (tincsf)
personal page http://calvin.ptloma.edu/~spectre/ * "when in doubt, take a pawn"
------------------------------
Date: 1 Feb 1999 15:45:17 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Catching TSTP (OS, Perl, or Programmer bug?)
Message-Id: <794i6d$ktu$1@news1.bu.edu>
I catch SIGTSTP in a large script, and it's started behaving badly
recently. To remove as many variables as possible, I made a small test
script (included below). What happens when I run it is that I can
never resume after suspending. It just sends me back to my prompt
again and again, and usually eventually dies (for real, not caught by
the eval) with "suspended at ./foo.pl line blah blah blah..."
I'm suspicious because the large script that uses this feature used
to behave just fine, and I'm 99% sure I didn't change the signal
handling code between now then. Anyway, my questions boils down to:
Where is the error? Is it a programmer error, and I'm just typing
faulty code? Is it an OS error and somehow the OS is mis-handling
signals? Or is it a Perl error, as if it was compiled with the wrong
flags or somesuch? Any help is greatly appreciated.
Here are the vital stats:
uname -a gives: SunOS csa 5.6 Generic_105181-11 sun4u sparc SUNW,Ultra-4
The sample script "foo.pl":
---
#!/usr/local/bin/perl
for(;;)
{
$SIG{'TSTP'} = sub { die "suspended" };
eval
{
print "> ";
$res = <STDIN>;
};
$SIG{'TSTP'} = 'DEFAULT';
if($@ =~ /^suspended/)
{
$SIG{'TSTP'} = 'DEFAULT';
kill 'TSTP', $$;
print "\n";
redo;
}
elsif($@) { die "Eval error: $@" }
exit if($res =~ /^q/i);
}
---
And finally, a sample run:
---
csa [~]% ./foo.pl
> s
> a
> ^Z
Suspended
csa [~]% jobs
[1] + Suspended ./foo.pl
csa [~]% fg
./foo.pl
Suspended
csa [~]% fg
./foo.pl
Suspended
csa [~]% fg
./foo.pl
suspended at ./foo.pl line 5, <STDIN> chunk 3.
---
The number of times I have to resume before it dies varies
from run to run.
-----------------+----------------------------------------
John Siracusa | If you only have a hammer, you tend to
macintsh@bu.edu | see every problem as a nail. -- Maslow
------------------------------
Date: Mon, 1 Feb 1999 09:04:16 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: CGI form processing
Message-Id: <gpf497.1q.ln@magna.metronet.com>
Olivier (olivierf@worldnet.att.net) wrote:
: Sorry Konstantyn,
: but this question IS PERL specific since I am asking whether this can be
: done in PERL or not.
All that is needed to do what you want is to be able to
print the appropriate stuff on STDOUT.
It is possible to print stuff on STDOUT with Perl.
Is that your Perl question? (how do I print stuff on STDOUT?)
Here is the answer to the only part of your question that
is specific to Perl:
print "appropriate stuff\n"; # print on STDOUT
Determining what is the appropriate stuff is not a Perl question.
The appropriate stuff is the same whether you code it up in
Perl or C++ or Visual Basic or any other language.
So the meat of your question is indeed not a Perl question.
: If you had a bad day please take out it on somebody
: else. Maybe you should not read newsgroups if your first reaction is such a
: negative one.
You have violated several Usenet conventions in your posting.
You should expect to reap some rudeness when you sow rudeness.
You should read some of the posts in
news.announce.newusers
if you want to get the most from Usenet newsgroups.
1) off-topic posting
2) quoted the _entire_ article rather than just the part you
want to comment on
3) quoted the signature, you should never do this
4) put your followup text before the quoted text, you should
put it following the text that you are commenting on
: Kostyantyn Chromyak wrote in message ...
: > First of all, this question is not perl-specific
: >and therefore this group is not the best place to
: >post it. You need web-programming and it is *not*
: >exactly perl (however perl can be used and frecuently
: >is used for this purpose). You should look for help
: >in (for example) comp.infosystems.www.authoring.cgi
: >or comp.lang.javascript rather then comp.lang.perl.misc.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 01 Feb 1999 10:12:49 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: CGI/PERL execution problem, GRAVE
Message-Id: <linberg-0102991012490001@ltl1.literacy.upenn.edu>
In article <794etg$r26$1@minus.oleane.net>, "Rigine Leconte"
<reginel@remnet.fr> wrote:
> Apache send me :
> "Premature end of script Header"
> when i trie to execute a script cgi whith PERL
> Can you help me.
> Thanks .
Look in your server's error log for a description of the problem.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: 1 Feb 1999 11:36:30 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: code to recurse directories
Message-Id: <794l6e$n9u$1@panix.com>
In <018397.tp7.ln@magna.metronet.com> tadmc@metronet.com (Tad McClellan) writes:
>sysop (grynberg@hotmail.com) wrote:
>: Hi. I am trying to write a program to print all the files on my hard
>: drive, with their complete paths. I was wondering if anyone has
>: anything like this.
>: I do not want to use modules,
> Why not?
Especially "why not" when you're talking about one that comes with the
Perl.
--
Clay Irving
clay@panix.com
------------------------------
Date: Mon, 1 Feb 1999 07:48:29 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to do query in a list?
Message-Id: <MPG.111f6ca725bcc1389899ee@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <F6HCKL.KL3@midway.uchicago.edu> on Mon, 1 Feb 1999 14:36:21
GMT, William D. Reardon <wdr1@pobox.com> says...
> In article <36B4170B.11567309@hp.com>, Pep Mico <pep_mico@hp.com> wrote:
...
> >I'd like to know what is the best way to ask if some string is included
> >in a list.
...
> #!/usr/local/bin/perl -w
> $file = "computers.txt";
> $computer = shift;
>
> open(F, $file) || die("Couldn't open $file: $!);
> while (<F>) {
> die("Found $computer") if ($_ eq $computer);
> }
>
> print "$computer not found", "\n";
There is a bug in this code which is so obvious that it is clear that
you didn't try this snippet before posting it. (Of course, it's
*possible* that you did, and supplied the argument from the command line
in a very peculiar way -- hint, hint, for the bug -- but I rather doubt
it.)
All of which is just another example of why it's not good policy to
reinvent the FAQ in perlfaq4: "How can I tell whether a list or array
contains a certain element?"
> If you have to keep things in a list for other reasons, you can use a
> for loop (which it sounds like you're using now) or 'grep':
>
> grep {$computer eq $_}, @computers;
Here is what the FAQ says about this:
<QUOTE>
Please do not use
$is_there = grep $_ eq $whatever, @array;
</QUOTE>
Who ya' gonna trust?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 1 Feb 1999 08:40:07 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to get Perl for Red Hat Linux 5.2?
Message-Id: <7ce497.1q.ln@magna.metronet.com>
Franky (franky123@canada.com) wrote:
: Hi, I've just installed Linux 5.2 (red hat) and would like to know how I can
: get Perl
It comes with perl5.00404 installed.
If you want a more modern perl (recommended), you get it
where the Perl FAQ (part 2) says to get it:
-----------------------
=head2 What machines support Perl? Where do I get it?
The standard release of Perl (the one maintained by the perl
development team) is distributed only in source code form. You
can find this at http://www.perl.com/CPAN/src/latest.tar.gz, which
in standard Internet format (a gzipped archive in POSIX tar format).
-----------------------
: for Appache installed...
Perl is Perl.
It cares not what other things are on your computer.
Perl is not synonymous with CGI programming.
You can do CGI programming in just about any programming
language you choose.
But most folks _do_ choose Perl for such things.
Many also choose Perl for non-WWW things as well.
: I'm new to setting up my own web server so
: I'd appreciate any help I can get...
Server setup questions are best asked in a newsgroup for
server setup questions, such as:
comp.infosystems.www.servers.unix
But before you do that, you should see
http://www.apache.org
and the WWW-HOWTO.
: I would like to know where to get it
: how to install and set it up, thanks.
By now it is unclear which "it" you mean.
Perl or an HTTP server?
You now have pointers for both.
Good luck!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 1 Feb 1999 16:38:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How to support both short and long option styles?
Message-Id: <794la4$q8b$1@client2.news.psi.net>
Johan Vromans (JVromans@Squirrel.nl) wrote on MCMLXXX September MCMXCIII
in <URL:news:wl3btjeo8zm.fsf@plume.nl.compuware.com>:
^^ abigail@fnx.com (Abigail) writes:
^^
^^ > Uhm, I tried. The documentation suggests setting "bundling_override".
^^
^^ "bundling" should be sufficient. This requires the force option to be
^^ specified as "--force" (double dash).
^^ With "bundling_override" a single dash works as well for long options.
^^
^^ > However, that leads to runtime errors in Getopt::Long.
^^
^^ I wouldn't call "warnings" run-time errors, but anyway, these were
^^ fixed in the 2.19 release of Getopt::Long, available for some time now
^^ on CPAN, authors/id/JV/GetoptLong-2.19.tar.gz.
But even with 2.19, neither setting "bundling", nor setting
"bundling_override" recognizes "-f" and "-s" as valid options. *Without*
any of those settings, "-f" and "-s" are recognized.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: 1 Feb 1999 16:10:41 GMT
From: dsi@smart.net (Decision Systems Inc)
Subject: modules on NT?
Message-Id: <794jm1$sf1$1@news.smart.net>
Keywords: Modules NT
Has anyone else had a problem using modules in NT?
I have printed the @INC array and I know that this is the problem, for
some reason it is pointing to the D:. Is there any way to change this? I
have tried use lib to set the library path but this hasn't worked.
Any suggestions?
Thanks a lot
Horst
------------------------------
Date: Mon, 1 Feb 1999 09:09:53 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie question on regular expressions
Message-Id: <14g497.1q.ln@magna.metronet.com>
Daniel Grisinger (dgris@moiraine.dimensional.com) wrote:
: tadmc@metronet.com (Tad McClellan) writes:
: > 1)
: > if ('www.blah.com ' =! /http:/i)
: ^^
: I think you meant !~.
: > 3)
: > if ( ! 'www.blah.com ' =~ /http:/i)
: ^^^^^^^^^^^^^^^^^
: I think you meant to include more parens. :-)
: ! has a higher precendence than =~. What you wrote is the
: same as
: if ( (!'www.blah.com') =~ /http:/i)
Sheesh!
It sure is dark and smelly where I've stuck my head.
(and No, I'm not physically capable of really doing that either :-)
I think it would be best if I try and avoid that in the future.
Sorry.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 1 Feb 1999 15:49:35 GMT
From: lemull@unx.sas.com (Lee Mulleady)
Subject: OO Perl: Contained objects
Message-Id: <36b5cca0.2254977796@newshost.unx.sas.com>
Hello All,
Note when I refer to the parent/child relationship, I mean in terms of
a contained object not a derived class from a parent class.
We have a situation where we need a child object to know information
about its parent. We handled this by passing the parents object
reference to the child constructor (new) method and storing it as a
member of the child. This way, whenever the child object needed to
know information about the parent it used the stored object reference
to retrieve the information.
The problem we are seeing is that when attempting to deconstruct the
parent object using the undef() function, it fails to kick off the
DESTROY() method of the parent and does not remove the parent object
reference from memory. This appears to be a direct result of storing
its object reference within the child.
Is there a standard way of handling this dilema? Does Perl provide
some built in functionality for a child object to retrieve information
about its parent?
Thanks for any advice,
-Lee
lemull@wnt.sas.com
------------------------------
Date: Mon, 01 Feb 1999 10:18:01 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Crashes IIS4!
Message-Id: <fl_aggie-0102991018010001@aggie.coaps.fsu.edu>
In article <36B4BD6C.E32145D7@west-server.com>, Richard Walker
<Richard.Walker@west-server.com> wrote:
+ I R A Aggie wrote:
+ >
+ > In article <790p07$92m$4@client2.news.psi.net>, abigail@fnx.com wrote:
+ > + Sounds like a bug in IIS to me.
+ Why does this sound like a bug?
+ > Sounds like a feature, actually.
+ Why would this be a feature? What purpose could it possibly serve?
+ Please elaborate.
To convince the victim(s) to get a better httpd.
James
------------------------------
Date: 1 Feb 1999 16:41:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Crashes IIS4!
Message-Id: <794lfd$q8b$2@client2.news.psi.net>
Richard Walker (Richard.Walker@west-server.com) wrote on MCMLXXX
September MCMXCIII in <URL:news:36B5187E.EE32BD1C@west-server.com>:
%%
%% Consider this scenario. What if I found a web site that allowed me to
%% execute /usr/bin/perl (say it is an alias on the web directory tree),
%% and I sent an argument to run a shell command to shut down the web
%% server. Does that mean that that web server software is buggy?
Yes, if you consider the configuration part of the software.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|8;
.qq;8768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F;
.qq;76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V
/=$^U}while$^V!=$^W'
------------------------------
Date: Mon, 01 Feb 1999 16:16:07 GMT
From: jimmy <jimmy@globalSpam.org>
Subject: Re: regex lib or Perl linked in?
Message-Id: <36B5D18A.4CC426B4@globalSpam.org>
Greg Ward wrote:
>
> jimmy <jimmy@globalSpam.org> wrote:
> > What's a good way to add Perl's functionality to a C++ program: to link
> > Perl in, or use a standalone regex library? If the latter, where would I
> > get one? Anything freely available?
>
> Depends how much of Perl's functionality you want. If all you need is
> its totally killer regular expressions, there is an alternative: Philip
> Hazel has written PCRE, "Perl Compatible Regular Expressions". It's
> used to give Python (since 1.5) regular expressions that look awfully
> familiar, but it was written for a mail program of some sort (ie. it's
> quite general). See:
>
> ftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/
>
> More info in Modules/pypcre.c in any recent Python source distribution
> (www.python.org).
>
> Oh, of course you could always embed Perl if you need the full language.
>
> Greg
>
> --
> Greg Ward - software developer gward@cnri.reston.va.us
> Corporation for National Research Initiatives
> 1895 Preston White Drive voice: +1-703-620-8990 x287
> Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
I looked there--it's a directory listing w/o a readme file. Where do I
look for this regex package there?
Thanks.
------------------------------
Date: 1 Feb 1999 15:57:28 GMT
From: "sysadmin" <charlesjourdan@worldnet.att.net>
Subject: regexp match fail:
Message-Id: <794it8$g8p@bgtnsc01.worldnet.att.net>
I have a file with about 2000 lines
divided into blocks looking much like this:
W207518 003 1 B8BANGOR14 MORDORE NOIR
1
W207518 003 2 040045050055060065070075080085090095100105110120000
990225990107 0102 0002259091
W207518 003 3 AA 000000000000000000000000000000000000000000000000000
W207518 003 4 M 000000000002002003005005005003003000002000000000000
W207518 003 5 000000000000000000000000000000000000000000000000000
W207518 003 6 000000000000000000000000000000000000000000000000000
W207518 003 7 000000000000000000000000000000000000000000000000000
W207518 004 1 B8BANGOR14 MORDORE ARGENT
1
W207518 004 2 040045050055060065070075080085090095100105110120000
990225990107 0102 0002259099
W207518 004 3 AA 000000000000000000000000000000000000000000000000000
W207518 004 4 M 000000000002002003005005005003003000002000000000000
W207518 004 5 000000000000000000000000000000000000000000000000000
W207518 004 6 000000000000000000000000000000000000000000000000000
W207518 004 7 000000000000000000000000000000000000000000000000000
I want to identify each block then read the lines 3-7 (within the scope of
the block)
The block line number is the 3rd arg
My problem is twofold:
1. Filtering out lines 1-2 (because 2 does not represent quantities, but
sizes)
2. Reading the 000000102010201020 string regardless of whether it is
argument 5 or 4
I am using the Perl Cookbook Chapter 6 and can't get past step one on this
strange matching puzzle
I am sure it is a syntax problem
This is what I have done in terms of the matching (the math part in adding
up the chars for a cumulative sum is ok)
#!/usr/local/bin/perl -w
# testing filename: matchit
# Here's the pattern; we want to get only lines 3-7
#C206130 001 1 C9BARON0 KIDGLASS NOIR
602106901W*3702724000001
#C206130 001 2 040045050055060065070075080085090095100105110120000
990225990107 0 0002842010
#C206130 001 3 AA 000000000000000000000000000000000000000000000000000
#C206130 001 4 B 000001002003004004004003002001000000000000000000000
#C206130 001 5 000000000000000000000000000000000000000000000000000
#C206130 001 6 000000000000000000000000000000000000000000000000000
#C206130 001 7 000000000000000000000000000000000000000000000000000
while (<$line>) {
#$3 =~ /\d/ ;
#if ($1 =~ /\b^\d+/) {
#if ($1 =~ /\b\d+/) {
#if ($line =~ (//)) {
if($line =~ /C206130/) {
print $line;
}
}
--
===========================================
Opinions my own and not representative of my employer
Do not listen to me: I have brain damage
===========================================
------------------------------
Date: Mon, 1 Feb 1999 09:14:20 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regexp problem [possible]
Message-Id: <ccg497.1q.ln@magna.metronet.com>
Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote:
: <hdiwan@diwanh.stu.rpi.edu> wrote:
: > while (<IN>) { tr /^Starting//; tr /^No//;tr /second$//;
: > tr /^Nmap\brun\bcompleted//;}
: Is this your real code? Those tr/// commands are effectively no-ops.
: I think you meant to use s///.
And even then it would be effectively no-ops since (s)he is
opening the file, manipulating stuff, and closing the file.
I think there is some sort of output or assignment missing there...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 1 Feb 1999 08:50:18 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Scripts on CPAN (was Re: ok please don't shoot me for this question)
Message-Id: <ave497.1q.ln@magna.metronet.com>
Uri Guttman (uri@home.sysarch.com) wrote:
: >>>>> "A" == Abigail <abigail@fnx.com> writes:
: A> Uhm, CPAN/scripts/CGI is depressingly empty.
: cpan
: seems to attract the modules but not the scripts. this is an issue to
: raise on cpan email lists and maybe advocacy.
I seem to remember that putting scripts (as opposed to modules) on CPAN
was forbidden by policy.
It appears that the policy has changed, but I never heard about it.
Maybe others don't know that scripts on CPAN are now allowed?
I think we need a post about scripts on CPAN on
comp.lang.perl.announce.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 1 Feb 1999 07:31:03 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Soft reference question
Message-Id: <MPG.111f6886ddb815fd9899ed@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <m33e4qyzxv.fsf@joshua.panix.com> on 01 Feb 1999 15:13:32
+0100, Jonathan Feinberg <jdf@pobox.com> says...
> louie@visca.com (Louie) writes:
>
> > open (UPLOAD, ">$updir") or die $!;
> > my ($Buffer);
> > while (read($upload,$Buffer,8192)) {
>
> > If I try to use strict with this script, I get an error saying soft
> > references aren't allowed with strict on.
>
> read() takes a FILEHANDLE as its first argument. Since $upload is not
> a filehandle, Perl treats it as the *name* of a filehandle. Try
>
> read(UPLOAD, ...
No, don't do that -- because the filehandle UPLOAD is opened for
*writing*!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 1 Feb 1999 15:27:49 +0100
From: "Christian Pothmann" <Pothmann@liquidvision.de>
Subject: UNC-Path under windows NT ?
Message-Id: <794do5$ac1$1@black.rmc.de>
Hi,
how can I access UNC-Paths like: (doesn't work)
$ggg = "\\\\hal\\change";
opendir(DIR, $ggg);
@cfiles=readdir(DIR);
close(DIR);
print "Inhalt: @cfiles";
Thank you !
------------------------------
Date: 1 Feb 1999 15:34:01 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Using use base...
Message-Id: <794hh9$9pq$1@pegasus.csx.cam.ac.uk>
In article <36B39106.50681274@home.com>, Phraktyl <phraktyl@home.com> wrote:
>Which is better:
>
>package Manager;
>use Employee;
>@ISA = qw(EMPLOYEE);
>
>-- or --
>
>package Manager;
>use base Employee;
>
>What are the advantages/disadvantages - if any?
Jonathan has given the advantages of 'use base'. The disadvantages are
a) incompatibility with older Perl versions.
b) more overhead (loading an extra module).
So neither is "better". Make your own choice.
Mike Guy
------------------------------
Date: Mon, 1 Feb 1999 15:33:35 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Win95 and perl5
Message-Id: <ebohlmanF6HF7z.G5H@netcom.com>
Jason Boyd <jboyd99@hotmail.com> wrote:
: This is a repost, but I still haven't had a great answer.
: When I run perl, or a script, in Win95, it opens an MS-DOS window to run
: in, and as soon as the script is finished, the window closes. Simply
: trying to open a DOS session (or reboot in DOS mode) won't run perl at
: all, telling me either "This program cannot be run in DOS mode," or
: "This program must be run in Win32." I have had this problem both with
: ActivePerl (509) and the standard perl 5.004_02 for Win32.
Your problem is that your system is set up so that selecting the "MS-DOS
prompt" option on your start menu takes you into DOS compatibility mode
(intended for games that muck around with otherwise-protected areas of
memory) rather than to a Windows console prompt. Go into your
"\windows\start menu" directory, bring up the properties for the "MS-DOS
prompt" shortcut, pick the "program" tab, press the "advanced" button, and
then uncheck the "MS-DOS mode" box. That will let you get a true console
prompt from which you can run Perl.
------------------------------
Date: Mon, 1 Feb 1999 16:37:00 GMT
From: wdr1@pobox.com (William D. Reardon)
Subject: Re: Win95 and perl5
Message-Id: <F6HI5o.47C@midway.uchicago.edu>
In article <36B5544F.9E22123@hotmail.com>,
Jason Boyd <jboyd99@hotmail.com> wrote:
>This is a repost, but I still haven't had a great answer.
>
>When I run perl, or a script, in Win95, it opens an MS-DOS window to run
>in, and as soon as the script is finished, the window closes. Simply
>trying to open a DOS session (or reboot in DOS mode) won't run perl at
>all, telling me either "This program cannot be run in DOS mode," or
>"This program must be run in Win32." I have had this problem both with
>ActivePerl (509) and the standard perl 5.004_02 for Win32.
>
>Please note that I HAVE used the workaround of putting in a final line
>like:
>$finish = <STDIN>;
>so don't bother answering with this suggestion. I really just want to
>know why these distributions claim to be for WinNT/95/98, when this
>obvious problem exists.
I don't believe this is a Perl issue, but rather a Windows
one. In fact, I believe if you wrote a simple 'hello, world'
executable in VC++, the same thing would happen. If you run it
via VC++, it will help you out by throwing in a 'Press any key...'
pause, but that *won't* happen if you just double-click your app.
(I don't have VC++ on my machine at work, so I can't test this
though.)
FWIW, you *should* be able to run it by simply opening up a
DOS/Command prompt. If perl.exe is in your path, you should be able to
simply type "perl C:\somewhere\myfile.pl". Additionally, on NT, you
can configure your system so simply "C:\somewhere\myfile.pl" would work as
well.
HTH,
-Bill
--
William Reardon ---- http://www.nhma.com/~wdr1/ ---- wdr1@pobox.com
It takes 41 muscles to frown, but only 4 to pull a trigger.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4797
**************************************