[24319] in Perl-Users-Digest
Perl-Users Digest, Issue: 6509 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 3 15:52:38 2004
Date: Mon, 3 May 2004 11:05:09 -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 Mon, 3 May 2004 Volume: 10 Number: 6509
Today's topics:
Re: Books online???? <catcher@linuxmail.org>
Re: Books online???? <bxb7668@somewhere.nocom>
Re: Books online???? <flavell@ph.gla.ac.uk>
Re: Can perl be used for cookie setting? (Randal L. Schwartz)
Re: Can perl be used for cookie setting? <sbryce@scottbryce.com>
Re: CRC on Unix vs Win32 (Frank Sconzo)
Re: CRC on Unix vs Win32 <theaney@cablespeed.com>
execute every 15 min <anonymous@disneyland.com>
Re: execute every 15 min <jurgenex@hotmail.com>
Re: execute every 15 min <jboes@nexcerpt.com>
Re: free source guestbook (finished) (Malcolm Dew-Jones)
Re: How to call another program <alien_resident@sbcglobal.net>
Re: How to call another program <David@Grey.con>
Re: How to make a Perl program do concurrent downloadin <cocke@catherders.com>
Re: is there something more elegant to convert Dos to u <perl@my-header.org>
Re: is there something more elegant to convert Dos to u <uri@stemsystems.com>
Re: is there something more elegant to convert Dos to u <bik.mido@tiscalinet.it>
Re: is there something more elegant to convert Dos to u <tadmc@augustmail.com>
Re: is there something more elegant to convert Dos to u <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 03 May 2004 06:29:25 -0400
From: Robert <catcher@linuxmail.org>
Subject: Re: Books online????
Message-Id: <poKdnYuHgoyYggvd4p2dnA@adelphia.com>
Henry Williams wrote:
>>>>They are out there and you should report them to O'Reilly.
>>>
>>>
>>>I was hoping you were going to! I already have a fulltime job.
>>>
>>
>>Meaning what?
>
>
> It's just that this NG is a very very unfriendly place. You know..
> RTFM... civility is a rare commodity here, as I've lurked I've noticed
> this. And while it may be true that there are those who post who
> should have done a little more research themselves, it profits little
> to berate them.
>
> In the larger context, I find it amusing that there are those who
> would spend their time berating rather than ignoring. The berated and
> them that would berate seem birds of a feather.
>
> I posted what I did because I wondered if the publisher of those books
> had some sort of 'academic' license or something such as that. The
> places I found the books online were typically .edu
>
> And I hoped someone could shed light on it for me if that were the
> case. Which it seems not to be.
>
> As for my reply to you, I found your post to be rather sarcastic, and
> so in keeping with the ungentlemanly posture of this NG, I sought to
> answer in kind.
>
> Hopefully this clears up the air.
>
> Henry
>
Actually it wasn't sarcastic. Even if you think that the stuff is under
some sort of academic license you should report it. Let O'Reilly deal
with whether it is kosher or not. You do any author a disservice by not
reporting something you think is copyright infringement.
Robert
------------------------------
Date: Mon, 3 May 2004 16:12:38 GMT
From: "bxb7668" <bxb7668@somewhere.nocom>
Subject: Re: Books online????
Message-Id: <Hx5Bp0.Dn1@news.boeing.com>
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnc9bog9.1rt.tadmc@magna.augustmail.com...
> Henry Williams <> wrote:
> >
> >>>>They are out there and you should report them to O'Reilly.
> >>>
> >>>
> >>> I was hoping you were going to! I already have a fulltime job.
> >>>
> >>Meaning what?
> >
> > It's just that this NG is a very very unfriendly place. You know..
> > RTFM...
>
>
> Assuming that reading the manual is unhelpful is silliness.
>
> It depends on whether the manual answers the particular question or
not.
>
> If it answers the question then it is friendly, not unfriendly.
>
> Without knowing the question and the recommended docs, nobody can
> say what the friendliness polarity is.
>
<snip>
I would like to interject on comment about RTFM. For the last two
weeks I have been learning Perl/Tk by RTFM several manuals, searching
the web for help and tutorials (I have a pile of printed web pages
over 2" thick) and asking the perl.tk newsgroup. For someone that is
good a Perl but new to Tk, the manuals are slightly better than
useless ("Programming Perl", "Mastering Perl/Tk" and "Perl in a
Nutshell"). Most of the web pages are either to simple ("Hello World")
or too complex. The Tk newsgroup has been fairly good. Most of the
responses have been helpful by answering my questions or by pointing
out where to look in the manual. There have been a few RTFM answers,
but I chalk those people up as being too stuck up in their Guru'hood
to care about we newbies.
Please everyone. Before you reply with a sarcastic or RTFM answer,
consider how you'd like other to respond to you if you were new or
stuck or didn't know where to find the answer. I have a firm rule on
questions: "There is no such thing as a stupid question. Just stupid
answers."
Have a good week.
Brian
------------------------------
Date: Mon, 3 May 2004 18:13:11 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Books online????
Message-Id: <Pine.LNX.4.53.0405031752460.9803@ppepc56.ph.gla.ac.uk>
On Mon, 3 May 2004, bxb7668 wrote:
[messy and IMHO excessive quotage now snipped]
> I would like to interject on comment about RTFM. For the last two
> weeks I have been learning Perl/Tk by RTFM several manuals, searching
> the web for help and tutorials (I have a pile of printed web pages
> over 2" thick) and asking the perl.tk newsgroup. For someone that is
> good a Perl but new to Tk, the manuals are slightly better than
> useless ("Programming Perl", "Mastering Perl/Tk" and "Perl in a
> Nutshell"). Most of the web pages are either to simple ("Hello World")
> or too complex. The Tk newsgroup has been fairly good. Most of the
> responses have been helpful by answering my questions or by pointing
> out where to look in the manual. There have been a few RTFM answers,
> but I chalk those people up as being too stuck up in their Guru'hood
> to care about we newbies.
Well, a fine list of generalities. Frankly I haven't a clue what kind
of answers you got or what kind of answers you thought you wanted,
based on that kind of vague description that you are posting.
> Please everyone. Before you reply with a sarcastic or RTFM answer,
> consider how you'd like other to respond to you if you were new or
> stuck or didn't know where to find the answer.
When I'm in that position, I'd like them to show me where to find the
relevant things out for myself. If there's an easy answer to my
problem, I'll want to know not only what that easy answer is, but why
I missed it, so that I don't go missing other easy answers that
are probably in the same place.
On Usenet, we represent ourselves by our postings, nothing more. If
it appears from the posting that the questioner hasn't found the
relevant documentation, we'll try to show him where it is. If it
looks as if he -does- know where to find the relevant documentation,
but prefers to have it read out to him by hundreds or thousands of
fellow Usenauts instead, then we're liable to react differently. If
you don't understand why that is, then maybe you need a bit of
reorientation. Some of us have been around here long enough to see
some competent and respected contributors who have abandoned usenet
because of hordes of whiners who basically wanted spoon-feeding, and
turned extremely nasty when they didn't get it. Irrespective of
whether you are one of them (and I surmise that you are not), that
unfortunately has a significant effect on the agenda.
Now, if I may make a suggestion: try to put yourself into the position
of the many Usenauts who will read your posting. Try to read it over
again on the assumption that it was written by a third party, about
whose capabilities and present expertise you have no knowledge at all,
and try to work out, on the basis of the posting and nothing more,
what they're complaining about and what answers you would give them in
order to satisfy their needs.
Will you (and the other readers here) be able to work out what it was
that was needed, and why the questioner found himself in difficulties,
and how he could have been helped out of those difficulties? My
diagnosis, for what it's worth, was that they won't, and thus we're
none of us really any further forward. Sadly.
ttfn
------------------------------
Date: Mon, 03 May 2004 13:11:22 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Can perl be used for cookie setting?
Message-Id: <5b3988baf048374037ba9f4f4f3a7169@news.teranews.com>
>>>>> "Scott" == Scott Bryce <sbryce@scottbryce.com> writes:
Scott> print "Set-Cookie:SessionID=$session_id\n";
Please. Space after the colon. That it "works" with some so-called
browsers doesn't mean it's correct.
Scott> To get cookies, read the docs for CGI.pm.
Or to set cookies, read the docs for CGI.pm, and then you wouldn't
have made your syntax mistake, because CGI.pm does it properly. :)
print "Just another Perl hacker,"; # the first
--
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: Mon, 03 May 2004 08:37:40 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Can perl be used for cookie setting?
Message-Id: <109cm99s3886p08@corp.supernews.com>
Randal L. Schwartz wrote:
>>>>>>"Scott" == Scott Bryce <sbryce@scottbryce.com> writes:
>
>
> Scott> print "Set-Cookie:SessionID=$session_id\n";
>
> Please. Space after the colon. That it "works" with some so-called
> browsers doesn't mean it's correct.
I don't know if I learn more from lurking, or from having my posts
corrected! Thanks! That line came directly from one of my CGI scripts.
It "works" for IE, NS and Opera. I'll certainly make the correction!
------------------------------
Date: 3 May 2004 05:06:40 -0700
From: frank.sconzo@dowjones.com (Frank Sconzo)
Subject: Re: CRC on Unix vs Win32
Message-Id: <5d56563e.0405030406.4e29fcd1@posting.google.com>
Joe,
Thanks for responding; you make a good point. Unfortunately, the
newline/carriage return issue is not the cause of the problem. The
sample text I tested contained only four characters: ABCD, no newlines
(not even at the end of the single line).
-Frank
Joe Smith <Joe.Smith@inwap.com> wrote in message news:<17clc.16908$0H1.1577022@attbi_s54>...
> Frank Sconzo wrote:
>
> > I'm writing a perl module that sends rich-text messages to Microsoft
> > Outlook recipients from Unix. This involves generating CRCs of the
> > plaintext and rtf versions of the mail message.
> >
> > Unfortunately, when I use perl modules to generate the CRC, the values
> > do not match those that the Outlook Client is expecting.
>
> Richtext and plain text are non-binary files.
> Non-binary files on Windows use "\015\012" at the end of each line
> Non-binary files on Unix use "\012" at the end of each line.
> When data is transfered in ASCII mode (as opposed to BINARY) mode,
> the CRC will change. You need to convert one or both to canonical
> form before performing a CRC check.
> -Joe
------------------------------
Date: Mon, 03 May 2004 08:40:37 -0400
From: Tim Heaney <theaney@cablespeed.com>
Subject: Re: CRC on Unix vs Win32
Message-Id: <878yg965ve.fsf@mrbun.watterson>
frank.sconzo@dowjones.com (Frank Sconzo) writes:
>
> I'm writing a perl module that sends rich-text messages to Microsoft
> Outlook recipients from Unix. This involves generating CRCs of the
> plaintext and rtf versions of the mail message.
>
> Unfortunately, when I use perl modules to generate the CRC, the values
> do not match those that the Outlook Client is expecting.
>
> For example, I used the crc32 function from Digest::CRC to determine
> the CRC of the string ABCD. I also sent a message from an Outlook
> client containing only ABCD as the body text.
>
> Digest::CRC::crc32 gives me the following for the CRC of ABCD:
> db 17 20 a5
>
> But the Outlook attachment contains a CRC of ABCD as:
> b9 ff 53 fa
>
> Anyone know why these wouldn't match?
I think perhaps Outlook inverted things in a different sense than
is usual.
$ perl -M'Digest::CRC qw(crc_hex)' -le 'print reverse unpack "A2"x4,
crc_hex("ABCD",32,0,0,1,0x04C11DB7,1)'
b9ff53fa
For comparison, the usual CRC32 corresponds to
$ perl -M'Digest::CRC qw(crc_hex)' -le 'print crc_hex("ABCD",32,
0xffffffff,0xffffffff,1,0x04C11DB7,1)'
db1720a5
Tim
------------------------------
Date: Mon, 03 May 2004 15:01:17 GMT
From: "luc" <anonymous@disneyland.com>
Subject: execute every 15 min
Message-Id: <19tlc.94476$3R.5981288@phobos.telenet-ops.be>
I have a perl program that downloads the value of some shares on the
Brussels stock market. The problem is that every 15 minutes the value
changes. How would I go about changing this program so that it automatically
starts up at 9.30(finishes at 16.00(market closed)) and every 15 minutes
would download the prices and put them in diffrent files, so that I would
have 32 files? With this data you could easily see the flow of the share.
------------------------------
Date: Mon, 03 May 2004 15:23:59 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: execute every 15 min
Message-Id: <jutlc.19601$sK3.12815@nwrddc03.gnilink.net>
luc wrote:
> I have a perl program that downloads the value of some shares on the
> Brussels stock market. The problem is that every 15 minutes the value
> changes. How would I go about changing this program so that it
> automatically starts up at 9.30
That's not possible. How could a program determine if it is supposed to run
without being run?
This is a job for cron.
> (finishes at 16.00(market closed))
Just have your program check what the current time is (see time() and
localtime()) and have it terminate after 16:00.
> and
> every 15 minutes would download the prices
While you could use sleep(15*60) a better approach would probably be to use
the OS tools that are made for exactly that purpose. Again, cron is your
friend.
> and put them in diffrent
> files, so that I would have 32 files?
jue
------------------------------
Date: Mon, 03 May 2004 16:06:13 GMT
From: Jeff Boes <jboes@nexcerpt.com>
Subject: Re: execute every 15 min
Message-Id: <324fbb60d3f7935147e9804982bb1cc9@news.teranews.com>
luc wrote:
> I have a perl program that downloads the value of some shares on the
> Brussels stock market. The problem is that every 15 minutes the value
> changes. How would I go about changing this program so that it automatically
> starts up at 9.30(finishes at 16.00(market closed)) and every 15 minutes
> would download the prices and put them in diffrent files, so that I would
> have 32 files? With this data you could easily see the flow of the share.
>
>
As noted elsewhere in this thread, if the program's not running, it
can't determine if it should be running. You need cron for that, or else
the program has to *be* running, all the time, and just "wake up"
periodically to do its thing.
[Code examples which follow are schematic, not intended to run without
significant modification to suit your local purpose.]
The simple approach:
#!/usr/bin/perl -w
use strict;
while (1) {
# Do your check here.
sleep (15 * 60);
}
This has the advantage of being extremely portable. However, it has the
disadvantage of only ensuring that the *start* of one check will follow
the *end* of the previous check by *at least* 15 minutes. If a download
takes two minutes, then the start of each download will fall 17 minutes
after the last one.
A more complex approach involves setting an "alarm clock" signal to wake
your process:
#!/usr/bin/perl -w
use strict;
use POSIX;
$SIG{ALRM} = \&set_alarm_and_snooze;
set_alarm_and_snooze;
sub set_alarm_and_snooze {
alarm(15 * 60);
# Do your download here.
POSIX::pause;
}
This approach ensures that the starts of two downloads will be separated
by 15 minutes, but it also has a couple of problems:
1. If a download takes longer than 15 minutes, the next download may
interrupt it.
2. If this script runs for a very long time (e.g., many days), you may
run out of memory, because it's recursive!
These examples are presented to show that a self-contained approach may
not be your best bet. Were this my task, I'd stick with cron -- but a
Windows or other OS may not provide such features (although I've had
success using the Windows task scheduler in XP, and I'm pretty sure that
other contemporary Windows versions have similar things).
Failing that, you will almost certainly end up at CPAN. Some promising
items there include Proc::Daemon, Coro::Timer, Prima::Timer, etc. I've
not used these -- I used the Event package instead, which provides a lot
more functionality but may be complete overkill for you.
--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
------------------------------
Date: 3 May 2004 08:23:02 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: free source guestbook (finished)
Message-Id: <409663d6@news.victoria.tc.ca>
Robin (robin@infusedlight.net) wrote:
: Unix systems have a race condition with this libary call? Or did I
: misunderstand you?
Any system may have race conditions with virtually any call if they are
used incorrectly.
If there could be a race condition in a particular situation then the
program should use some method to form a lock.
As for access, everyone who uses it knows that since they read the man
page before they made the call (right?).
access is useful for suid programs to test the original user's permissions
to access something. Simply open'ing a file will not do that since the
the suid program will likely not have a permission problem when it opens
the file. (And if that causes a race condition in the program then the
program should use some other method to form a lock.)
access is also useful for checking a user's permissions before starting
something like a batch job. E.g. if a user cannot write to a temporary
directory that will be needed in ten hours then it is stupid to find that
out ten hours from now. Sure, the directory permission may change during
the ten hours before the job runs, but checking first is still the smart
thing to do.
------------------------------
Date: Mon, 03 May 2004 13:51:19 GMT
From: Alien Resident <alien_resident@sbcglobal.net>
Subject: Re: How to call another program
Message-Id: <r7slc.44153$Em3.25109@newssvr29.news.prodigy.com>
David Grey wrote:
>I have not a clue what you are saying in the first place,
>I'm suppose to pay some $150. to get a one line code, I don't
>think so.
It's interesting to see the effect interacting with fellow humans by means of the web has
on ones boldness. This "David Grey" character is an interesting study. Let's say that he
had started building a house for someone and he had no prior building experience, and now
he finds himself behind schedule and the housing code inspector is due to come the next
day. Would this "David Grey" go down to a construction site near by and during lunch start
telling these guys that they HAVE TO HELP HIM BECAUSE HE KNOWS THEY KNOW HOW TO FIX HIS
PROBLEM!!! If they didn't just kick his butt and send him home crying after the first time
he opened his mouth, they'd definitely do it after they did try to help him and he cried,
moaned and insulted them because he couldn't understand how they got the total square feet.
But really, for fear of a fat lip this "David Grey" probably wouldn't take that route.
Although he will do it online, for he has no fear of physical retaliation for it extremely
low level of social and ethical standards and or skills.
Ah, such is the world these days.
-AR
------------------------------
Date: Mon, 03 May 2004 14:57:01 GMT
From: David Grey <David@Grey.con>
Subject: Re: How to call another program
Message-Id: <4096572D.C7152398@Grey.con>
Joe Smith wrote:
> David Grey wrote:
>
> > That is not what I want to do (from what I can tell) I want to :
> >
> > print "Location: http://www.domain.com/cgi-bin/copyprog.pl\n\n";
> >
> > run this script before running the rest of the script. When I run the
> > above it goes off and does not run the rest of the script that this
> > is in.
>
> Unless you are using frames or <img src>, the browser processes one URL
> at a time. If the original request is to cgi-bin/part-1.pl, you've
> got two choices:
> 1) Let part-1.pl go to completion, and output the Location at the end.
> 2) Output the Location at beginning of part-1.pl, but then you've got
> the problem that part-1.pl will be prematurely terminated when
> the browser closes the connect as it switches to copyprog.pl.
>
> You could have part-1.pl output HTML that runs two CGIs in parallel.
>
> <frameset rows="100%,*">
> <frame src="/cgi-bin/part-2.pl">
> <frame src="http://www.domain.com/cgi-bin/copyprog.pl">
> </frameset>
> <noframes>
> <body><img src="/cgi-bin/part-2.pl" width=1 height=1">
> <img src="http://www.domain.com/cgi-bin/copyprog.pl" width=1 height=1>
> </body>
> </noframes>
>
> -Joe
Dude, that worked ! Thanks
After like 15 hours of trying to do it as the rest said, this works.
I don't use frames so I never even thought of that, I was think of
<META HTTP-equiv="Refresh" content="1;
URL=http://www.domain.com/cgi-bin/copyprog.pl">
But of course I could not figure out how to make it do two bounces.
Thanks again !
------------------------------
Date: Mon, 03 May 2004 09:15:20 -0400
From: Michael W. Cocke <cocke@catherders.com>
Subject: Re: How to make a Perl program do concurrent downloading?
Message-Id: <lchc90d36pk58re4to0o3m96n09ad40949@4ax.com>
On 2 May 2004 09:10:27 -0700, rook_5150@yahoo.com (Bryan Castillo)
wrote:
>"Adlene" <Adlene3352@hotmail.com> wrote in message news:<c6vvmn$ck4$1@mawar.singnet.com.sg>...
>> Hi, there:
>>
>> I wrote a program to download 500,000 HTML files from a website, I
>> have compiled all the links in a file. my grabber.pl will download all of
>> them...
>
>Depending on who owns the Internet site, they may find it rude that
>you want to dowload so many files and that you may want to take as
>much resources as possible from their web server. Perhaps you should
>find a different way of retrieving the data, such as contacting the
>web site administrator and tell them what you want to do, they may
>give you a tar gzipped file of the site??
>
>
I'd definitely recommend contacting the site administrator. If
someone tried to hoover my whole site they'd find themselves blocked
at the firewall. Incredibly impolite.
Mike-
--
If you're not confused, you're not trying hard enough.
--
Please note - Due to the intense volume of spam, we have installed site-wide spam filters at catherders.com. If
email from you bounces, try non-HTML, non-encoded, non-attachments,
------------------------------
Date: Mon, 03 May 2004 19:08:45 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <54vc9051ji0dvh9cil6qtkmogpucmum56g@4ax.com>
X-Ftn-To: Uri Guttman
Uri Guttman <uri@stemsystems.com> wrote:
> A> close out;
> A> unlink $temp_file;
> A> return 0;
> A> }
>
>perl -I.bak -pe 'tr/\r\n/\n/s'
tr/\r//d should be more straightforward?
--
Matija
------------------------------
Date: Mon, 03 May 2004 17:42:27 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <x7isfdv24d.fsf@mail.sysarch.com>
>>>>> "MP" == Matija Papec <perl@my-header.org> writes:
MP> Uri Guttman <uri@stemsystems.com> wrote:
>>
>> perl -I.bak -pe 'tr/\r\n/\n/s'
MP> tr/\r//d should be more straightforward?
it could be. better golf score for sure.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 03 May 2004 14:02:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <2ecc90pjhom1m5qvtg6ouqeiu1sbhrmri9@4ax.com>
On 2 May 2004 14:35:44 -0700, myfam@surfeu.fi (Andrew) wrote:
>sub toUnixFile() {
[snip]
FWIW I customarily use
perl -lpi.bak -e '' <files>
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Mon, 3 May 2004 07:53:16 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <slrnc9cg5s.2km.tadmc@magna.augustmail.com>
Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On 2 May 2004 14:35:44 -0700, myfam@surfeu.fi (Andrew) wrote:
>
>>sub toUnixFile() {
> [snip]
>
> FWIW I customarily use
>
> perl -lpi.bak -e '' <files>
Or, if you are playing golf:
perl -lpi.bak -e1 <files>
Or, if you are confident and playing to win:
perl -lpi -e1 <files>
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 03 May 2004 15:59:23 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <btjc90t6n2duv9e6gt7asr3i4g0gc8bpbo@4ax.com>
On Mon, 3 May 2004 07:53:16 -0500, Tad McClellan
<tadmc@augustmail.com> wrote:
>> perl -lpi.bak -e '' <files>
>
>Or, if you are playing golf:
>
> perl -lpi.bak -e1 <files>
Not at all, just lazy, and even if now I *do* remember which
convention is which, I always prefer to have "someone" else do that
for me. Someone who I am confindent that will remember correctly too,
BTW!
And under Win* it's:
perl -lpi.bak -e "" <files>
Incidentally, nice to notice that your golf-like solution wouldn't
require different conventions on the cmd line too!
>Or, if you are confident and playing to win:
>
> perl -lpi -e1 <files>
D'Oh! Under Win* it seems that I cannot be confident! ;-)
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
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 6509
***************************************