[23144] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5365 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 15 06:05:41 2003

Date: Fri, 15 Aug 2003 03:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 15 Aug 2003     Volume: 10 Number: 5365

Today's topics:
    Re: bluescreens with perl for NT (Bohne)
        Encrypting a superuser (UK\)
    Re: Extremely Basic mySQL question. <flavell@mail.cern.ch>
    Re: finding subdirectories without parsing every file (Helen)
        Help! Regular expression on html... <paul@FAKEneave.com>
    Re: how to autovivify a package from a string (David Baird)
    Re: how to autovivify a package from a string (David Baird)
    Re: how to autovivify a package from a string <REMOVEsdnCAPS@comcast.net>
    Re: Please offer critique on my 2nd JAPH <abigail@abigail.nl>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@augustmail.com
    Re: regex diffs between perl 5.6.1 and 5.8.0? (Jay Tilton)
        Skipping fields when using unpack() (John Ramsden)
    Re: Skipping fields when using unpack() <tassilo.parseval@rwth-aachen.de>
    Re: Skipping fields when using unpack() <abigail@abigail.nl>
        re: soap, etc <scripts_you-know-the-drill_@hudsonscripting.com>
    Re: soap, etc (Jay Tilton)
    Re: strange error  "Unsuccessful stat on filename " <randy_chang@sohu.com>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 15 Aug 2003 02:27:08 -0700
From: simjesse@aol.com (Bohne)
Subject: Re: bluescreens with perl for NT
Message-Id: <bfedec4.0308150127.2f51e1c3@posting.google.com>

Reapply service pack 6a

--> Unfortunately that did not solve the problem!

:o(


------------------------------

Date: Fri, 15 Aug 2003 08:43:16 +0100
From: "JJ \(UK\)" <gee@i.cant.think.why.you'd.want.my.email.address.com>
Subject: Encrypting a superuser
Message-Id: <w80%a.24$mD5.19@newsfep1-gui.server.ntli.net>

Is it possible to specify a 'superuser' (Domain Admin) account name with the
password encrypted within a Perl script in order to run a BATCH script with
the required level of permissions?

I've written the batch scripts (and they're pretty cool!) but for them to
work the account running them needs Domain Admin rights, however the team
they've been written for are only Account Operators. You see my problem...

TIA

--
JJ (UK)





------------------------------

Date: Fri, 15 Aug 2003 11:30:04 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Extremely Basic mySQL question.
Message-Id: <Pine.LNX.4.53.0308151129100.2437@lxplus017.cern.ch>

On Thu, Aug 14, Ivan Marsh inscribed on the eternal scroll:

> Typically all FTP transfers are binary these days. There's no reason, that
> I know of anyway, to use ASCII transfer specificly.

That's the trouble with off-topic posts, they often contain
misinformation.


------------------------------

Date: 15 Aug 2003 00:12:07 -0700
From: helen@helephant.com (Helen)
Subject: Re: finding subdirectories without parsing every file
Message-Id: <33517f44.0308142312.52443236@posting.google.com>

jwillmore@cyberia.com (James Willmore) wrote in message news:<e0160815.0308141712.67b4eac2@posting.google.com>...
> > Is there any way to get the subdirectories of a directory without
> > having to sort through all the files in a directory?
> > <snip>
> > I've been using file::find to generate the directory tree but it's too
> > slow. I think the problem is that it looks at each file in the
> > directory. I'm not interested in what's in the directory, I just want
> > to know what the subdirectories are.
> 

Thanks for the help of all who've answered my post. :)

> Ah.... but how far down the parent directory do you wish to search?
> File::Find has a 'finddepth' method and a multitude of options.

I really need it to list all of the directories, no matter how deep it
goes. I've designed the system so that it's simple to make sure that
the directory tree doesn't go too deep, but I didn't want to enforce a
depth because it makes the script less flexiable.
 
> Post your code and maybe we can lend more assistance.

I'm using the method below to build a "tree" structure which
represents the directories on our web server. The main complication is
that sites can have subsites, but in this part of the code I'm only
looking for the subdirectories of one site. If it finds another
subsite it stops recursing. This works because I load all the subsites
into the tree before I load all the subdirectories.

The directories and sites are stored in a tree object that uses the
directory and site path to add new sites/dirs to the tree. It's then
quite easy to recurse the bits I want when I'm printing the tree.

On the page where I'm doing the recursing it prints out only the
subdirectories of the site that don't belong to another subsite. So
it's really only looking at a small part of the tree. The problem is
that "small" is a relative term. I'm testing it with a subsite that
has 800 subdirectories (and over 9000 files) as a worst case scenario
(which isn't the biggest site on the server). I'm not sure I'll be
able to get the load time to anywhere near 10 seconds, but I like
working with such a large site because the effects of changing parts
of the script are exagerated.

The subsites are stored in a database, but the first thing I did was
make sure that all the database accesses happened at the same time. So
there are only two calls to the database (no matter how big the tree
gets) and they both use the same database handle. The database stuff
happens before I go looking for the subdirectories.

my $nodePath = "$basePath/".$node->getDirectory();
find(\&wanted, "$basePath/".$node->getDirectory());

sub wanted {
	my $currentFile = $File::Find::name;
	if(-d $currentFile) {
		if($currentFile ne $nodePath) {
			my $newDir = $currentFile;
			$newDir =~ s/$basePath\///;
			
			# if this directory is actually a site, 
			# we only want to recurse it
			# if we're told to by the recurseSubSites parameter
			if(!$siteTree->isNodeSite($newDir)) {
				# if this directory isn't a site, 
				# add the directory to the site tree
				$siteTree->addDirectory($newDir);
			} elsif(!$recurseSubSites) {
				# we don't want to recurse any of this directory's subdirs
				$File::Find::prune = 1;
			} # end if
		} # end if
	} # end if
} # end wanted

Since I posted here, I've done more comparisons of how fast it runs. A
lot of the problem is with the adding the node to the site tree and
I'm going to try to reduce that by doing sorting within the nodes as I
add them (and probably some other stuff too).

However, it takes a good 10-15 seconds just to print the directories
with the rest of the sub commented out. Perhaps I'm doing something in
an inefficient way? Or is it that I'm going to have to live with this
sort of speed if I'm using perl to recurse that many directories? I
actually didn't realise that I had so many files in the directories, I
thought it was only one or two thousand. I don't think I can rely on
the sorting of the operating system because I'm on a unix system that
seems to just return the files on alphabetical order.

Anyway, any comments or suggestions about the code would be
appreciated. I'm a bit of a newbie perl programmer so I'm just
muddling along and don't really know if I'm doing things the best way.

Thanks again for your help. It's given me a few more things to think
about.

              Helen


------------------------------

Date: Fri, 15 Aug 2003 10:47:00 +0100
From: "Paul Neave" <paul@FAKEneave.com>
Subject: Help! Regular expression on html...
Message-Id: <bhia77$6le$1@newsreader.mailgate.org>

Hi group,
Could someone help me with me regexp please?

I'd like to find all links in HTML like this:

<a href="blahlink">some text here</a>

and change it to:

<a href="blahlink">(link)</a>


So that anything between the <a> tags gets stripped and replaced
with (link).

Help!
Many thanks,
Paul.




------------------------------

Date: 15 Aug 2003 01:42:42 -0700
From: dave@zerofive.co.uk (David Baird)
Subject: Re: how to autovivify a package from a string
Message-Id: <694af498.0308150042.40d05540@posting.google.com>

Eric Schwartz <emschwar@pobox.com> wrote in message news:<eto7k5ggcps.fsf@wormtongue.emschwar>...

> Because if he's trying to do what I think he's trying to do, then a
> factory would help.  If he's not, then nevermind.  Either way, more
> clarification will help.
> 
> -=Eric

Yes, I'm sorry I used the word 'autovivify' - it seemed to fit what
I'm trying to do, but isn't related to autovivification of values in
Perl.

I don't know anything about factories etc, but what I have is a
template of code for a simple package, with a few tokens that I
substitute in. In particular, I substitute in the package name, and an
entry in the @ISA array, to build a hierarchy of classes. So the
template is something like

package <<PACKAGE_NAME>>;
use strict;
use warnings; 

use <<PARENT>>;
use vars qw(@ISA);
@ISA = qw(<<PARENT>>);

my %ATTRIBUTES = ( <<ATTRIBUTES>> );

sub attr {
    ... code to access attributes ...
}

1;

There's also a base class that these classes all inherit from
(directly or indirectly) which supplies a bunch of other methods.

So I got to the stage where I had all the attributes figured out and
substituted  into the template, and I wanted to issue a 'use'
statement. I couldn't figure out how to issue that statement though,
because the package only exists in a scalar variable, not as a file on
disk that 'use' would find through its search path. But it seems to
turn out that I can simply eval the string and the package comes into
existence as if I had use'd it. I think. 'use' and 'eval' seem to me
to be very different things, however, so now I'm wondering if there
are any gotchas I need to be aware of.

Is this sort of thing a factory? 

FYI, each of these generated classes represents a single table in a
database, and the inheritance between them represents foreign keys. So
all the tables have an 'id' column that relates them to each other.
The attributes hash of each object describes the columns of that
table, and also provides parameters used for generating HTML form
elements for accessing that column through a web page. The base class
provides methods for reading from or writing to the database, and for
generating web forms and validating input.

Thanks, 

David.


------------------------------

Date: 15 Aug 2003 01:57:44 -0700
From: dave@zerofive.co.uk (David Baird)
Subject: Re: how to autovivify a package from a string
Message-Id: <694af498.0308150057.2850929f@posting.google.com>

Uri Guttman <uri@stemsystems.com> wrote in message 

> which is what we both have asked for and not received.
> 
> uri

Well, you're probably in the US, and I'm in the UK, so I was in bed
while you were asking for clarification.

These factories and patterns sound quite fascinating to me. I'm at the
stage of having got quite comfortable with Perl as my first
programming language, and now I'm thinking about learning more
advanced techniques i.e. I have no formal training and I'm wondering
about the theory of programming a bit more. Can you recommend a book
to start with, not necessarily (but preferably) using Perl?

David.


------------------------------

Date: Fri, 15 Aug 2003 05:04:25 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: how to autovivify a package from a string
Message-Id: <Xns93D83DCAA5270sdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Uri Guttman <uri@stemsystems.com> wrote in
news:x7lltwyowc.fsf@mail.sysarch.com: 

>>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
> 
>   ES> Uri Guttman <uri@stemsystems.com> writes:
>  >>>>>>> "ES" == Eric Schwartz <emschwar@pobox.com> writes:
>   ES> To the OP: If you can live without autovivification, the best
>   answer I ES> can come up with is to use a factory pattern to build
>   the classes for ES> you.  It's not automatic, but it's nearly so.
>  >> 
>  >> and that makes little sense either. perl doesn't need most
>  >> patterns as it is a higher level language with many of those
>  >> (silly) things built in.
> 
>   ES> A pattern is simply a programming concept.  Factory patterns
>   make as ES> much (or as little, I suppose) sense in Perl as they do
>   in any other ES> language.  Just glancing at the inside of my
>   _Design Patterns_ book, ES> most of them seem quite applicable to OO
>   programs written in Perl. 
> 
> and most of them are not needed since perl is so dynamic. calling a
> scalar var some silly pattern name just because it can hold ANYTHING
> (which requires massive ugly pattern code in c++) is silly. factory
> pattern is another silly name. it is so trivial to generate stuff in
> perl from multiple classes that even calling it factory is overkill. a
> simple hash table of token to class names is all you need. late
> binding and polymorphism are built in and do all the hard work.

Dominus has some insightful (imho) observations on the whole "design 
patterns" thing:   http://perl.plover.com/yak/design/

- -- 
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPzywKGPeouIeTNHoEQIBSgCgpC1b3nBcp2xEI6+zppNrgsRYz2gAn310
pQ//OQRo5t6DPBq32EPiz9d6
=0NuT
-----END PGP SIGNATURE-----


------------------------------

Date: 15 Aug 2003 09:25:56 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Please offer critique on my 2nd JAPH
Message-Id: <slrnbjp9p4.jtm.abigail@alexandra.abigail.nl>

Uri Guttman (uri@stemsystems.com) wrote on MMMDCXXXVI September MCMXCIII
in <URL:news:x7vfszy306.fsf@mail.sysarch.com>:
-: >>>>> "DO" == David Oswald <spamblock@junkmail.com> writes:
-:  
-:   DO> Perhaps I should build the string up to bytes from a series of
-:   DO> bits, to avoid such a long literal, which contributed to the JAPH
-:   DO> exceeding the four line tradition.
-:  
-:  just don't get abigail started on that japh theme. she will fry your
-:  brane with her japh-fu. :)


I haven't written a Japh in over 2 years. As for this particuliar
Japh, I don't find it inspiring. It's in the class I call "data hiding",
where the string 'Just another Perl Hacker' is encrypted, and a rather
simple decryption technique is used to get the string back.


Abigail
-- 
perl -Mstrict -we '$_ = "goto F.print chop;\n=rekcaH lreP rehtona tsuJ";F1:eval'


------------------------------

Date: Fri, 15 Aug 2003 02:22:32 -0500
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
Message-Id: <8MedneqcNtKlF6GiXTWJiQ@august.net>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://mail.augustmail.com/~tadmc/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume 

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "Jeopardy" (because the answer comes before the question), or
        "TOFU".

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan <tadmc@augustmail.com> and many others on the
    comp.lang.perl.misc newsgroup.



------------------------------

Date: Fri, 15 Aug 2003 08:55:44 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: regex diffs between perl 5.6.1 and 5.8.0?
Message-Id: <3f3c9ebc.301200988@news.erols.com>

Patrick Flaherty <Patrick_member@newsguy.com> wrote:

: Back in 5.6.1, the following succeeded in stripping out all x1a garbage chars
: from a set of files:
: 
:   perl -p0777 -i.bu -e 's/\X1a+$//g' house.lis
:
: I run the same thing under 5.8.0 and it has no effect.
                            
Case matters.  "\X1a" is not the same thing as "\x1a".
"\X" in a regex has its own special meaning.

If that code worked as expected in 5.6.1., it probably shouldn't have.
The difference in behavior between 5.6.1 and 5.8.0 would be because of
a bug fix, though I'm not seeing it right away in the delta docs.



------------------------------

Date: 15 Aug 2003 02:08:54 -0700
From: john_ramsden@sagitta-ps.com (John Ramsden)
Subject: Skipping fields when using unpack()
Message-Id: <d27434e.0308150108.41aa64b3@posting.google.com>

I need to extract a couple of ASCII fields from a string of fixed-length
fields, let's say 'ABCxPQxxUVW' in which I'm not interested in characters
in positions indicated by 'x'. This can easily be done by the code line:

   ($a, $junk1, $p, $junk2, $u) = unpack "A3 A A2 A2 A3", $string;

But I was wondering if there is an unpack() spec one could use in the
control string to skip the junk fields and not have to extract them,
thus making the code slightly shorter.

I have tried reading the unpack and pack perldoc schpiel, but can't see
any obvious solution.


Cheers

John R Ramsden (john_ramsden@sagitta-ps.com)


------------------------------

Date: 15 Aug 2003 09:21:07 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Skipping fields when using unpack()
Message-Id: <bhi8m3$nrk$1@nets3.rz.RWTH-Aachen.DE>

Also sprach John Ramsden:

> I need to extract a couple of ASCII fields from a string of fixed-length
> fields, let's say 'ABCxPQxxUVW' in which I'm not interested in characters
> in positions indicated by 'x'. This can easily be done by the code line:
> 
>    ($a, $junk1, $p, $junk2, $u) = unpack "A3 A A2 A2 A3", $string;
> 
> But I was wondering if there is an unpack() spec one could use in the
> control string to skip the junk fields and not have to extract them,
> thus making the code slightly shorter.

Yes, there is. The 'x' template will skip bytes when unpacking:

    ($a, $p, $u) = unpack "A3 x A2 x2 A3", $string;

> I have tried reading the unpack and pack perldoc schpiel, but can't see
> any obvious solution.

There is also 'perldoc perlpacktut'.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: 15 Aug 2003 09:35:09 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Skipping fields when using unpack()
Message-Id: <slrnbjpaad.jtm.abigail@alexandra.abigail.nl>

John Ramsden (john_ramsden@sagitta-ps.com) wrote on MMMDCXXXVI September
MCMXCIII in <URL:news:d27434e.0308150108.41aa64b3@posting.google.com>:
==  I need to extract a couple of ASCII fields from a string of fixed-length
==  fields, let's say 'ABCxPQxxUVW' in which I'm not interested in characters
==  in positions indicated by 'x'. This can easily be done by the code line:
==  
==     ($a, $junk1, $p, $junk2, $u) = unpack "A3 A A2 A2 A3", $string;
==  
==  But I was wondering if there is an unpack() spec one could use in the
==  control string to skip the junk fields and not have to extract them,
==  thus making the code slightly shorter.

($a, $p, $u) = unpack "A3 x A2 x2 A3" => $string;


Abigail
-- 
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;        
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";


------------------------------

Date: Fri, 15 Aug 2003 03:25:26 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: re: soap, etc
Message-Id: <btcpjvc05pi59sujfq399n7okamb1mc1kp@4ax.com>

I think it is a bad habit the perl community has of doing everything
through modules, etc...of course, I got no clue as to writing a socket
in C, so maybe I shouldn't complain.

but...writing a soap request through http is not so hard... when I
look through, I find zero examples on the web (for google api's)


------------------------------

Date: Fri, 15 Aug 2003 08:59:51 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: soap, etc
Message-Id: <3f3ca031.301574183@news.erols.com>

Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:

: I think it is a bad habit the perl community has of doing everything
: through modules, etc

So what?

If you don't like modules, don't use them.

If you think your opinion is going to change how Perl programmers do
their work, you're wrong.



------------------------------

Date: Fri, 15 Aug 2003 16:13:23 +0800
From: "pitt" <randy_chang@sohu.com>
Subject: Re: strange error  "Unsuccessful stat on filename "
Message-Id: <bhi4i8$j79$1@mail.cn99.com>

I got the error when i install Compress::zlib
when run "perl Makefile.PL"
there two statement as following:

"Unsuccessful stat on filename containing newline at
/usr/local/lib/perl5/5.8.0/IA64.ARCHREV_0/Cwd.pm line 213.
Parsing config.in...
Looks Good.
Up/Downgrade complete.
Unsuccessful stat on filename containing newline at
/usr/local/lib/perl5/5.8.0/ExtUtils/MM_Unix.pm line 2775.
WARNING: CAPI is not a known parameter.
Writing Makefile for zlib
Writing Makefile for Compress::Zlib

"
It seems the "Unsuccessful stat..."    does not lead errors.
another question is that in make file  ,the CC is defined to gcc ,but i have
no gcc in system ,why they do so?

"James Willmore" <jwillmore@cyberia.com>
??????:e0160815.0308141522.239b300c@posting.google.com...
> > Hi,
> > I get such a error
> > Unsuccessful stat on filename containing newline at
> > /usr/local/lib/perl5/5.8.0/ExtUtils/MM_Unix.pm line 2775
> >
> > when i install a module .
> >
> > I use HP-UX  IA64
> > i wouder does the file  MM_Unix.pm  contains some characters which the
HP-UX
> > does not recognise or Perl in HP-UX
> > does not know.
>
> What module are you trying to install?  How are you installing it?
> Have you had trouble installing other modules?
>
> At first glance, it looks like someone may have made a mistake in
> creating the Makefile.PL file for this module.  It may not be Perl
> or the OS that's at fault, but the mdoule.
>
> Jim




------------------------------

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



------------------------------

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.  

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 5365
***************************************


home help back first fref pref prev next nref lref last post