[25278] in Perl-Users-Digest
Perl-Users Digest, Issue: 7523 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 16 00:05:43 2004
Date: Wed, 15 Dec 2004 21:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 15 Dec 2004 Volume: 10 Number: 7523
Today's topics:
Re: [Slightly OT] Perl interpreter (win32) single "thre <spamtrap@dot-app.org>
Re: Extracting part of strings? <tadmc@augustmail.com>
Re: How to go to a link and save a page and email it ou <matthew.garrish@sympatico.ca>
Open file, print into file, what variable is used? <bustanut2020@yahoo.com>
Re: Open file, print into file, what variable is used? <jurgenex@hotmail.com>
Re: Open file, print into file, what variable is used? <1usa@llenroc.ude.invalid>
Re: Open file, print into file, what variable is used? <bustanut2020@yahoo.com>
Re: Open file, print into file, what variable is used? <1usa@llenroc.ude.invalid>
Re: Pattern Matching <matthew.garrish@sympatico.ca>
Re: Pattern Matching <nospam@nospam.com>
Re: Relational databases and tied hashes? <amead@comcast.net>
Re: Restricted Subsets of Perl <andy.glew@intel.com>
Re: Restricted Subsets of Perl <andy.glew@intel.com>
Re: Restricted Subsets of Perl <andy.glew@intel.com>
Re: Session management for cgi, ldap, oracle? <emschwar@pobox.com>
Re: Session management for cgi, ldap, oracle? <amead@comcast.net>
Static Code Analysis Tools? <emschwar@pobox.com>
Re: use external files as "HERE-docs" (and avoid the un <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Dec 2004 18:18:46 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: [Slightly OT] Perl interpreter (win32) single "threaded"?
Message-Id: <gqednbR7McnLW13cRVn-rA@adelphia.com>
JayEs wrote:
> Nothing really peculiar about it. The code is navigates to a URL, fills in
> some fields, clicks on a button and saves the output to a variable.
What I suggest you do is write a similar script that uses the same
technique you're using, but connects to Google, Amazon, or some other
public server instead of your private in-house server.
If your test works fine against a public server, that helps narrow the
field; you'll then know you need to focus your efforts on your server
and/or private LAN.
On the other hand, if your test produces the same results when run on a
public server, you've done two things: You've eliminated server issues
from consideration as a possible cause, and at the same time produced a
simple test script that others can use to help you diagnose the problem.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Wed, 15 Dec 2004 17:56:06 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Extracting part of strings?
Message-Id: <slrncs1jom.2rc.tadmc@magna.augustmail.com>
Karlo Lozovina <_karlo_@_mosor.net_> wrote:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in
> news:ivYvd.7200$E_6.6229@trnddc04:
>
>> Yep, there is. The perlish way of doing it would be to use the
>> function basename() from the module File::Basename. Further
>> information see 'perldoc File::Basename'.
>
> Wow, wish I knew that an hour ago :). Thanks a lot, this will make my
> life lot easier :).
You should make this bookmark then, so you won't waste more
time in the future:
http://search.cpan.org
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 15 Dec 2004 19:37:37 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: How to go to a link and save a page and email it out?
Message-Id: <fN4wd.12052$pb.873394@news20.bellglobal.com>
<dalewz@gmail.com> wrote in message
news:1103127525.493114.311790@c13g2000cwb.googlegroups.com...
> Thanks for helps here. I tried the simple method - HTML::Mail.
>
> HTML::Mail works for some web sites. But it does not work for some. The
> results are:
>
> C:\Perl\scripts>mailp.pl
> Error while making request [ GET
> http://www.macom.com/Images/darkblue_bgcolor.gi
> f]
> 404 Object Not Found at C:/Perl/lib/HTML/Mail.pm line 167.
>
Did you maybe stop and think that the image isn't there? It really doesn't
matter that you can open the page in IE and it looks okay to your eyes, as
that has nothing to do with whether the image exists or not.
The image doesn't exist, by the way, so you either go back to the drawing
board, modify the code not to die if the image is missing, or email the
author and ask him to.
Matt
------------------------------
Date: Thu, 16 Dec 2004 01:28:56 GMT
From: "Billy" <bustanut2020@yahoo.com>
Subject: Open file, print into file, what variable is used?
Message-Id: <sx5wd.760845$8_6.314288@attbi_s04>
Real quick question... The below script does what I want... IE open all txt
files... reads every line that starts with ~ and adds (prints) it to 001.log
file.
But my question is: Where is the information held that gets put into the log
file (on the line "print SCRIPTLOG;" it prints the line from the txt file
that was found to start with a ~.) Is this line put into a variable? If so
what is it?
In other words can I open another file later and call that same variable?
IE:
open(SCRIPTLOG2, ">>002.log") || die "Can't open myscript.log: $!";
print ?????????;
close SCRIPTLOG2;
Thank you,
Billy
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use strict;
use warnings;
foreach my $file (<*.txt>) {
open FILE, $file or die "Can not open $file $!\n";
while (<FILE>) {
if (/~/) {
s/~([^%\^]+).*/$1/;
open(SCRIPTLOG, ">>001.log") || die "Can't open myscript.log: $!";
print SCRIPTLOG;
close SCRIPTLOG;
}
}
close FILE;
}
------------------------------
Date: Thu, 16 Dec 2004 01:53:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Open file, print into file, what variable is used?
Message-Id: <FU5wd.4669$lZ6.2997@trnddc02>
Billy wrote:
> Real quick question... The below script does what I want... IE open
> all txt files... reads every line that starts with ~ and adds
> (prints) it to 001.log file.
You should drop this misconception as soon as possible or it will hurt you
very badly in the long run. IE certainly does not open any txt file and
never read a single line in your code below. IE would have no idea to how
execute the code to begin with. IE deals with HTML, nothing else.
What you got is a web browser, that makes an HTTP request to a web server,
which in turn calls a CGI program, which in turn creates some response and
as a side effect does some other stuff, too.
> But my question is: Where is the information held that gets put into
> the log file (on the line "print SCRIPTLOG;" it prints the line from
> the txt file that was found to start with a ~.) Is this line put into
> a variable? If so what is it?
See below
> In other words can I open another file later and call that same
> variable? IE:
> open(SCRIPTLOG2, ">>002.log") || die "Can't open myscript.log: $!";
> print ?????????;
> close SCRIPTLOG2;
> Thank you,
> Billy
>
> #!/usr/bin/perl
> use CGI::Carp qw(fatalsToBrowser);
> use strict;
> use warnings;
>
> foreach my $file (<*.txt>) {
> open FILE, $file or die "Can not open $file $!\n";
> while (<FILE>) {
Here one by one the <...> reads every single line into $_
> if (/~/) {
> s/~([^%\^]+).*/$1/;
> open(SCRIPTLOG, ">>001.log") || die "Can't open myscript.log: $!";
> print SCRIPTLOG;
And print() defaults to printing $_ if no expression is provided.
At least this part you could have figured out very easily on your own.
From 'perldoc -f print':
print FILEHANDLE LIST
[...]
If LIST is also omitted, prints "$_" to the currently
selected output channel.
> close SCRIPTLOG;
> }
> }
> close FILE;
> }
------------------------------
Date: 16 Dec 2004 02:27:07 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Open file, print into file, what variable is used?
Message-Id: <Xns95C0DA386CF9Fasu1cornelledu@132.236.56.8>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in
news:FU5wd.4669$lZ6.2997@trnddc02:
> Billy wrote:
>> Real quick question... The below script does what I want... IE open
>> all txt files... reads every line that starts with ~ and adds
>> (prints) it to 001.log file.
>
> You should drop this misconception as soon as possible or it will hurt
> you very badly in the long run. IE certainly does not open any txt
I think he meant 'i.e.' (id est) rather than Internet Explorer.
Sinan.
------------------------------
Date: Thu, 16 Dec 2004 02:36:43 GMT
From: "Billy" <bustanut2020@yahoo.com>
Subject: Re: Open file, print into file, what variable is used?
Message-Id: <%w6wd.761384$8_6.667267@attbi_s04>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns95C0DA386CF9Fasu1cornelledu@132.236.56.8...
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in
> news:FU5wd.4669$lZ6.2997@trnddc02:
>
> > Billy wrote:
> >> Real quick question... The below script does what I want... IE open
> >> all txt files... reads every line that starts with ~ and adds
> >> (prints) it to 001.log file.
> >
> > You should drop this misconception as soon as possible or it will hurt
> > you very badly in the long run. IE certainly does not open any txt
>
> I think he meant 'i.e.' (id est) rather than Internet Explorer.
>
> Sinan.
Exactly.... (IMHO this is the problem with typed text done in a hurry...
meaning is lost sometimes!)
Billy
------------------------------
Date: 16 Dec 2004 02:42:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Open file, print into file, what variable is used?
Message-Id: <Xns95C0DCBFBDBF4asu1cornelledu@132.236.56.8>
"Billy" <bustanut2020@yahoo.com> wrote in
news:sx5wd.760845$8_6.314288@attbi_s04:
> But my question is: Where is the information held that gets put into
> the log file (on the line "print SCRIPTLOG;" it prints the line from
> the txt file that was found to start with a ~.) Is this line put into
> a variable? If so what is it?
Are you thinking of filehandles?
> In other words can I open another file later and call that same
> variable? IE:
> open(SCRIPTLOG2, ">>002.log") || die "Can't open myscript.log: $!";
> print ?????????;
> close SCRIPTLOG2;
Yes, you can do that, but it can get out of hand rather quickly.
Lexical filehandles can be useful because the file they refer to is
autmatically closed when the filehandle goes out of scope.
> #!/usr/bin/perl
> use CGI::Carp qw(fatalsToBrowser);
This does not seem to be a CGI script. Why do you have it here?
> use strict;
> use warnings;
>
> foreach my $file (<*.txt>) {
> open FILE, $file or die "Can not open $file $!\n";
> while (<FILE>) {
> if (/~/) {
This matches any line that contains a ~, not lines that begin with a ~
which is what you claim above.
> s/~([^%\^]+).*/$1/;
Honestly, I am not sure what this line is supposed to do.
> open(SCRIPTLOG, ">>001.log") || die "Can't open myscript.log: $!";
> print SCRIPTLOG;
> close SCRIPTLOG;
If there is a good reason to open/close for each line, I can't see it right
now. You stated that all you wanted was to print lines starting with ~.
Untested:
use strict;
use warnings;
my @logfn = qw(001.log 002.log);
for my $logfn (qw(001.log 002.log)) {
open my $SCRIPTLOG, '>>', $logfn
or die "Cannot open $logfn: $!";
for my $fn (<*.txt>) {
open my $FILE, '<', $fn
or die "Cannot open $fn: $!";
while(<$FILE>) {
print $SCRIPTLOG if substr($_, 0, 1) eq '~';
}
}
}
------------------------------
Date: Wed, 15 Dec 2004 20:04:36 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Pattern Matching
Message-Id: <wa5wd.12375$pb.879697@news20.bellglobal.com>
"daniel kaplan" <nospam@nospam.com> wrote in message
news:1103127970.610582@nntp.acecape.com...
> "Jürgen Exner" <jurgenex@hotmail.com> wrote in message
> news:obZvd.5916$mn6.1824@trnddc07...
>
>> Sorry for asking the obvious, but if this is so, then why don't you
>> simply
>> negate the character class?
>
> well this is the cleanest i have gotten it so far:
>
> if($last_name =~ /[^\w`\']|_|\s/ |[0-9])
> {
> ....insert invalid msg here
> }
>
>
> and it's not as ugly as the other one, but again, it just leads me to
> think,
> what did i miss, or leave out?
>
You're under the mistaken impression that there's a huge need to check the
validity of last names. This is the exact reason why you can make your own
character classes. Especially, since the range of acceptable characters
would likely have little application outside of this particular test.
You should be looking for a module, not a built-in character class shortcut.
And if no module exists, make one of your code when you're finished and make
it available on CPAN.
Matt
------------------------------
Date: Wed, 15 Dec 2004 22:00:18 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Pattern Matching
Message-Id: <1103165983.431377@nntp.acecape.com>
"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:wa5wd.12375$pb.879697@news20.bellglobal.com...
> You're under the mistaken impression that there's a huge need to check the
> validity of last names.
my line of thought was that with a gazillion websites out there, that ask
for registration, "yes."
and not notpicking, just thought since new classes were introduced in 5.6.0
(according to my dox) you never know.
>This is the exact reason why you can make your own character classes.
i can see that now, was just thinking it might have been in there
already...just like /w, someone thought of the "_"
> And if no module exists, make one of your code when you're finished and
make
> it available on CPAN.
woah, am far from being able to put out something in perl that i would feel
comfortable about.....
but i do see your point...
thanks
------------------------------
Date: Wed, 15 Dec 2004 17:22:00 -0600
From: Alan Mead <amead@comcast.net>
Subject: Re: Relational databases and tied hashes?
Message-Id: <pan.2004.12.15.23.21.58.825422@comcast.net>
Star date: Wed, 15 Dec 2004 01:59:54 -0800, Lee Goddard's log:
> At 2004-12-14 08:26:01 PST, Sherm Pendley (spamtrap@dot-app.org)
> wrote:
>
>>If you're thinking this would take three separate SQL queries, you
> can
>>...join
>
> Thanks, that's true, but what I'm really looking for is a way to tie
> multiple, linked tables to a hash.
>
> And at 2004-12-14 08:50:03 PST, Matija Papec (perl@my-header.org)
> added:
>
>>Check for Tie::DBI, it does even table updating for you
>
> It does, but I can't find any info there on using it on tables related
> by UID. I've been look at the author's Tie::RDBM too, but that rather
> seems a misnoma - it doesn't seem to be so much a Relational DataBase
> Manager, as a way of freezing and thawing perl data to a database.
>
> I'm trying to use perl to dynamically create an RDB based upon an XSD
> file, and then to parse SCORM Manifest XML on the fly, using the XML's
> cross-referencing UIDs as related fields.
>
> Does anyone out there have any ideas of another module that might
> provide the underlying functionality? I don't much fancy writing a DB
> Tie this close to the holidays with so much 'flu' around ...
Lee,
I cannot figure out precisely what you are trying to do. It seems like
this is really a reply where some key details were left off.
But it seems as if you're asking which PDA is right for Enterprise
Accounting... which wouldn't make sense. Similarly, hashes and RDB's
are just different things for different purposes.
My best guess about what you want is a special case of a set of SQL tables
where there are foreign key constraints and you want to pretend like the
tuples are in a single table. I think I can promise that no one has gone
to the trouble of making a solution for this constrained special case when
you can easily make the same functionality, plus much more, with standard
SQL.
One solution that's kind of like both is sqlite. If you haven't checked
it out, there are Perl bindings at www.sqlite.org and it runs on Windows
and Linux (among others).
If you are having trouble with SQL or DBI then I'm sure there are people
like myself here who can help.
-Alan
------------------------------
Date: 15 Dec 2004 17:39:56 -0800
From: Andy Glew <andy.glew@intel.com>
Subject: Re: Restricted Subsets of Perl
Message-Id: <q5illbz58cz.fsf@plxc0250.pdx.intel.com>
>> However, my pondering how to implement this via reflection may still
>> be worth discussing. If there were a standard query format, allowing
>> us to enumerate all language elements and identifying what they do,
>> it might allow more flexible Safe'ing.
>
>Alternatively, one could consider a Parse::RecDescent grammar for an
>appropriate subset of Perl. It would only have to recognize the
>subset, interpretation would still be done by eval(), so the grammar
>could be kept simple, it doesn't have to *do* anything.
It's the usual
1. build up, out of known safe components
or
2. limit down, taking a general purpose
facility like Perl and trying to restrict it
1. is safer. Less likely to have security holes.
But 1. violates OAOO - the principle of Once and Only Once. Moreover,
if new, safe, features get added to Perl, 2. automatically includes
them, but 1. doesn't.
2. is more likely to have a security hole, because not all of the
holes in the big ciomplicated system may be known.
------------------------------
Date: 15 Dec 2004 17:53:13 -0800
From: Andy Glew <andy.glew@intel.com>
Subject: Re: Restricted Subsets of Perl
Message-Id: <q5ihdmn57qu.fsf@plxc0250.pdx.intel.com>
>Be aware - Safe is flawed. The best known way to escape a Safe
>compartment involves returning blessed values. This can easily be
>avoided by disabling the bless opcode. Similarly it's probably a good
>idea to disable the tie opcode. However there are probably other less
>well known exploits.
That's what I was worried about.
I'm guessing that the blessing and tie'ing use paths which are
relative to the Safe compartment, but which get exported, and
interpreted relative to the true Root.
Unfortunately, the design I came up with for an extensible config file
involved allowing the user inside the Safe to do objects...
Forking the Safe code into its own thread probably makes it safe
against exploits that involve modifying stuff in the parent thread.
Probably have to dump the return values, and strip out anything except
vanilla ints, strings, arrays and lists, maybe refs: no structured,
blessed, or tie'd data to be returned.
---
If I understand you correctly, the problem with Safe is not that the
Safe code can reach out, but that the Safe code can return a data
structure that is a Trojan Horse, which when used by the outside world
feeds stuff back into the compartment.
I.e. the problem that I understand seems to be that you have to
validate very carefully the values returned from Safe. I can even,
possibly, imagine that there is no way to do such validation,
if everything is tied. I don't know how much can be tied.
But if you ignore the return value, are you safe? Or can you tie
something to the destruction / garbage collection of the return value?
Ignoring the return value wouldn't be terribly useful. Can you query
the contents of the Safe, without executing tied code or the like?
Or is it a more general problem? the code inside the Safe can get
access to the outside world even without fooling the outside world to
execute tied code or the like? That would be just a bug in Safe.
------------------------------
Date: 15 Dec 2004 18:01:35 -0800
From: Andy Glew <andy.glew@intel.com>
Subject: Re: Restricted Subsets of Perl
Message-Id: <q5id5xb57cw.fsf@plxc0250.pdx.intel.com>
>There are only security issues if the config file is supplied by other,
>untrusted, people. Are you running this as root using user config files?
>If it's just a regular tool, there are no security issues - nothing
>can be gained by 'eval'ling some code the user couldn't do in a much
>simpler way.
I'm not sure yet of the trust model. It's just generally good software
to design to not require trust.
At the moment, there are three parties involved in the trust
model:
a) the user
b) the guy who coded up my tool
c) currently, I can pick up a config file from
. and a few other places. that may not be a good idea,
but is convenient, just like putting . in
your path, or using any relative path
in your Perl library path
Anyway, I'm not sure of the trust model. Not damning.
I am more sure of the fragility issues. When I've evaled user
provided strings in the past, I have had bugs when the user
accidentally provided code that collided with names in my Perl code.
I'd certainly like to avoid that.
Therefore, Safe may be good enough for me as it stands now, with
regards to reducing the chance of such accidental collisions.
I may not care enough about security in this situation to
worry about Safe's security holes.
------------------------------
Date: Wed, 15 Dec 2004 18:37:44 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Session management for cgi, ldap, oracle?
Message-Id: <etoekhryqdz.fsf@wilson.emschwar>
Alan Mead <amead@comcast.net> writes:
> Star date: Wed, 15 Dec 2004 16:43:32 +0000, Christopher Nehren's log:
>> Apparently you missed the large thread about Solaris and Perl. It was
>> mentioned numerous times that the 5.005 version of Perl shipped with
>> Solaris is required for compatability with the Perl scripts that ship
>> with Solaris.
>
> I'm glad you chimed in, I know nothing about Solaris.
>
> Hmm. But I think I would still recommended 5.6+... The inescapable
> conclusion then being "Don't use Solaris if you don't have to."
No, the conclusion is "If you're going to use Solaris, then compile
your own Perl, and put it in /opt or /usr/local". As much as my
employer might like me to endorse your statement, it simply doesn't
follow from the facts at all.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Wed, 15 Dec 2004 22:22:09 -0600
From: Alan Mead <amead@comcast.net>
Subject: Re: Session management for cgi, ldap, oracle?
Message-Id: <pan.2004.12.16.04.22.08.314855@comcast.net>
Star date: Wed, 15 Dec 2004 18:37:44 -0700, Eric Schwartz's log:
> Alan Mead <amead@comcast.net> writes:
>> Star date: Wed, 15 Dec 2004 16:43:32 +0000, Christopher Nehren's log:
>>> Apparently you missed the large thread about Solaris and Perl. It was
>>> mentioned numerous times that the 5.005 version of Perl shipped with
>>> Solaris is required for compatability with the Perl scripts that ship
>>> with Solaris.
>>
>> I'm glad you chimed in, I know nothing about Solaris.
>>
>> Hmm. But I think I would still recommended 5.6+... The inescapable
>> conclusion then being "Don't use Solaris if you don't have to."
>
> No, the conclusion is "If you're going to use Solaris, then compile your
> own Perl, and put it in /opt or /usr/local". As much as my employer
> might like me to endorse your statement, it simply doesn't follow from
> the facts at all.
Eric,
Who is your employer and why do they favor Linux? As for the facts, I
think we've established that I know *nothing* about Solaris. I was just
closing the syllogism.
I don't think I would change my conclusion, though. It's nice to know
that you can make recent Perls work on Solaris... But while you're
rebuilding Perl, I'll be taking care of business on my Linux boxes. Maybe
if I needed to use some Sun software, I'd feel differently.
-Alan
------------------------------
Date: Wed, 15 Dec 2004 18:48:39 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Static Code Analysis Tools?
Message-Id: <etoacsfypvs.fsf@wilson.emschwar>
I was searching through CPAN today for a module that would generate a
static call tree, but couldn't seem to find one (lots of dynamic call
tree generators, though!). I'm less concerned with code coverage at
this point; I'm looking for a module (or tool) that will help me
refactor code by easily showing me who calls, say, MyMod::Foo.
Does anyone know of such a thing?
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Wed, 15 Dec 2004 20:00:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: use external files as "HERE-docs" (and avoid the undefined substitions)
Message-Id: <slrncs1r2e.2rc.tadmc@magna.augustmail.com>
dede <abrey@gmx.net> wrote:
> find below the solution I am currently using to load external
> text-files that
> are seamlessly interpolated to behave like the useful HERE-docs:
What is wrong with making the external files be Real Perl Code,
and then simply require()ing them?
> $_ =~ s/(\$\S+)/defined eval($1) ? eval($1) : $1/gsxe;
The s///s modifier affects only dot, it is a no-op when the
pattern does not contain a dot. You should not add modifiers
willy nilly, add them only when you _need_ them.
The s///x modifier allows whitespace and comments in the pattern,
it is a no-op when there is no whitespace nor comments in
the pattern (more willy-nillyness).
Where are these mysterious "text files" coming from?
Consider what your code will do with file contents like:
$foo;unlink(<*>)
for instance.
> #$_ =~ s/(\$\w+)/defined $1 ? $1 : "undefined"/gsxee;
> #produced the notorious "undefined substitution errors"
It is not "notorious", it is "fictional". :-)
What message is it that you are really referring to?
Does the message appear in perldiag.pod? I can't find it...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7523
***************************************