[16715] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4127 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 25 06:05:32 2000

Date: Fri, 25 Aug 2000 03:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967197916-v9-i4127@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 25 Aug 2000     Volume: 9 Number: 4127

Today's topics:
    Re: $: in regular expressions (Villy Kruse)
    Re: A Proposal for BaseLib module (was Re: Modifying @I <hasant@trabas.com>
    Re: A Proposal for BaseLib module (Hasanuddin Tamir)
        ANNONCE: AI::NeuralNet::Mesh v0.31 <jdb@wcoil.com>
    Re: Callling Java method with Perl <amonotod@netscape.net>
    Re: cookies. (Abigail)
        dbmopen database, help! please <dan@fatguy.com>
    Re: direct screen access..... <gellyfish@gellyfish.com>
        Extracting a number of lines in a text file <lem@ocean.com.au>
    Re: Extracting a number of lines in a text file <uackermann@orga.com>
    Re: Get ip from visitor <Olaf@XCC.TMFWeb.NL>
    Re: HELP!- Writing perl script <simon@nospam.edincc.co.uk>
    Re: How do I insert a carriage return? (Keith Calvert Ivey)
    Re: how to generate unreadable from readable perl code (David H. Adler)
        How to Get Script Host??? <Greg.Jackson@noaa.gov>
    Re: How to Get Script Host??? <nickco3@yahoo.co.uk>
    Re: How to Get Script Host??? jon_nixon@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 25 Aug 2000 08:07:04 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: $: in regular expressions
Message-Id: <slrn8qca5s.lb.vek@pharmnl.ohout.pharmapartners.nl>

On Thu, 24 Aug 2000 13:42:20 GMT, JL Goldstein <jgoldst@my-deja.com> wrote:
>I've searched all my reference books, but I can't find out what $: means
>in a regular expression, as in
>
>	(?:\d\d\d\d\d)


Where is the typo?  Was it "$:" or was it "?:".


>
>to match zip codes (example taken from *Mastering Regular Expressions*
>by Jeff Friedl, O'Reilly, 1997).
>

The (?: construct is explained at length in this book. 



Villy


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

Date: Fri, 25 Aug 2000 05:48:04 GMT
From: Hasanuddin Tamir <hasant@trabas.com>
To: bandung-pm-list@happyfunball.pm.org
Subject: Re: A Proposal for BaseLib module (was Re: Modifying @INC...)
Message-Id: <8o51af$jev$1@nnrp1.deja.com>

In article <sqajkfbpt91172@corp.supernews.com>,
  "Chris Stith" <mischief@motion.thispartfake.net> wrote:
>
> "Hasanuddin Tamir" <hasant@trabas.com> wrote in message
> news:8o2lh4$s75$1@nnrp1.deja.com...
> > In article <39a4b3d5@news.victoria.tc.ca>,
> >   yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> > > Hasanuddin Tamir (hasant@trabas.com) wrote:
> > > : In article <sq8n506bt91153@corp.supernews.com>,
> > > :   "Chris Stith" <mischief@motion.thispartfake.net> wrote:
> > > : >
> > > : > "Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in
message
> > > : > news:39a41d62@news.victoria.tc.ca...
> > > : > > hasant@trabas.com wrote:

[
  First of all, I want to apologize if any part of my previous posting
  have, directly or otherwise, offended you, or anyone else.  I also
  want to thank you for providing deligthful message.  In fact, I had
  never been in this such "hot" discussion concerning a matter in
  Perl.  This is probably one of my most exciting moments in my life
  with Perl.
]

> > This thread didn't go as expected since you seemed to only
> > quote the problem part. But I also realized that I have put
> > misleading subject and that people tend to quick-scanning
> > part of (specially long) ng message. If this is not true, I'm
> > sorry, never meant to blame anyone but myself.
>
> The solutions provided do apply to your requirements.
> Just because someone snips a portion of your message
> doesn't mean they aren't interested in it. I snip for
> brevity and clarity.
[snipped]

I didn't judge by seeing the partly quoted reply. I did by studying
the reply itself.

> I'm not sure why, when you ask us to discuss the usability,
> viability, and desirability of a new module and we offer
> simpler alternatives, you seem to get defensive and point
> out that we were not discussing the module.

Of course I must defend my argument.  As I said before, the point of
my posting was proposing a new module.  But I'm sure that we both agree
that the more important thing is finding solution(s) to the problem.
I didn't defend for the module, but for the solution I offer. It just
happenned that my solution was implemented in a module.  Just because
it's a module doesn't mean it's more complex.

I highly appreciate your alternative, as well as others.  But I have
to examine and re-examine all solutions (including mine) against the
problem and the requirements.  If at some point I see that one
solution fails to fulfill one or more reqs, I'll point it out (I'll
soon get back to your alternative.)

> As a matter of fact, it's pretty close to impossible to express the
> opinion that the module is unneccessary and make a
> strong argument to that effect without pointing out
> alternatives. Since some of us pointed out alternatives
> which would be simpler than using a module, let alone
> creating and distributing one, I'd say that *was*
> discussion about the module, or at least about thee need
> for it, which is one of the things people normally discuss
> when discussing a possible new module.

That's why I put my last question at the end of my original posting,
if a module is really worth it.  I realize that not everyone has the
same situation, even if it's true, everyone might come with different
(preferred) solutions.  I implemented my solution in production work
for every script.  The idea about the module came later after the
project was released.

So in the hope that this piece of code could benefit other people
with the same problem and situation, I wanted to make it widely
available.  As a module purpose, users don't need to re-code the
same thing (as we all know.)

> I'd never discourage someone from publishing a module
> if they believe it will help others, but when you asked for
> discussion, I, personally, and possibliy others as well
> assumed you were asking for all of our thoughts on the
> matter, not just how to do it in a module. If you weren't
> asking for our opinions on whether or not we thought it
> was a module we'd use, I'm sorry to have possibly
> offended you by bringing up that topic. By all means,
> go ahead and publish your module. I'm sure many
> people will use it. I will not. Since you did call your post
> a proposal, it would definitely seem to ask for comment
> on the need for the module as well as how to implement
> it.

No, no, you didn't offend me at all, or at least I don't feel
offended :-) And you're right, we aren't supposed to limit
ourselves discussing solely on the module.  As I said above,
the more important thing is to find the solution. If I wasn't
asking for other opinions, why would I post it as a proposal.
If it wasn't meant for sharing, why I bothered posting at all.

As a matter of fact, you have contributed indirectly to my
problem by providing alternative solution. It made me thinking
it over again, examining again, and making comparison. And for
me, it becomes clearer than before that I need to wrap my
solution in a module. The same thing happenned when a friend
at our local PM group gave another alternative solution.

> > So I think I need to repost what I wanted to say in a new thread
> > to make this straight (hopefully). I hope both of you, Chris and
> > Malcolm, are still interested in discussing this matter.
>
> I am interested in continuing the thread, but please do not
> make it a new thread. That will confuse people's news
> readers into displaying it separately, including mine. I have
> this thread marked to watch, and I'd hate to miss the new
> thread. I think there is a lot that could be gained by
> discussion of this, and maybe we could help figure out
> how to best implement the module, since you seem set
> to do so. Please understand I have nothing against having
> a module available to do this, I just think it wouldn't be
> very crucial that it be done with a module as opposed to
> by hand, since it's not that much code to add to each
> program.

I would still put it on my consideration even if people really
againsted the module I propose as long as they provide reasonable
arguments.  There's no reason to keep a module if it's no good or
useful at all.  And you did provide reasonable argument.  Please
also note that I don't insist to have this module's existence.
But if it's still possible, I'll carry on.

Unfortunately, I already posted a new thread before I read your message
and I don't have any idea how to put it back on here.  Now I see the
problem since I must switch to the other thread in order to respond to
your reply instead of simply following this same one.

Thank you very much for your attention, understanding and
contribution.

Best regards,
--
san


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 23:46:26 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: A Proposal for BaseLib module
Message-Id: <slrn8qcg90.lqh.hasant@borg.intern.trabas.co.id>

On Thu, 24 Aug 2000 19:47:30 -0500,
Chris Stith <mischief@motion.thispartfake.net> wrote:

> I apologize to all the readers for including all of the original
> post in my reply. The OP, in a seperate thread on the
> same topic, assumed that any part of his original post
> not included in the reply was not addressed in the reply.

Now your so cynical to me :-)


> "Hasanuddin Tamir" <hasant@trabas.com> wrote in message
> news:8o37ph$g3j$1@nnrp1.deja.com...
> > NAME
> >
> > BaseLib - manipulate @INC dynamically for independent installation
> >           path
> >
> > [WARNING: The module name is still subjected to change]
> >
> >
> > DESCRIPTION
> >
> > BaseLib provides a simple and straightforward mechanism to
> > include private library path of an application set to @INC
> > independent of installation path.  It optionally takes two
> > arguments, which also happen to be the keywords of this
> > module: BASEDIR and LIBDIR.
> >
> > This module is intended for a set of application with certain
> > file and directory structure, not for ordinary single script
> > at general. The typical structure could be:
> >
> >     mail2sms/  -> base directory of the application
> >      scripts/  -> where the scripts located, this directory
> >                   might have so many nested directories
> >      libdir/   -> path of the private modules
> >      others/   -> other directory
> >
> > The usage is similiar to lib.pm,
> >
> >     use BaseLib qw(BASEDIR LIBDIR);
> >
> > In the absence of the arguments, BaseLib will use the default
> > values: `appl_root' (subjected to change) and `lib' respectively.
> >
> > For example, the structure is put under `/installation/path'.
> > Using lib.pm, all scripts need to say,
> >
> >     use lib '/installation/path/mail2sms/libdir';
> >
> > What happens when the application is moved to, for example,
> > `/new/installation/path'?  Of course, in order for it to work,
> > all scripts must be modified to refer to the new pat,
> >
> >     use lib '/new/installation/path/mail2sms/libdir';
> >
> >
> > OK, one may use environment variables, either the built in
> > ones (PERL5LIB and PERLLIB), or customized one, say, PRIVLIBDIR.
> > The scripts only need to say once,
> >
> >     use lib "$ENV{PRIVLIBDIR}";
> >
> 
> It'd be just as easy to say this once per script:
> 
> push(@INC, PRIVLIBDIR);

Do you mean `PRIVLIBDIR' as bareword or CONSTANT? Well, I guest
you mean it as $ENV{PRIVLIBDIR} since bareword doesn't make
sense to me, and CONSTANT makes me having to define it somewhere
else.

Anyway, the problem with this is that I have to change the value
each time I move to different path. And if I have multiple versions
in the same machine, each with their own paths, only one
$ENV{PRIVLIBDIR} is referred to by all versions.


> or am I missing something? Of course, the preferred way to add to
> @INC according to the documentation is
> 
> use lib "directory";
> 
> but didn't you know that you can feed it a list? Try this :
> 
> use lib ("/var", "/etc");
> 
> and see what it does.

Yes, I know lib.pm takes list. Each element can be either absolute
or relative path to the lib. With absolute path, there's also some
effort to change it when the application moves. With relative path
there's a potential problem for nesting directory, specially when
a script moves to a different level.

I have put examples and comparison on my homepage,

    http://www.zp.f2s.com/perl/modules/BaseLib.examples


> > or nothing at all if PERL5LIB/PERLLIB is used.  But then
> > someone must be responsible to maintain the content of the
> > environment variables, either via global profile (assumming
> > unices), or, via web server conf (and don't forget to reload
> > or restart the server :-), each time the installation path
> > changes (Thanks to Steven Haryanto for providing this
> > examples.)
> >
> > And what if during the development process, there are more
> > than one version at the same machine? Or there are multiple
> > developers with their own environment? So many changes need
> > to be done.  Beside PERL5LIB and PERLLIB don't work with -T
> > switch.
> >
> > This when BaseLib comes to rescue. All the scripts have to
> > say is,
> >
> >     use BaseLib qw(mail2sms libdir);
> 
> Wouldn't the folowing work?
> 
> push(@INC, mail2sms, libdir);

No, it means adding `mail2sms' and `libdir' directories at the end
of @INC array. Not to mention the question about where they really
lie relative to running script. There's a different among:

 a. execute a script as `./script',
 b. execute a script as `script' (assuming it's in PATH),
 c. execute a script as `/full/path/to/script', and
 d. execute a script in CGI environment


What I want is, adding `/installation/path/mail2sms/libdir' at the
front of @INC (assumming `/installation/path' is where Mail2SMS is
installed under.)


> or
> 
> use lib ("mail2sms", "libdir");

Same as above. It treats both arguments as different directories
of libpath.


> or am I still missing something?

I think so. Remember, `mail2sms' is the base directory of the
whole application. `libdir' is a private module directory under
`mail2sms'. The arguments to BaseLib are BASEDIR and LIBDIR,
that's why the scripts will say,

   use BaseLib qw(mail2sms libdir);


> > And no further tweaking is necessary, no matter how many
> > environments the application will run in. The scripts will
> > always be able to lookup to the right path to mail2sms/libdir
> > without having to care where mail2sms is put under. Well, as
> > long as no change on mail2sms and/or libdir.
> >
> > As addition, BaseLib has a global package variable $BaseDir,
> > contains full path to the, unsuprisingly, base directory of
> > the application. This is not exported, so it must be qualified
> > with the package name to use it, e.g. $BaseLib::BaseDir.
> 
> You could (and probably should) use @EXPORT_OK
> so others can use it without the package name if they so
> choose without polluting their namespace without asking.

I'll think about that. My consideration is that the primary job
is including a directory to @INC. $BaseDir is merely a side effect.
At the first, it was even a lexical variable in import().


[snipped]
> open(config, "./myscripts.conf");
> $basedir = <config>;
> $libdir = <config>;
> close(config);
> push(@INC, $basedir, $libdir);

> This would allow you to only change two lines no matter
> with how many scripts you are dealing. If the config file
> isn't in the same directory as the scripts, or if the scripts
> aren't all in the same directory, you could try making the
> config file "~/myscripts.conf" or "/etc/myscripts.conf" or
> something similar.

1.  I still need to change the conf if there's a change. With
    BaseLib, no change at all needed as long as `mail2sms' and
    `libdir' remain.
2.  For `~/myscript.conf',
    a. should I make home directory for user `nobody' I the
       application happens to be webbased?
    b. even if each user installs this application in his or her
       home directory, (with BaseLib) I don't need to force them
       to have personal configuration and have them to modify
       all the scripts.
3.  For `/etc/myscripts.conf', let's assumme it contains the
    following two lines,

        /usr/local/mail2sms
        libdir

    Using your code above (I assumme it's in BEGIN block), the @INC
    will have two new elements at the end. When a script says,

        use Module;

    after searching the standard paths, Module.pm will be searched
    in `/usr/local/mail2sms' then `libdir' directories. But the
    Module.pm can't be located because it's there. It's probably
    instead located in `/usr/local/mail2sms/libdir' directory.

    There's still another potential problem in multiple versions
    environment.

One more thing, the two new directories at the end of @INC contain
newline character (Ok, you might just mean the code above to be
a quick example.)


>                    You could maintain a seperate config
> file for each script if you wanted to, but that might defeat
> your purpose.

It's even worse to do so. It also rules out your own words you kept
mentioning (in your different reply) about "simpler alternative".


> > AVAILABILITY
> >
> > The module is currently available via URL,
> >
> >    http://www.zp.f2s.com/perl/modules/BaseLib-0.01.tar.gz
> >
> >
> > CAVEATS
> >
> > At this very early stage, BaseLib lacks of many things:
> >
> >     * portability support
> >     * checking the existence of the path in @INC
> >     * include standard hierarchy style under LIBDIR
> >     * more accommodative regex when untainting
> >     * potentially broken if same name as base dir exists
> >     * might be broken in mod_perl environment
> >     * proper documentation
> >     * good testing (only tested it few times myself)
> >


Best regards,
san
-- 
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com


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

Date: 25 Aug 2000 08:50:46 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: ANNONCE: AI::NeuralNet::Mesh v0.31
Message-Id: <8o5c16$b5e$0@206.230.71.62>

Greetings!

Announcing the release of:

    AI::NeuralNet::Mesh, version 0.31

(AI::NeuralNet::Mesh is an optimized, accurate neural network Mesh
written in Perl.)

Download at: (***recomended download url***):
http://josiah.countystart.com/modules/get.pl?mesh:clp.misc

This module has also been released on the CPAN as:
   file: $CPAN/authors/id/J/JB/JBRYAN/AI-NeuralNet-Mesh-0.31.zip
  size: 82087 bytes


** What's new?

>From the POD:
This is version *0.31*, the second release of this module.

In this version, I have included three major features. Also in this
release I have included two minor fixes which increase the learning
speed of networks. I also fixed a bug in the load_pcx() method which
prevented it from loading the PCX::Loader module correctly. This
version also has the ability to have negative weights in the network.

The major features added are:

LAYER SIZES

Rodin Porrata once suggested it would be good to have control over
each layer's node size. Well, Rodin, here you go. Each layer can
have a custom number of nodes, which you can set in two ways, detailed
in the new() constructor, below. Layer sizes are preserved across load()
and save() calls.

LAYER EXTENSION

With the ability to have custom layer sizes, I have also included the
ability to extend layer sizes after network construction. You can add
nodes with extend() or extend_layer() after the network is constructed
or loaded.


CUSTOM NODE ACTIVATION

Ahh, and another treat. You can choose from one of four activation
functions and set the activation function by layer, or you can even
set each individual node to a seperate activation function. Possible
activation types are:
        'linear' (simply transfer sum of inputs as output)
        'sigmoid' (also called 'sigmoid_1') (0 or 1, threshold based)
        'sigmoid_2' (-1,0,1, threshold based)
        user specified (passed as a CODE ref.)

You can also customize threshold levels on a per-layer, or per-node basis.

** What is this?

AI::NeuralNet::Mesh is an optimized, accurate neural network Mesh
written in Perl. It was designed with accruacy and speed in mind.
This better learning accuracy (by twenty-three percent), as well
as a much faster learning rate and run speed over any other neural
network simulater that I know of in Perl.(*)

Included are fifteen seperate example scripts. In particular demonstration
of the accuracy and speed of this network model, check out ex_add2.pl,
ex_dow.pl, and ex_add.pl.

As always, included is a cleaned, CSS-ed, HTML-format of the POD docs.


** What do you think?

Now I know you people are out there that are using the module...
I can hear the fists hitting the keyboards in frustration. :-) Relieve
some of that frustration by e-mailing me and letting me know what
you think of the module and any suggestions you got.

Use it, let me know what you all think. This is just a
groud-up write of a neural network, no code stolen or
anything else. Don't expect a classicist view of nerual
networking here. I simply wrote from operating theory,
not math theory. Any die-hard neural networking gurus out
there? Let me know how far off I am with
this code! :-)

Regards,

        ~ Josiah Bryan, <jdb@wcoil.com>


(*) In regards to the speed claim: I only know of two neural networks
in Perl, AI::NeuralNet::Mesh (this module) and AI::NeuralNet::BackProp,
both of which I wrote. If someone else has written a neural-net in Perl
I would love to see how or what techniques you have used. I am sorry if
I have missed anybody's Perl neural-net. If I have, it was not an
intentional error on my part.

--
Josiah Bryan
VP of Product Development
TDCJ, Inc.
"Anything is possible."

vp@tdcj.com
http://www.josiah.countystart.com/

Tel: 937.316.6256






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

Date: Fri, 25 Aug 2000 04:43:50 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Callling Java method with Perl
Message-Id: <8o4ti2$fgq$1@nnrp1.deja.com>

In article <Kyvo5.167322$1h3.3068407@news20.bellglobal.com>,
  "Etienne Laverdiere" <info@digitaltango.com> wrote:
> Hi all,
>
> can I call a Java Method from a Perl script? I want to import data
> from a database to a "private" database;
>
> The reason is that I only have some JAVA API to access this "private
> database".
> All my data-structure and my (web) interface are already in Perl (CGI
> by most) and I would like to use the JAVA API given by the "private
> database" to access it (passing perl parameter).
>
> I think this can be very tricky.
> Maybe I need a perl-java package to access a Oriented-Objet java API
> with some perl.
> I am not sure for now.
>
> Is it possible?

Perhaps put a properly configured Java based web-server on a different
port on the same machine, then use LWP to pass the params to the Java
program?  Definitely the low-tech method, I admit...

HTH,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 Aug 2000 07:47:39 GMT
From: abigail@foad.org (Abigail)
Subject: Re: cookies.
Message-Id: <slrn8qc93g.tj3.abigail@alexandra.foad.org>

shalu892 (j_bandi@yahoo.com) wrote on MMDL September MCMXCIII in
<URL:news:sqbbuh44t9157@corp.supernews.com>:
\\ Hi,
\\ I want to know where the cookies are stored on a client's
\\ browser. I know that in netscape it is stored in 
\\ .netscape/cookies file but what about other browsers? I would
\\ appreciate if you answer my question.


And the relevance of your posting to Perl is what exactly?



Abigail
-- 
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'


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

Date: Thu, 24 Aug 2000 05:25:47 GMT
From: Dan <dan@fatguy.com>
Subject: dbmopen database, help! please
Message-Id: <39A4B1D8.F8F5B163@fatguy.com>

Hello,
Is anyone familiar with using dbmopen to create a hashed database? I am
experiencing problems adding additional records to it. It is
approximately 8000 entries, about 125 bytes per entry. Why would it be
doing this?

I am running perl5.004 on bsdos

Any info would be appreciated.

Thanks,

Dan






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

Date: 25 Aug 2000 08:33:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: direct screen access.....
Message-Id: <8o57fh$kh$1@orpheus.gellyfish.com>

On Thu, 24 Aug 2000 16:11:12 +0100 Chris Denman wrote:
> I didn't say that I wanted the code to be portable.
> 
> I also didn't expect you to be helpful, but did expect you to be
> condescending and pedantic.
> 
> I you can't be constructive, then be destructive elsewhere.
> 
> I find perl a language that allows me to express myself quite easily.  I
> merely wanted to express my interest in programming pointless games in Perl,
> just for the hell of it.
> 
> I had a good look around for the answer, to no avail.  This newsgroup has
> genuine people that do want to help.  I thank all of those people who have
> helped me in the past.
> 

Well its all over now, your little outburst has almost certainly got you
in a number of killfiles ...

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Fri, 25 Aug 2000 19:29:03 +1000
From: "Minh Le" <lem@ocean.com.au>
Subject: Extracting a number of lines in a text file
Message-Id: <8o5drh$b91$1@perki.connect.com.au>

Hi,
I have been strucgling, from my perl script,  to extract a number of text
lines from a file and them to a new file.
The text string that I would like to extract,  always starts with a + sign
and then has a whitespace then the rest is a text  (ie +  hello I need
help..)
and when it writes to these text strings to a new file, I need to drop the
"+" sign and only add the rest of the text strings to the new file.
Please help !!!

Regards




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

Date: Fri, 25 Aug 2000 11:26:03 +0200
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Re: Extracting a number of lines in a text file
Message-Id: <39A63BAB.F56B825E@orga.com>

Minh Le wrote:
> 
> Hi,
> I have been strucgling, from my perl script,  to extract a number of text
> lines from a file and them to a new file.
> The text string that I would like to extract,  always starts with a + sign
> and then has a whitespace then the rest is a text  (ie +  hello I need
> help..)
> and when it writes to these text strings to a new file, I need to drop the
> "+" sign and only add the rest of the text strings to the new file.
> Please help !!!
> 
> Regards

while (<INFILE>) {
	$_ =~ /^+(.*)/;
	$what_you_where_looking_for = $1 . "\n";
	# write line into new file
}

should do the work.

Ulrich
-- 
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925 
mailto:uackermann@orga.com



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

Date: Fri, 25 Aug 2000 05:37:52 GMT
From: "Olaf van der Spek" <Olaf@XCC.TMFWeb.NL>
Subject: Re: Get ip from visitor
Message-Id: <QCnp5.17890$Kw2.212291@flipper>


"Brian A. Sayrs" <sowinso@sowinso.com> schreef in bericht
news:Hvgm5.1233$3T4.254495@sea-read.news.verio.net...
>
> <rune@clamon.dk> wrote in message news:8nanqf$9i1$1@nnrp1.deja.com...
> > Hi,
> > I want to get the ip-adress from the visitor on my homepage that
> > executes my perl cgi-script. How is this possible?
> >
> > Regards,
> > Rune Christensen - DK
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> Write a script which contains the following line:
>
> foreach $key (keys %ENV) { print "$key -> $ENV{$key}<BR>\n" }
>
> and you will find out lots of fascinating things about your guest.

You should really print this to a file, else the guest will find lots of
fascinating things about himself.

> --
> Brian A. Sayrs
> Owner, Southwind Solutions
>
>
>




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

Date: Fri, 25 Aug 2000 09:33:44 GMT
From: "Simon" <simon@nospam.edincc.co.uk>
Subject: Re: HELP!- Writing perl script
Message-Id: <Y3rp5.1342$NR3.200916@news1.cableinet.net>

Hi Drew,

That's exactly what I meant I have an HTML form that needs to upload and
e-mail an attachment along with other details collected like the users name
and e-mail address.

I'm sorry if I MISS posted I was not aware that this sort of message was not
suited to this newsgroup, I have seen other messages like this floating
around in here.

Thanks for making me feel welcome

Simon



"Drew Simonis" <care227@attglobal.net> wrote in message
news:39A5458F.90F67D39@attglobal.net...
> Simon wrote:
> >
> > Hi everyone
> >
> > I'm looking for someone to write or help me write a perl script  that
will
> > process data coming from an HTML form with and attachment.  Lots of
people
> > have suggested using mime::lite.
> >
>
> What are you meaning?  A form with an attachment?  This isn't
> possible.  If you mean uploading a file via a web form, that
> is handled quite nicely by CGI.pm.  MIME::Lite is, well, MIME.
> MIME is not HTTP.
>
> I suggest posting to comp.infosystems.www.authoring.cgi, where
> this sort of question _might_ be better answered.
>
> (With my appologies to the regular posters in that group)




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

Date: Fri, 25 Aug 2000 04:01:47 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How do I insert a carriage return?
Message-Id: <39a9ee9d.4707495@news.newsguy.com>

Perrin Kliot <perrin@lacis.com> wrote:

>Thanks for the tip on Text::Wrap, unfortunatly I can't figure out how to get
>it to work. I found several examples online such as the one below but I can't
>get them to wrap the text. Is there something special I should know about
>using the module??
>
>use Text::Wrap;
>
>$Text::Wrap::columns = 20;
>$pre1 = "\t";
>$pre2 = "";
>
>print wrap( $pre1, $pre2, "Hello, world, it's a nice day, isn't it?\n" );

That wraps for me.  Is that your whole script?  If not maybe
you're doing something else to undo the wrapping.

Note that if you're using the text within HTML, then of course
newlines will be treated like any other whitespace.  That's how
HTML works.  You'll have to change the newlines to BR tags or
wrap the text in a PRE tag.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: 25 Aug 2000 05:33:06 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: how to generate unreadable from readable perl code
Message-Id: <slrn8qc18i.phj.dha@panix2.panix.com>

On 25 Aug 2000 00:04:15 GMT, Eli the Bearded <elijah@workspot.net> wrote:
>In comp.lang.perl.misc, David H. Adler <dha@panix.com> wrote:
>> Eli the Bearded <elijah@workspot.net> wrote:
>> >I've used regexps like:
>> >	s X (some regexp that includes lots of ! \# \$ \@ \% / , )
>> >	  X &replacestring($1) Xxes;
>> Indeed.  I was just thinking of you, in fact, while reading through
>> the new edition of the camel, which indicates that you can no longer
>> do this... unless I misread.  :-(
>
>(output wrapped)
>
>$ perl -MO=Deparse -w
> s X (some regexp that includes lots of ! \# \$ \@ \% / , )
>   X &replacestring($1) Xxes;
>__END__
>s[ (some regexp that includes lots of ! \# \$ \@ % / , )\n][
>&replacestring($1);]sex;
>- syntax OK
>$ perl -v
>
>This is perl, v5.6.0 built for i686-linux-thread-multi

Cool.  I was upset.  :-)

Probably shouldn't submit this as errata for camel 3, though... don't
want them to change it... :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
This is the Tower of Murder, and... it's where I hang out.
     - Monster of Evil, Flesh Gordon


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

Date: Thu, 24 Aug 2000 16:27:32 -0500
From: Greg Jackson <Greg.Jackson@noaa.gov>
Subject: How to Get Script Host???
Message-Id: <39A59344.3260091C@noaa.gov>

This is a multi-part message in MIME format.
--------------DB9528FC912419138886D72E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am trying to get the name of the machine running my Perl script (it
behaves differently depending on where it is run).  I have tried...

($name, {stuff})=gethostbyname("localhost"); -- Works on NT

open(AFILE,"hostname|"); -- Works in UNIX
$name=<AFILE>;

Is there one way that is platform independant?

Greg

--------------DB9528FC912419138886D72E
Content-Type: text/x-vcard; charset=us-ascii;
 name="Greg.Jackson.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Greg Jackson
Content-Disposition: attachment;
 filename="Greg.Jackson.vcf"

begin:vcard 
n:Jackson;Greg
tel;cell:915-374-4735
tel;fax:915-947-7556
tel;home:915-949-1259
tel;work:915-944-2729x224
x-mozilla-html:TRUE
url:http://www.srh.noaa.gov
org:National Weather Service
adr:;;7654 Knickerbocker Rd.;San Angel;TX;76904;USA
version:2.1
email;internet:Greg.Jackson@noaa.gov
title:Science & Operations Officer
fn:Greg Jackson
end:vcard

--------------DB9528FC912419138886D72E--



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

Date: Fri, 25 Aug 2000 09:05:20 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: How to Get Script Host???
Message-Id: <39A628BF.7D4A9DF1@yahoo.co.uk>

Greg Jackson wrote:

> I am trying to get the name of the machine running my Perl script (it
> behaves differently depending on where it is run).  I have tried...
>
> ($name, {stuff})=gethostbyname("localhost"); -- Works on NT
>
> open(AFILE,"hostname|"); -- Works in UNIX
> $name=<AFILE>;
>
> Is there one way that is platform independant?
>
> Greg

perldoc -q hostname



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

Date: Fri, 25 Aug 2000 08:08:16 GMT
From: jon_nixon@my-deja.com
Subject: Re: How to Get Script Host???
Message-Id: <8o59h6$sud$1@nnrp1.deja.com>

perldoc -q hostname throws up an entry about this in perlfaq9

try...

use Sys::Hostname;
my $host = hostname();
print "$host\n";

 ...but I don't have an NT server to test it on.

- Jon

In article <39A59344.3260091C@noaa.gov>,
  Greg Jackson <Greg.Jackson@noaa.gov> wrote:
> This is a multi-part message in MIME format.
> --------------DB9528FC912419138886D72E
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> I am trying to get the name of the machine running my Perl script (it
> behaves differently depending on where it is run).  I have tried...
>
> ($name, {stuff})=gethostbyname("localhost"); -- Works on NT
>
> open(AFILE,"hostname|"); -- Works in UNIX
> $name=<AFILE>;
>
> Is there one way that is platform independant?
>
> Greg
>
> --------------DB9528FC912419138886D72E
> Content-Type: text/x-vcard; charset=us-ascii;
>  name="Greg.Jackson.vcf"
> Content-Transfer-Encoding: 7bit
> Content-Description: Card for Greg Jackson
> Content-Disposition: attachment;
>  filename="Greg.Jackson.vcf"
>
> begin:vcard
> n:Jackson;Greg
> tel;cell:915-374-4735
> tel;fax:915-947-7556
> tel;home:915-949-1259
> tel;work:915-944-2729x224
> x-mozilla-html:TRUE
> url:http://www.srh.noaa.gov
> org:National Weather Service
> adr:;;7654 Knickerbocker Rd.;San Angel;TX;76904;USA
> version:2.1
> email;internet:Greg.Jackson@noaa.gov
> title:Science & Operations Officer
> fn:Greg Jackson
> end:vcard
>
> --------------DB9528FC912419138886D72E--
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4127
**************************************


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