[21755] in Perl-Users-Digest
Perl-Users Digest, Issue: 3959 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 12 11:05:39 2002
Date: Sat, 12 Oct 2002 08:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 12 Oct 2002 Volume: 10 Number: 3959
Today's topics:
[ANNOUNCE] Apache::SessionManager 0.03 <enrico@sorcinelli.it>
Re: Any way around using the $& variable? (Peter J. Acklam)
Re: Any way around using the $& variable? (Peter J. Acklam)
Re: Any way around using the $& variable? <usenet@tinita.de>
Re: Any way around using the $& variable? (Peter J. Acklam)
Re: Any way around using the $& variable? <nobull@mail.com>
Re: Any way around using the $& variable? <pinyaj@rpi.edu>
Re: effect of "use <version>" on forward-compatibility? <flavell@mail.cern.ch>
How about UNIVERSAL::hashkey() ? <heather710101@yahoo.com>
Re: How about UNIVERSAL::hashkey() ? <rgarciasuarez@free.fr>
Re: How about UNIVERSAL::hashkey() ? <nobull@mail.com>
Re: How about UNIVERSAL::hashkey() ? <pinyaj@rpi.edu>
Re: How to get perldb's x programmatically? (Peter Scott)
Re: Is there a way <bart.lateur@pandora.be>
Re: Problems with MSIE in combination with MAC not show <jan@nospam.harf.nl>
Re: question from beginner >_< <goldbb2@earthlink.net>
Re: question from beginner >_< <pkent77tea@yahoo.com.tea>
Re: searching an array. <bart.lateur@pandora.be>
Re: Should -i eat my files? <johannes.fuernkranz@t-online.de>
Re: Should -i eat my files? <johannes.fuernkranz@t-online.de>
simple question regarding regex's and unicode (Felicity Smith)
Re: translate c++ to perl <goldbb2@earthlink.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 12 Oct 2002 08:22:16 GMT
From: Enrico Sorcinelli <enrico@sorcinelli.it>
Subject: [ANNOUNCE] Apache::SessionManager 0.03
Message-Id: <3DA7DD3C.2CDFAB79@sorcinelli.it>
Hi all,
a new version 0.03 of Apache::SessionManager is now available via CPAN
Download site for Apache::SessionManager
http://www.cpan.org/authors/id/E/EN/ENRYS/Apache-SessionManager-0.03.tar.gz
Changes from previous version
-----------------------------
+ Added 'SessionManagerCookieArgs' PerlSetVar directive in order to
set cookie optional attributes (like 'path', 'domain', ...).
+ Added experimental support 'SessionManagerEnableModBackhand'
PerlSetVar directive in order to support mod_backhand sticky
user session load balancing. Someone asked me this feature,
so I've added it, :-)
! Updated Makefile.PL httpd.conf extra lines
! Updated docs (added pod for new directives)
Description
-----------
This package contains an Apache mod_perl module to manage HTTP sessions.
Apache::SessionManager is a mod_perl module that helps
session management of a web application. This module is a
wrapper around Apache::Session persistence framework for session data.
It creates a session object and makes it available to all other handlers
transparenlty by putting it in pnotes.
See
perdoc Apache::SessionManager
for module documentation and use.
Any comment/criticism are welcome
- Enrico
------------------------------
Date: Sat, 12 Oct 2002 11:38:31 GMT
From: pjacklam@online.no (Peter J. Acklam)
Subject: Re: Any way around using the $& variable?
Message-Id: <wuonkhr1.fsf@online.no>
Tina Mueller <usenet@tinita.de> wrote:
> Peter J. Acklam <pjacklam@online.no> wrote:
>
> > Ok, so how to you shift all the backreferences in an arbitrary
> > regex?
>
> i'm not sure if i understand you right. i'd say, instead of \1
> use \2, for \2 use \3 and so on. just treat the regex as if
> there's one extra couple of parens around it.
The regex is given by the user, and I have no idea what the regex
might be. I can't tell the user that she/he must shift all
backreferences by one. I would consider that a design flaw.
> or use the original regex as a parameter and do:
> $regex =~ s/\\(\d+)/"\\".($1+1)/eg;
Which of course breaks regexes like '\\3' and '\032', where there
is no backreference. It's not that simple.
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: Sat, 12 Oct 2002 11:46:09 GMT
From: pjacklam@online.no (Peter J. Acklam)
Subject: Re: Any way around using the $& variable?
Message-Id: <smzbkheb.fsf@online.no>
Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote:
> [posted & mailed]
>
> On 11 Oct 2002, Peter J. Acklam wrote:
> >
> > Ok, so how to you shift all the backreferences in an arbitrary
> > regex?
>
> With a regex parser! YAPE::Regex. [...]
Hmm...that seems like a lot of extra work just to avoid using $&.
I might just accept the loss of speed.
> You could use the @- and @+ arrays:
>
> s/($regex)/"\e[36m" . substr($_, $-[0], $+[0] - $-[0]) . "\e[m"/ego;
>
> if you have Perl 5.6+.
No, I can't. Introducing extra parentheses will cause certain
regexes to fail where they would otherwise match. For instance
"^(a).*\1$" matches "abba", but "(^(a).*\1$)" does not.
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: 12 Oct 2002 12:47:07 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: Any way around using the $& variable?
Message-Id: <ao95kb$k5oop$1@fu-berlin.de>
Peter J. Acklam <pjacklam@online.no> wrote:
> Tina Mueller <usenet@tinita.de> wrote:
>> or use the original regex as a parameter and do:
>> $regex =~ s/\\(\d+)/"\\".($1+1)/eg;
> Which of course breaks regexes like '\\3' and '\032', where there
> is no backreference. It's not that simple.
right. then use $&. have you actually benchmarked it?
as you are only doing this one regex in the script,
$& might not slow it down too much.
it slows down a script which has a lot of s///, but
only one which uses $&, and this slows down all other
substitutions. but in your case, it shouldn't matter.
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Sat, 12 Oct 2002 13:45:23 GMT
From: pjacklam@online.no (Peter J. Acklam)
Subject: Re: Any way around using the $& variable?
Message-Id: <k7knkbvn.fsf@online.no>
Tina Mueller <usenet@tinita.de> wrote:
> Peter J. Acklam <pjacklam@online.no> wrote:
>
> > Tina Mueller <usenet@tinita.de> wrote:
> >
> > > or use the original regex as a parameter and do:
> > > $regex =~ s/\\(\d+)/"\\".($1+1)/eg;
>
> > Which of course breaks regexes like '\\3' and '\032', where
> > there is no backreference. It's not that simple.
>
> right. then use $&. have you actually benchmarked it?
No, I have not benchmarked yet. I thought there might have been a
simple way which I hadn't thought of, but it seems to be as hard
to avoid $& as I was afraid of. :-)
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: 12 Oct 2002 15:10:07 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Any way around using the $& variable?
Message-Id: <u91y6vvjcw.fsf@wcl-l.bham.ac.uk>
pjacklam@online.no (Peter J. Acklam) writes:
> Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote:
>
> > You could use the @- and @+ arrays:
> >
> > s/($regex)/"\e[36m" . substr($_, $-[0], $+[0] - $-[0]) . "\e[m"/ego;
> >
> > if you have Perl 5.6+.
>
> No, I can't. Introducing extra parentheses will cause certain
> regexes to fail where they would otherwise match.
There is no need to introdice extra parentheses. I don't know why
Jeff put them there.
You also should not use the /o qualifer unless you are really
understand it (in which case you'll probably decide you don't want
it).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sat, 12 Oct 2002 10:29:26 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: "Peter J. Acklam" <pjacklam@online.no>
Subject: Re: Any way around using the $& variable?
Message-Id: <Pine.A41.3.96.1021012102838.14560A-100000@vcmr-104.server.rpi.edu>
[posted & mailed]
On Sat, 12 Oct 2002, Peter J. Acklam wrote:
>Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote:
>
>> s/($regex)/"\e[36m" . substr($_, $-[0], $+[0] - $-[0]) . "\e[m"/ego;
>
>No, I can't. Introducing extra parentheses will cause certain
>regexes to fail where they would otherwise match. For instance
>"^(a).*\1$" matches "abba", but "(^(a).*\1$)" does not.
Err... I don't know WHY I put those ()'s in the regex. You can remove
them. My bad.
s/$regex/"\e[36m" . substr($_, $-[0], $+[0] - $-[0]) . "\e[m"/ego;
--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Sat, 12 Oct 2002 13:10:54 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: effect of "use <version>" on forward-compatibility?
Message-Id: <Pine.LNX.4.40.0210121306350.26642-100000@lxplus073.cern.ch>
On Oct 12, Alan Barclay inscribed on the eternal scroll:
> > $RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $
> > Patch level: 36
> > If this isn't a valid build ID, maybe I have bigger problems than I
> > thought :)
>
> It's 4.036. 4.0 from the version number, plus 36 for the patch.
This version seems vaguely familiar as the version which was, for many
years, distributed with a certain OS (would it have been OSF/1 ?)
because it was used as part of the installation/configuration
procedure.
Those who wanted to use Perl as a production language would definitely
have been advised to install a contemporaneous version of Perl, rather
than the antique version which came bundled with the OS.
Sorry I can't be more definite about the specific OS, but I think
I'm right about the general idea.
--
Gratuitous bigotry, pedantry and sophistry has no place on the Web.
That's what Usenet is for. - Andy Dingley
------------------------------
Date: Sat, 12 Oct 2002 13:36:10 +0000 (UTC)
From: Da Witch <heather710101@yahoo.com>
Subject: How about UNIVERSAL::hashkey() ?
Message-Id: <ao98ga$4l0$1@reader1.panix.com>
I think it would be great of a new hash_code() instance method were
added to UNIVERSAL, so that whenever an object $obj is used as a key
to hash, the Perl interpreter would first call $obj->hash_code to get
the appropriate hashkey to use for that object. (This is the same
idea as the hashCode method of Java's Object class). The default
value returned by UNIVERSAL::hash_code() would be the stringified
version of the object that Perl currently uses whenever objects are
used as hash keys. But class programmers could override this method
to gain greater control over hashes that are indexed by objects.
For example, the class Foo below uses a class variable %registry to
keep track of all the objects created by calling its constructor:
package Foo;
my %registry;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = ...
< blah, blah >;
bless $self, $class;
< blah, blah >;
$class->register($self);
$self
}
sub register {
my ($class, $obj) = @_;
$registry{$obj} = $obj;
}
But now, suppose that Foo had some state variable "id", and that we
wanted to register no more than one object having a given value of
"id". Then if the UNIVERSAL::hash_code scheme were in place, we could
achieve this easily by overriding Foo::hash_code, and making a small
change in register:
sub hash_code { (shift)->id }
sub register {
my ($class, $obj) = @_;
$registry{$obj} = $obj unless exists $registry{$obj};
}
h.
------------------------------
Date: 12 Oct 2002 14:26:23 GMT
From: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
Subject: Re: How about UNIVERSAL::hashkey() ?
Message-Id: <slrnaqgciq.7jb.rgarciasuarez@rafael.example.com>
Da Witch wrote in comp.lang.perl.misc :
>
> I think it would be great of a new hash_code() instance method were
> added to UNIVERSAL, so that whenever an object $obj is used as a key
> to hash, the Perl interpreter would first call $obj->hash_code to get
> the appropriate hashkey to use for that object.
Currently only strings may be used as hash keys. If you want to use
objects as hash keys, use Tie::RefHash, or subclass it.
------------------------------
Date: 12 Oct 2002 15:24:15 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How about UNIVERSAL::hashkey() ?
Message-Id: <u9y993u44w.fsf@wcl-l.bham.ac.uk>
Da Witch <heather710101@yahoo.com> writes:
> I think it would be great of a new hash_code() instance method were
> added to UNIVERSAL, so that whenever an object $obj is used as a key
> to hash, the Perl interpreter would first call $obj->hash_code to get
> the appropriate hashkey to use for that object. (This is the same
> idea as the hashCode method of Java's Object class). The default
> value returned by UNIVERSAL::hash_code() would be the stringified
> version of the object that Perl currently uses whenever objects are
> used as hash keys. But class programmers could override this method
> to gain greater control over hashes that are indexed by objects.
I do not think that there's a need for this feature as if you want a
hash that is keyed on something that's not a simple string I think it
makes more sense to think of this as a feature of the hash rather than
the things that are to be used as keys. This, of course, can already
be done.
Even if this feature were wanted then I think it would be more
appropriate for it to be implemented via the overload mecanism.
use overload
'""' => sub { "In a string context"),
'{}' => sub { "In a hash key context" };
If the '{}' overloading was not specified it should fall-back to the
'""' operator.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sat, 12 Oct 2002 10:35:17 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: Da Witch <heather710101@yahoo.com>
Subject: Re: How about UNIVERSAL::hashkey() ?
Message-Id: <Pine.A41.3.96.1021012103223.14560C-100000@vcmr-104.server.rpi.edu>
[posted & mailed]
On Sat, 12 Oct 2002, Da Witch wrote:
>I think it would be great of a new hash_code() instance method were
>added to UNIVERSAL, so that whenever an object $obj is used as a key
>to hash, the Perl interpreter would first call $obj->hash_code to get
>the appropriate hashkey to use for that object.
Why not just overload the "" operator?
package Foo;
use overload (
'""' => 'hash_code',
fallback => 1,
);
sub new { bless { id => pop }, shift }
sub hash_code { shift->{id} }
1;
Now when you use a Foo object as a string, you'll get the {id} value
returned.
--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Sat, 12 Oct 2002 13:50:30 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: How to get perldb's x programmatically?
Message-Id: <GMVp9.516365$Ag2.20052735@news2.calgary.shaw.ca>
In article <111020021755135916%comdog@panix.com>,
brian d foy <comdog@panix.com> writes:
>In article <ao6tvu$c37$1@reader1.panix.com>, Da Witch <heather710101@yahoo.com> wrote:
>
>> I prefer the formatting used by Perl's debugger's "x" command than
>> that produced by Data::Dumper. Where is the code responsible for
>> generating the output of the "x" command?
>
>the debugger is just a perl script that should be in your perl5 lib.
>look for perl5db.pl.
That approaches cruel and unusual punishment. See how long it takes to
trace through perl5db.pl to see what happens with the x command.
This approximates what happens close enough for most purposes:
$ perl -e 'do "dumpvar.pl"; $x = { foo => [ ({ bar => 42 }) x 2 ] }; dumpValue($x)'
'foo' => ARRAY(0x81079c0)
0 HASH(0x80fbbc0)
'bar' => 42
1 HASH(0x80fbbc0)
-> REUSED_ADDRESS
Although it is better to use Dumpvalue.pm instead for future compatibility:
$ perl -MDumpvalue -e '$d=Dumpvalue->new; \
$x = { foo => [ ({ bar => 42 }) x 2 ] }; $d->dumpValue($x)'
'foo' => ARRAY(0x8104908)
0 HASH(0x80fbb0c)
'bar' => 42
1 HASH(0x80fbb0c)
-> REUSED_ADDRESS
(Yes, it would be nice if it returned a string instead of printing to the
currently selected filehandle...)
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: Sat, 12 Oct 2002 10:32:51 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Is there a way
Message-Id: <uttfqu8tdj435joaetbmu18uhjiu7l9su0@4ax.com>
AGoodGuyGoneBad wrote:
>Is there a way to submit or send a form, and then return back to the page
>without the page being reprinted ?
This belongs in the CGI newsgroup,
<news:comp.infosystems.www.authoring.cgi> (AKA "CIWAC"). I think it
involves returning a "not modified" headers for the HTTP response.
>I need to send the contents of a hidden field, text box, or anything I can
>store data to, then return to the same page with new data in the field.
Perhaps you DO want to use a copy of the original form, with the new
values hardcoded as values for the form elements, if only so you can add
an extra info field saying the data has been updated. As for the
implementation, I'm sure there is an example online (as in "working") on
the website for CGI.pm, <http://stein.cshl.org/WWW/software/CGI/>. Ah,
here it is:
<http://stein.cshl.org/WWW/software/CGI/examples/>
Try out the first example.
--
Bart.
------------------------------
Date: Sat, 12 Oct 2002 16:39:39 +0200
From: "Jan" <jan@nospam.harf.nl>
Subject: Re: Problems with MSIE in combination with MAC not showing Perl generated HTML
Message-Id: <3da83434$0$11204$1b62eedf@news.euronet.nl>
"pkent" <pkent77tea@yahoo.com.tea> wrote in message
news:pkent77tea-DDFC45.02292712102002@news-text.blueyonder.co.uk...
> In article <3da72578$0$11215$1b62eedf@news.euronet.nl>,
> "Jan" <jan@nospam.harf.nl> wrote:
>
> > print "Content-type text/html\nPragma: no-cache\n\n";
> ...
>
> > http://80.60.28.57/top1000/secure/cgi-bin/formtest.pl to see that it
> > normally should work.
>
> It should not work. Your headers are not within the HTTP specification.
> The output of your script is bad and no browser is bound to render it.
> IE 5.1 on MacOS does the right thing and fails to show anything.
>
> This is why so many people round here say:
>
> *** use CGI; ***
>
> You made a mistake that you wouldn't have made if you'd used CGI.pm.
> Think of the time you'd have saved not having to debug this problem.
> Asnwer at the bottom of the message.
>
> > We are totally in the dark why it doesn't show any output on the MAC.
After
>
> It's usually written Mac though, if you mean an Apple Macintosh PC.
>
> P
>
>
> __STUFF__
> dev/area/tmp/perl-5.8.0 > HEAD
> http://80.60.28.57/top1000/secure/cgi-bin/formtest.pl
>
> 200 OK
> Date: Sat, 12 Oct 2002 01:22:32 GMT
> Pragma: no-cache
> Via: 1.1 cache-har (NetCache NetApp/5.1R2D14)
> Server: Microsoft-IIS/4.0
> Client-Bad-Header-Line: Content-type text/html
> Client-Date: Sat, 12 Oct 2002 01:23:15 GMT
> Client-Peer: 80.60.28.57:80
>
> See it now? If you don't then...
>
Took me a while to see it.... Really. Finally saw it because of your
redirection to the CGI module. Thanks a lot for pointing me at the missing
colon...
Cheers,
Jan
------------------------------
Date: Sat, 12 Oct 2002 03:32:10 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: question from beginner >_<
Message-Id: <3DA7CFFA.FF50E9B7@earthlink.net>
kit wrote:
>
> Would you answer the following questions for me ??
[snip]
> 3) I am trying to make a game for my class, hmm ........ if I want to
> make it works online, like playing in 2 different computers, what
> should I do?
To create network sockets, use the IO::Socket::INET module.
Or, if you're very much used to unix socket programming, and like the
nitty gritty low-level stuff, you could use the Socket module.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Sat, 12 Oct 2002 09:44:29 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: question from beginner >_<
Message-Id: <pkent77tea-E009AD.10442912102002@news-text.blueyonder.co.uk>
In article <1751b2b5.0210112148.27350cc@posting.google.com>,
manutd_kit@yahoo.com (kit) wrote:
> 3) I am trying to make a game for my class, hmm ........ if I want to
> make it works online, like playing in 2 different computers, what
> should I do?
Depends on the kind of game. Do you want a client-server model, a peer
to peer model, or something else? Wha sort of game is it, and have you
written any of it already? How OS dependent does the code have to be?
Etc.
Perl can probably do a lot, if not all, of what you want.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Sat, 12 Oct 2002 10:21:12 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: searching an array.
Message-Id: <lktfquseori8q6uf3hffmn9hpm9bhql2ae@4ax.com>
Arne Jamtgaard wrote:
>> $ZipDrive = (@MountList =~ /\/dev\/da0c$/);
>> i have no idea what i'm doing wrong.
>Isn't his what perl's "grep" is for?
Indeed. Though from the code and the description, I'm not sure I
understand what the OP wants to do. If he wants to get one item for
which the regex matches, this will do:
($ZipDrive) = grep { /\/dev\/da0c$/ } @MountList;
as this gives grep() the required list context.
--
Bart.
------------------------------
Date: Sat, 12 Oct 2002 10:13:54 +0200
From: =?ISO-8859-1?Q?Johannes_F=FCrnkranz?= <johannes.fuernkranz@t-online.de>
Subject: Re: Should -i eat my files?
Message-Id: <ao8lnj$u9b$00$1@news.t-online.com>
Tad McClellan wrote:
> Johannes Fürnkranz <johannes.fuernkranz@t-online.de> wrote:
>
> So you want to retract that "but real men don't need backups" now?
>
> :-)
Sure.
[ For what it's worth: I did have a backup. :-) ]
> When you decided to use "bare" -i, you knew you were entering
> dangerous territory. You went anyway.
Well, I thought it was dangerous because I had no possibility of undoing
whatever changes to a file I make, not because it will kill my files.
When you use the -i switch on Linux on a regular basis, and know how to
handle it with care, you'd be *very* surprised if you try it on cygwin,
do whatever you did under Linux and suddenly your files are gone.
Juffi
------------------------------
Date: Sat, 12 Oct 2002 10:20:05 +0200
From: Johannes Fürnkranz <johannes.fuernkranz@t-online.de>
Subject: Re: Should -i eat my files?
Message-Id: <ao8m36$611$04$1@news.t-online.com>
ctcgag@hotmail.com wrote:
> "John W. Krahn" <krahnj@acm.org> wrote:
>
>> Can't do inplace edit without backup
>> (F) You're on a system such as MS-DOS that gets con?
>> fused if you try reading from a deleted (but still
>> opened) file. You have to say `-i.bak', or some such.
>
>
> It sounded like his problem is that he didn't get this message,
> when he should of, rather it just went ahead and munged his files.
Are you trying to tell me that when I am used to perl under Linux, I
should first re-read the entire documentation before I even try to type
a simple command-line substitution under a different operating system?
Perl is known to be a very safe, stable and portable system, at least it
has always been good to me. So I expect whatever works under Linux, will
most likely work under other operating systems, and if it doesn't that
it will certainly not flush my files, but give me a decent error message
that says -i doesn't work here.
Juffi
------------------------------
Date: 12 Oct 2002 04:46:38 -0700
From: felicity_smith75@hotmail.com (Felicity Smith)
Subject: simple question regarding regex's and unicode
Message-Id: <9e7c1e20.0210120346.2e625f85@posting.google.com>
I am having a problem with unicode text.
I want to get a list of words in a text file.
I use this regex to get the list of words
@words= split(/\W+/);
If the file is saved as ANSI text, it works. If the file is saved as
UNICode text I just get a list of all the letters.
How can I have this script handle unicode?
TIA
Felicity
------------------------------
Date: Sat, 12 Oct 2002 03:29:04 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: translate c++ to perl
Message-Id: <3DA7CF40.D73AC40@earthlink.net>
kit wrote:
>
> is there any way that I can translate my c++ code to perl??
Hire a programmer.
But... why do you want to do that? There are situations where it makes
sense to do such a thing, but far more situations where it would be a
dumb idea.
Ever hear the phrase, "if it ain't broke, don't fix it"?
> it sounds stupid, but I dun really know how to use perl.....
Buy and read a perl book or two.
Type the following from your commandline (xterm window or dos window):
perldoc -q book
And it will give you a list of books which you can read.
PS: Comp.lang.perl is dead, and has been for many years.
And your question has nothing to do with perl modules.
General discussion of perl should go to comp.lang.perl.misc.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 3959
***************************************