[24292] in Perl-Users-Digest
Perl-Users Digest, Issue: 6483 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 28 14:06:59 2004
Date: Wed, 28 Apr 2004 11:05:10 -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 Wed, 28 Apr 2004 Volume: 10 Number: 6483
Today's topics:
Re: A1 Triple Gold Star for Robin <notreal@example.com>
Re: Encrypting files (SlimClity)
Re: How to save lwp::useragent state? <glex_nospam@qwest.invalid>
Re: ides <notreal@example.com>
Newbie help on a script or command <me@privacy.net>
Re: Newbie help on a script or command <ittyspam@yahoo.com>
Re: other perl groups <pfancy@bscn.com>
Re: other perl groups <ittyspam@yahoo.com>
Re: Perl IDE <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: Perl IDE <richard@zync.co.uk>
Re: Perl IDE <postmaster@castleamber.com>
Re: Perl IDE <notreal@example.com>
Re: Perl IDE <notreal@example.com>
Re: Perl newbie q: trying to access array using variabl <emschwar@pobox.com>
Re: Please Recommend A Good Perl Book. (Randal L. Schwartz)
Re: Please Recommend A Good Perl Book. <bart.lateur@pandora.be>
Re: Regex Matching Strings WITHOUT Chars <hal@thresholddigital.com>
Re: Regex Matching Strings WITHOUT Chars <remorse@partners.org>
Regular expression for decimal value <jocsch@phreaker.net>
Re: Regular expression for decimal value <tadmc@augustmail.com>
Re: Regular expression for decimal value <rwxr-xr-x@gmx.de>
Re: Remote uploading with hops? <glex_nospam@qwest.invalid>
Re: Remote uploading with hops? <calvine@starhub.net.sg>
Re: s/$str1/$str2/ WITHOUT treating $str1/$str2 as rege <david@tvis.co.uk>
What does this command actually do? <ricke@NOSPAMsasktel.net>
Re: What does this command actually do? <ittyspam@yahoo.com>
Re: What does this command actually do? <mark.clements@kcl.ac.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Apr 2004 15:32:37 GMT
From: Bernard R <notreal@example.com>
Subject: Re: A1 Triple Gold Star for Robin
Message-Id: <Xns94D9A8A2C96D3notrealexamplecome00@194.168.222.120>
"Julia deSilva" <jds@nospantrumpetweb.co.uk> wrote in
news:pdrjc.930$n6.423@pathologist.blueyonder.net:
> Many Congratulations to Robin.
>
> How does this guy (or gal) do it, I mean, how is it possible to take
> such stick, stay cool and come back for more. Many others have got
> themselves into similar situations in this NG and have ended up taking
> offence, being rude, and then getting plonked, or worse.
>
> What a guy ! <sigh>
>
>
I was surprised to see robin still posting.
I don't know why they persist, a troll or just stupid?
I've noticed a pattern with people like Robin, they always think CGI .pm is
too hard and try and make their own. They are always defensive too.
------------------------------
Date: 28 Apr 2004 10:17:09 -0700
From: slimclity@hotmail.com (SlimClity)
Subject: Re: Encrypting files
Message-Id: <3c209c5f.0404280917.75121d4b@posting.google.com>
slimclity@hotmail.com (SlimClity) wrote in message news:<3c209c5f.0404210025.44b22291@posting.google.com>...
> The script is part of a larger automated process. To make sure that
> the encrypting and decrypting goes well we want to create an MD5
> checksum before and after the encryption. This works if the original
> file is in parts of 16. But when the file don't exists in parts of 16
> then "0" are add to make the encryption work.
>
> Now the MD5 chekcum is different...
>
Thanks for the help zentera/Joe Smith!!!
------------------------------
Date: Wed, 28 Apr 2004 08:30:32 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: How to save lwp::useragent state?
Message-Id: <ZlOjc.31$2y2.6760@news.uswest.net>
John wrote:
> The above code works, but after doing a network trace it seems that
> the user agent is logging in (HTTP authorization) each time it tries
> to access the page (even if the page has been accessed before during
> the same program session). A regular web browser does not behave like
> this though -- once you log in, it does not try to keep logging in
> during the same browser session. My question: is there any way to make
> this behave a like a regular browser? Thanks.
This has nothing to do with perl, read up on HTTP authentication. A web
server is "stateless", meaning authentication has to happen on each
request. The browser does it for you, automagically. I'd think your
"network trace", using a browser, would have shown that.
------------------------------
Date: Wed, 28 Apr 2004 15:49:43 GMT
From: Bernard R <notreal@example.com>
Subject: Re: ides
Message-Id: <Xns94D9AB498C89Cnotrealexamplecome00@194.168.222.124>
"Robin" <robin @ infusedlight.net> wrote in
news:c6elkj$ofe$2@reader2.nmix.net:
> I'm thinking about perl ides in VB or Visual CPP and I'm wondering if
> someone has some good links on how it's done or some information on
> how one could access the perl binary to produce output in a window on
> windows? Thanks.
use Tk;
------------------------------
Date: Wed, 28 Apr 2004 10:39:28 -0400
From: Mark <me@privacy.net>
Subject: Newbie help on a script or command
Message-Id: <k9gv805qd1ja568pdoct7toonq6dhnl29s@4ax.com>
Windows NT4 with latest perl from activestate.com
I just need a script (or command for command prompt) that will check for the
existence of any files in a specific directory. If any files are there, send
an email to someone.
This is very simple for me to do in other languages, but Perl is about 10
minutes old to me at this point. I've done a few web searches for scripts
without luck (most seem to be cgi stuff).
Any help is appreciated.
------------------------------
Date: Wed, 28 Apr 2004 10:49:47 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Newbie help on a script or command
Message-Id: <20040428104538.X25280@dishwasher.cs.rpi.edu>
On Wed, 28 Apr 2004, Mark wrote:
> Windows NT4 with latest perl from activestate.com
>
> I just need a script (or command for command prompt) that will check for the
> existence of any files in a specific directory. If any files are there, send
> an email to someone.
>
> This is very simple for me to do in other languages, but Perl is about 10
> minutes old to me at this point. I've done a few web searches for scripts
> without luck (most seem to be cgi stuff).
>
> Any help is appreciated.
perldoc -f opendir
perldoc -f readdir
perldoc -q "send mail"
Paul Lalli
------------------------------
Date: Tue, 27 Apr 2004 19:41:37 -0500
From: "pfancy" <pfancy@bscn.com>
Subject: Re: other perl groups
Message-Id: <408fd033@news.greennet.net>
0
"Abigail" <abigail@abigail.nl> wrote in message
news:slrnc8r55f.egl.abigail@alexandra.abigail.nl...
> pfancy (pfancy@bscn.com) wrote on MMMDCCCXCI September MCMXCIII in
> <URL:news:408d8007@news.greennet.net>:
> ^^
> ^^ Believe it or not. The first thing I did was read books look for
beginning
> ^^ perl online and I did not find what is recommended to be download and
what
> ^^ to use to run perl.
>
> Ok, I want to know. Which books did you read? Please state title,
> author and publisher.
>
>
> Abigail
Programming Perl O' Reilly
Does that help out some?
------------------------------
Date: Wed, 28 Apr 2004 10:33:27 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: other perl groups
Message-Id: <20040428102945.L25280@dishwasher.cs.rpi.edu>
On Tue, 27 Apr 2004, pfancy wrote:
> 0
> "Abigail" <abigail@abigail.nl> wrote in message
> news:slrnc8r55f.egl.abigail@alexandra.abigail.nl...
> > pfancy (pfancy@bscn.com) wrote on MMMDCCCXCI September MCMXCIII in
> > <URL:news:408d8007@news.greennet.net>:
> > ^^
> > ^^ Believe it or not. The first thing I did was read books look for
> beginning
> > ^^ perl online and I did not find what is recommended to be download and
> what
> > ^^ to use to run perl.
> >
> > Ok, I want to know. Which books did you read? Please state title,
> > author and publisher.
> >
> >
> > Abigail
>
> Programming Perl O' Reilly
> Does that help out some?
Really? Did you miss these parts?
From section 1.3.1:
For longer scripts, you can use your favorite text editor (or any other
text editor) to put all your commands into a file and then, presuming
you named the script gradation (not to be confused with graduation),
you'd say:
perl gradation
From the preface:
Most operating system vendors these days include Perl as a standard
component of their systems. As of this writing, AIX, BeOS, BSDI, Debian,
DG/UX, DYNIX/ptx, FreeBSD, IRIX, LynxOS, Mac OS X, OpenBSD, RedHat,
SINIX, Slackware, Solaris, SuSE, and Tru64 all came with Perl as part of
their standard distributions. Some companies provide Perl on separate
CDs of contributed freeware or through their customer service groups.
Third-party companies like ActiveState offer prebuilt Perl distributions
for a variety of different operating systems, including those from
Microsoft.
Which part of these sections did you not understand when trying to figure
out "what is recommended to be download and what to use to run perl." ?
Paul Lalli
------------------------------
Date: Wed, 28 Apr 2004 15:22:37 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Perl IDE
Message-Id: <Xns94D99C7305447elhber1lidotechnet@62.89.127.66>
"George Kinley" <georgekinley@hotmail.com> wrote:
> Hi,
> Our Company is planning to buy some IDE for Perl, for Windows 2K
> As I Searched through Internet, I found quite many of them like
> Komodo , Optiperl, PerlIde(free), etc
> Can you suggest which one to buy
The free one.
--
Cheers,
Bernard
------------------------------
Date: Wed, 28 Apr 2004 15:48:39 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: Perl IDE
Message-Id: <c6og80$cud$1@news.freedom2surf.net>
In article <pWNjc.15189$g4.294574@news2.nokia.com>, "George Kinley"
<georgekinley@hotmail.com> wrote:
> Hi,
> Our Company is planning to buy some IDE for Perl, for Windows 2K As I
> Searched through Internet, I found quite many of them like Komodo ,
> Optiperl, PerlIde(free), etc
> Can you suggest which one to buy
>
There's a top notch IDE for Perl and it's totally free ... it's called
GNU/Linux. Not sure if it runs on Win2K though ...
------------------------------
Date: Wed, 28 Apr 2004 10:35:18 -0500
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Perl IDE
Message-Id: <408fcf37$0$196$58c7af7e@news.kabelfoon.nl>
Richard Gration wrote:
> In article <pWNjc.15189$g4.294574@news2.nokia.com>, "George Kinley"
> <georgekinley@hotmail.com> wrote:
>
>
>>Hi,
>>Our Company is planning to buy some IDE for Perl, for Windows 2K As I
>>Searched through Internet, I found quite many of them like Komodo ,
>>Optiperl, PerlIde(free), etc
>>Can you suggest which one to buy
>
> There's a top notch IDE for Perl and it's totally free ... it's called
> GNU/Linux. Not sure if it runs on Win2K though ...
Sure it does, it's called Cygwin :-D. Some rumours have it that
ActiveState Perl for Win32 with TextPad (not free) and some Win32 GNU
tools also come close ;-)
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
------------------------------
Date: Wed, 28 Apr 2004 15:37:41 GMT
From: Bernard R <notreal@example.com>
Subject: Re: Perl IDE
Message-Id: <Xns94D9A97FB6D43notrealexamplecome00@194.168.222.120>
"George Kinley" <georgekinley@hotmail.com> wrote in news:pWNjc.15189
$g4.294574@news2.nokia.com:
> Hi,
> Our Company is planning to buy some IDE for Perl, for Windows 2K
> As I Searched through Internet, I found quite many of them like Komodo ,
> Optiperl, PerlIde(free), etc
> Can you suggest which one to buy
>
>
Why don't you try the trial versions. Both Komodo and Optiperl have time
limited trials.
------------------------------
Date: Wed, 28 Apr 2004 15:43:52 GMT
From: Bernard R <notreal@example.com>
Subject: Re: Perl IDE
Message-Id: <Xns94D9AA8D288AAnotrealexamplecome00@194.168.222.120>
"Richard Gration" <richard@zync.co.uk> wrote in news:c6og80$cud$1
@news.freedom2surf.net:
> In article <pWNjc.15189$g4.294574@news2.nokia.com>, "George Kinley"
> <georgekinley@hotmail.com> wrote:
>
>
>> Hi,
>> Our Company is planning to buy some IDE for Perl, for Windows 2K As I
>> Searched through Internet, I found quite many of them like Komodo ,
>> Optiperl, PerlIde(free), etc
>> Can you suggest which one to buy
>>
>
> There's a top notch IDE for Perl and it's totally free ... it's called
> GNU/Linux. Not sure if it runs on Win2K though ...
I use Emacs on linux and Xemacs on win32 for coding perl. Both take a while
to learn but are well worth the time invested (like perl ^_^ )
I tried optiperl and its quite good but happy enough with *macs.
------------------------------
Date: Wed, 28 Apr 2004 10:52:06 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Perl newbie q: trying to access array using variable name
Message-Id: <etowu40xcy1.fsf@fc.hp.com>
Tad McClellan <tadmc@augustmail.com> writes:
> m <mpepple@hotmail.com> wrote:
>> ever wish you could retract a post (you can't, can you?)?
>
>
> Yes, you can.
>
> http://groups.google.com/groups?q=FAQ+cancel
Which unfortunately doesn't help once it gets past google's servers
onto the vast majority of newsservers out there that DON'T honor
cancel requests. I'm not saying you're wrong, Tad, but I didn't want
the OP to think that canceling a post is likely to be effective
outside a very small subset of USENET.
-=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, 28 Apr 2004 14:27:24 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: daniel_n_andersen@yahoo.com (Daniel N. Andersen)
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <bbe1c7290fe1e6c8f8987ace1da9093b@news.teranews.com>
>>>>> "Daniel" == Daniel N Andersen <daniel_n_andersen@yahoo.com> writes:
Daniel> If I were you, I would check out http://XXXXXXXXXXXXX/ . This is
Daniel> O'Reilly's Perl CD Bookshelf v1.0 from 1999, which contain the
Daniel> following 6 books in HTML format:
Daniel> Perl in a Nutshell
Daniel> Learning Perl
Daniel> Learning Perl on Win32 Systems
Daniel> Programming Perl
Daniel> Advanced Perl Programming
Daniel> Perl Cookbook
Thank you. This site has been reported to the authorities
(infringement@ora.com) for pirating my works and the works of my other
co-author friends.
Thank you for taking money out of my pocket. Feel better now?
Next time I throw a party and give away T-shirts and free drinks,
*you* are not invited. Please stay away.
THINK PEOPLE. THINK. THESE CDs CANNOT BE ON THE WEB. THIS IS A
COPYRIGHT VIOLATION.
{sigh}
print "Just another Perl [book] hacker,";
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 28 Apr 2004 15:24:47 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Please Recommend A Good Perl Book.
Message-Id: <o4jv80d8leloij3bsvo98ae80a730i2gbe@4ax.com>
Jim Cochrane wrote:
>OTO, I've found Effective Perl to be generally quite good, but it's not a
>reference
If all you want is a reference, use the included documentation. Or go to
<http://perldoc.com>.
--
Bart.
------------------------------
Date: Wed, 28 Apr 2004 13:20:04 GMT
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Regex Matching Strings WITHOUT Chars
Message-Id: <8cOjc.4968$lz5.765285@attbi_s53>
Gunnar Hjalmarsson wrote:
> Hal Vaughan wrote:
>> Gunnar Hjalmarsson wrote:
>>> I don't understand why everyone (except me) suggest solutions
>>> with extended regex patterns. It may be the most accurate answer
>>> to OP's literal question, but don't you forget the context? You
>>> don't need any extended pattern to exclude filenames matching a
>>> pattern when archiving files, do you? And isn't !/string/ an
>>> easier solution that would be preferable in this case?
>>
>> Actually, your solution is much simpler (as to which is faster, I
>> would not know). But, as an additional point, I am self taught,
>> and learning about look-behinds will be helpful, not just for this
>> context, but in other contexts.
>>
>> In this particular case, using !/string/ was simpler and what I
>> used in for this particular problem. However, there are some other
>> problems I'm working on with regexes, and for those, the
>> look-behind will be a HUGE help for me.
>
> Okay, Hal, it's good that you (and others) will benefit from their
> mentioning of extended patterns. It's just that people who answer here
> typically take great pains in finding the most suitable method for
> addressing OP's question, and I began to wonder if I had missed
> something. But since nobody has claimed that extended patterns are
> necessary, I suppose not.
That's a very good point. In this case, I'm quite lucky, because both
responses helped me. But you make a valid point. Perl programmers seem to
be a special breed, and they're definitely hackers. To that mindset, the
more unique and obscure a piece of code is, the more interesting it is,
and, therefore, the better it is.
But I can't complain -- like I said, both answers were a HUGE help to me.
Hal
>> The holes in one's experience if you're self-taught can be very
>> frustrating, at times.
>
> Yeah, indeed they can. ;-)
>
------------------------------
Date: Wed, 28 Apr 2004 09:35:47 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: Regex Matching Strings WITHOUT Chars
Message-Id: <remorse-532B81.09354728042004@plato.harvard.edu>
In article <gHDjc.31668$0u6.5673561@attbi_s03>,
Hal Vaughan <hal@thresholddigital.com> wrote:
> Thanks. I also got a private reply suggesting the same topic. I had not
> tried perlre -- tried perldoc -q regex, and variations on
> perldoc regex, re, or "regular expression", but perlre has stuff the others
> don't. I had not even realized there would be more info specifically for
> perlre instead of regex or re -- just never thougth to add "perl" to it!
If you type 'perldoc perl', you will get a list of all the various
included docs, where you can find perlrequick, perlretut, perlfaq6, and
perlre, among many others...
HTH,
Ricky
--
Pukku
------------------------------
Date: Wed, 28 Apr 2004 18:31:51 +0200
From: Markus Joschko <jocsch@phreaker.net>
Subject: Regular expression for decimal value
Message-Id: <c6om13$e5jib$1@ID-47851.news.uni-berlin.de>
Hi all,
I'm not really a pro concerning regular expressions and in the moment I
desperatly try to get a decimal check working.
There is a kind of a textinputfield which should contain a decimal number.
The only restriction is the length of the overall number (excluding
period):
E.g. length=5
888888 invalid
88888 is valid
88.888 is valid
888.88 is valid
8.8888 is valid
8888.8 is valid
And that is the problem for me.
(\\d*(\\.\\d*){0,1}) -> no length check
(\\d*(\\.\\d*){0,1}){0,5}? -> checks how often the group occurs.
But how can I restrict the overall count of digits ( it does not really
matter if the period is excluded but would be fine)?
Greetings,
Markus
------------------------------
Date: Wed, 28 Apr 2004 11:55:08 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regular expression for decimal value
Message-Id: <slrnc8vofc.160.tadmc@magna.augustmail.com>
Markus Joschko <jocsch@phreaker.net> wrote:
> I'm not really a pro concerning regular expressions
That's fine, since you don't need to write any regexes yourself
to solve your problem.
> There is a kind of a textinputfield which should contain a decimal number.
perldoc -q number
How do I determine whether a scalar is a number/whole/integer/float?
> The only restriction is the length of the overall number (excluding
> period):
>
> E.g. length=5
/something from FAQ answer/ and tr/0-9// <= 5; # untested
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 28 Apr 2004 17:12:35 GMT
From: Lukas Mai <rwxr-xr-x@gmx.de>
Subject: Re: Regular expression for decimal value
Message-Id: <c6oom3$121$1@wsc10.lrz-muenchen.de>
Markus Joschko schrob:
> Hi all,
> I'm not really a pro concerning regular expressions and in the moment I
> desperatly try to get a decimal check working.
> There is a kind of a textinputfield which should contain a decimal number.
> The only restriction is the length of the overall number (excluding
> period):
> E.g. length=5
> 888888 invalid
> 88888 is valid
> 88.888 is valid
> 888.88 is valid
> 8.8888 is valid
> 8888.8 is valid
/^ \d (?: \.\d{3} | \d\.\d{2} | \d{2}\.\d | \d{3}\.? ) \d \z /x
But does it have to be a single regex?
/^(\d+)(?:\.(\d+))?\z/ and length($1) + (defined $2 ? length($2) : 0) <= 5
Hmm, that's not really better.
/^\d+(?:(\.)\d+)?\z/ and length($_) - !!$1 <= 5
That's quite readable IMHO, even though the !! part is a bit obfuscated.
HTH, Lukas
--
/*>++++++++++++[<+++++++>-]<.>+++++[<++++>-]<.---.+++++++++++++.-------------.[
-]>++++++++[<++++>-]*/#include<stdio.h>/*+++++++++[<++++++++>-]<+.++++++++++.*/
/*[-]>++++++++[<++++>-]<*/int main(void){return puts("There is no .")*0;}/*>+++
++++++++++[<++++++>-]<.+.[-]>++++++++[<++++>-]<.++++++++++++++.[-]++++++++++.*/
------------------------------
Date: Wed, 28 Apr 2004 08:36:58 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: Remote uploading with hops?
Message-Id: <_rOjc.8$FZ3.3241@news.uswest.net>
Calvine Chew wrote:
> I've been trying to write a script that will allow me to simultaneously
> update several websites in a company LAN environment, across multiple
> divisions, just by updating an initial one.
>
> Basically:
>
> 1) I upload an update (say a new dataset in a zip file) to website A.
> 2) Script in website A saves it to disk, unpacks it nicely, then sends the
> zip off to website B before deleting it from the disk,
> 3) Website B does the same and sends it off to website C.
> 4) This process is repeated until it reaches an end node.
Ummm.. why not update all servers from one main server? Or use
something like rsync, which is made for this kind of thing?
------------------------------
Date: Wed, 28 Apr 2004 22:37:51 +0800
From: "Calvine Chew" <calvine@starhub.net.sg>
Subject: Re: Remote uploading with hops?
Message-Id: <408fc1da$1@news.starhub.net.sg>
Mmm, I can't employ a primary node to secondaries model coz my main server
can't reach all my other servers... not directly at least... hence the need
to hop...
Also, at each hop I pick up logs to attach to the file transfers so by the
end of the long chain of hops my final node picked up all log files.
I tried searching cpan but I couldn't find a pureperl ua, which is probably
what I need (to perform the auto-post).
"J. Gleixner" <glex_nospam@qwest.invalid> wrote in message
news:_rOjc.8$FZ3.3241@news.uswest.net...
> Calvine Chew wrote:
> > I've been trying to write a script that will allow me to simultaneously
> > update several websites in a company LAN environment, across multiple
> > divisions, just by updating an initial one.
> >
> > Basically:
> >
> > 1) I upload an update (say a new dataset in a zip file) to website A.
> > 2) Script in website A saves it to disk, unpacks it nicely, then sends
the
> > zip off to website B before deleting it from the disk,
> > 3) Website B does the same and sends it off to website C.
> > 4) This process is repeated until it reaches an end node.
>
> Ummm.. why not update all servers from one main server? Or use
> something like rsync, which is made for this kind of thing?
------------------------------
Date: Wed, 28 Apr 2004 14:55:50 +0100
From: zzapper <david@tvis.co.uk>
Subject: Re: s/$str1/$str2/ WITHOUT treating $str1/$str2 as regexps????
Message-Id: <oudv80la9ocmi45bee7or2t3mqc5n6dq1r@4ax.com>
\Q is really cute
#!/usr/local/bin/perl
$s=qq|/fred(/|;
$r=qq|/(joe)/|;
$_=qq|/sid/fred(/dick/\n|;
print;
s/\Q$s/$r/i;
print;
zzapper (vim, cygwin, wiki & zsh)
--
vim -c ":%s.^.CyrnfrTfcbafbeROenzSZbbyranne.|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
------------------------------
Date: Wed, 28 Apr 2004 08:41:16 -0600
From: "Rick Edwards" <ricke@NOSPAMsasktel.net>
Subject: What does this command actually do?
Message-Id: <108vgkctl966492@corp.supernews.com>
Trying to figure this out before I execute it on my production servers, but
need some help, please...
perl -i~ -nle 'print unless /<(built-in|command line)>/' makefile
x2p/makefile
What is the "-i~" and the -nle ? And what is getting printed?
TIA
Rick
------------------------------
Date: Wed, 28 Apr 2004 10:54:29 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: What does this command actually do?
Message-Id: <20040428105134.R25280@dishwasher.cs.rpi.edu>
On Wed, 28 Apr 2004, Rick Edwards wrote:
> Trying to figure this out before I execute it on my production servers, but
> need some help, please...
>
> perl -i~ -nle 'print unless /<(built-in|command line)>/' makefile
> x2p/makefile
>
> What is the "-i~" and the -nle ? And what is getting printed?
perldoc perlrun
-i enables inplace editing, so that the print outputs back to the same
file that was opened
-n opens all files listed on the command line and reads one line at a
time, effectively surrounding the given program with a while loop
-l chomps the input and appends the chomped character back onto the
printed output
-e says "execute the following code"
So this porgram is opening makefile and xp2/makefile, saving backups of
each into makefile~ and xp2/makefile~ (respectively), and printing back to
those files only those lines which do not match the given pattern match.
Hope this helps,
Paul Lalli
------------------------------
Date: Wed, 28 Apr 2004 15:54:24 +0100
From: Mark Clements <mark.clements@kcl.ac.uk>
Subject: Re: What does this command actually do?
Message-Id: <408fc59e$1@news.kcl.ac.uk>
Rick Edwards wrote:
> Trying to figure this out before I execute it on my production servers, but
> need some help, please...
>
> perl -i~ -nle 'print unless /<(built-in|command line)>/' makefile
> x2p/makefile
man perlrun
------------------------------
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 6483
***************************************