[18271] in Perl-Users-Digest
Perl-Users Digest, Issue: 439 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 7 18:15:56 2001
Date: Wed, 7 Mar 2001 15:15:27 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984006927-v10-i439@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 7 Mar 2001 Volume: 10 Number: 439
Today's topics:
Re: Regexp matching between <tags> content </tags> <godzilla@stomp.stomp.tokyo>
Re: Regexp matching between <tags> content </tags> <bart.lateur@skynet.be>
Re: Regexp matching between <tags> content </tags> <elijah@workspot.net>
Re: Regexp matching between <tags> content </tags> <bart.lateur@skynet.be>
Re: Regexp matching between <tags> content </tags> (Tad McClellan)
Re: Regexp matching between <tags> content </tags> <godzilla@stomp.stomp.tokyo>
Re: Regexp matching between <tags> content </tags> <godzilla@stomp.stomp.tokyo>
Re: Regexp matching between <tags> content </tags> <bart.lateur@skynet.be>
remove single quotes from filename under RHL <jdhunter@nitace.bsd.uchicago.edu>
Re: remove single quotes from filename under RHL <jdhunter@nitace.bsd.uchicago.edu>
Replacing list item <nissj@zdnetonebox.com>
Re: Replacing list item (Greg Bacon)
Re: Replacing list item <ubl@schaffhausen.de>
Re: Replacing list item <nissj@zdnetonebox.com>
Re: Replacing list item (Tad McClellan)
Re: Replacing list item <godzilla@stomp.stomp.tokyo>
Re: Replacing list item <nissj@zdnetonebox.com>
Re: Some keys don't work in debugger <dimitrio@perlnow.com>
Re: Time Conversion <bart.lateur@skynet.be>
Re: Time Conversion <c_clarkson@hotmail.com>
Re: Time Conversion (John Joseph Trammell)
Re: What's wrong with (remedial)... <centreman_19@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 Mar 2001 11:23:10 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <3AA68A9E.CE9812D8@stomp.stomp.tokyo>
Toni wrote:
(snipped)
> ...to find a regexp for a CGI that matches all the
> stuff between my two tags <!-- #myinclude --> and
> <!-- #myincludeEnd --> .
> ...it should really match ANYTHING between those
> two tags, including umlauts like öäüÖÄÜß....
> ...characters like ,.-_#<>[]{/)\ and so on.
Use of a regex or multiple regexes to accomplish
your task would be a poor choice in programming.
Below my signature you will fine an alternative
method, one of many alternative methods.
Research of this newsgroup will yield hundreds
of articles specifically dealing with your question.
Lacking clear and concise parameters, a presumption
is made you are working with a single line input with
your delimiter tags not split by nextline characters.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
$text = "<!--Begin --> Test One <!--End -->
Ignore This <!--Begin --> Test Two <!--End -->
<!--Begin --> Test Three <!--End --> Ignore This";
do
{
$start = index ($text, "<!--Begin -->", $start) + 13;
$temp = substr ($text, $start, index ($text, "<!--End -->", $start) - $start);
push (@Array, $temp);
$start++;
}
until ($start == rindex ($text, "<!--Begin -->") + 14);
print "Array: @Array";
exit;
PRINTED RESULTS:
________________
Array: Test One Test Two Test Three
------------------------------
Date: Wed, 07 Mar 2001 21:13:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <i09dat4vfpef4b7iuaj4ge899rcr21prrq@4ax.com>
Toni wrote:
>I am trying hard to find a regexp for a CGI that matches all the
>stuff between my two tags <!-- #myinclude --> and
><!-- #myincludeEnd --> . The Problem is, that it should really match
>ANYTHING between those two tags, including umlauts like öäüÖÄÜß
>or special characters like ,.-_#<>[]{/)\ and so on.
>
>At first i thought this would do:
>
>$content=~/\Q<!-- #myinclude -->\E([^<]*)\Q<!-- #myincludeEnd -->\E/mgi;
>
>But I want <'s also to be allowed between my two tags,
.*?
and use the /s modifier, so /./ matches a newline, too. The question
mark makes the star non-greedy (minimal matching).
$content=~/<!-- #myinclude -->(.*?)<!-- #myincludeEnd -->/si;
--
Bart.
------------------------------
Date: 7 Mar 2001 21:14:13 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <eli$0103071604@qz.little-neck.ny.us>
In comp.lang.perl.misc, Toni <tag@gmx.de> wrote:
> I am trying hard to find a regexp for a CGI that matches all the
> stuff between my two tags <!-- #myinclude --> and
> <!-- #myincludeEnd --> .
Are those fixed strings? That can make this much easier.
(/<!--\s*#myinclude\s*-->/ would not work with the method below.)
> The Problem is, that it should really match
> ANYTHING between those two tags, including umlauts like öäüÖÄÜß
> or special characters like ,.-_#<>[]{/)\ and so on.
This character class will match all characters:
[\0-\377]
> At first i thought this would do:
>
> $content=~/\Q<!-- #myinclude -->\E([^<]*)\Q<!-- #myincludeEnd -->\E/mgi;
$start = index($content, '<!-- #myinclude -->');
if ($start < 0) {
# start tag not found: deal with error here
}
$end = index($content, '<!-- #myincludeEnd -->', $start);
if ($end < 0) {
# end tag not found: deal with error here
}
$middlebit = substr($content, $start, ($end - $start));
That will cause middle bit to have the start and end tags, but
add or substract the lengths of those tags as appropriate to fix
that.
And don't forget the four arg fourm of substr to replace the middle
bit.
Elijah
------
or use that match-all-chars character class
------------------------------
Date: Wed, 07 Mar 2001 21:16:36 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <d79datgdens9gj9blue55g2tmjkcgo7dnd@4ax.com>
Godzilla! wrote:
>Use of a regex or multiple regexes to accomplish
>your task would be a poor choice in programming.
That's not the first time this week you say something liek this. I think
you're using the wrong language. You'd better go to C, or any other
compiled language, if you insist on doing things in such a low level
manner. Regexes are one of the selling poitns of Perl, and it's really
good (fast) at it. If you want to bypass regexes for a (IMO)
misconceived idea of "efficiency", you're using the wrong language.
--
Bart.
------------------------------
Date: Wed, 7 Mar 2001 14:51:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <slrn9ad49k.alu.tadmc@tadmc26.august.net>
Toni <tag@gmx.de> wrote:
>Hy everybody,
>I am trying hard to find a regexp for a CGI that matches all the
>stuff between my two tags <!-- #myinclude --> and
><!-- #myincludeEnd --> . The Problem is, that it should really match
>ANYTHING between those two tags, including umlauts like öäüÖÄÜß
>or special characters like ,.-_#<>[]{/)\ and so on.
>
>At first i thought this would do:
>
>$content=~/\Q<!-- #myinclude -->\E([^<]*)\Q<!-- #myincludeEnd -->\E/mgi;
^^ ^^ ^^ ^^ ^
^^ ^^ ^^ ^^ ^
None of those are needed. They are needless clutter. It is already
cluttered enough even without them.
If you don't understand why you can leave all of them out (including
the "m" option), then it's time to hit perlre.pod and perlop.pod again...
>But I want <'s also to be allowed between my two tags,
>so I started putting anything into my match class like this:
>
>$content=~/\Q<!-- #myinclude
>-->\E([\s\d\w\.\ä\ö\ü\Ä\Ö\Ü\ß\:\;\\]*)\Q<!-- #myincludeEnd -->\E/mgi;
>
>But this is obviously not the best way to do it, is it ?
>Do you perhaps have a clever idea how to do it ?
What's wrong with the below?
while ( $content =~ /<!-- #myinclude -->(.*?)<!-- #myincludeEnd -->/gsi ) {
print "matched '$1'\n";
}
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 07 Mar 2001 13:32:19 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <3AA6A8E3.CAC89F51@stomp.stomp.tokyo>
Bart Lateur wrote:
> Godzilla! wrote:
(snippage not noted by Barf Latrine)
> >Use of a regex or multiple regexes to accomplish
> >your task would be a poor choice in programming.
> That's not the first time this week you say something liek this.
> I think you're using the wrong language. You'd better go to C,
> or any other compiled language, if you insist on doing things
> in such a low level manner. Regexes are one of the selling
> poitns of Perl, and it's really good (fast) at it. If you
> want to bypass regexes for a (IMO) misconceived idea of
> "efficiency", you're using the wrong language.
( )
==\ __ __[oo
\/ /\@
## l_____|
#### ll ll
###### LL LL
Godzilla!
--
@ø=(a .. z);@Ø=qw(6 14 3 25 8 11 11 0 17 14 2 10 18);
$§="\n";$ß="\b";undef$©;print$§x($Ø[4]/2);
for($¡=0;$¡<=$Ø[2];$¡++){foreach$¶(@Ø){
$ø[$¶]=~tr/A-Z/a-z/;if(($¡==1)||($¡==$Ø[2]))
{$ø[$¶]=~tr/a-z/A-Z/;}print$ø[$¶];if($¶==0)
{print" ";}if($¶==$Ø[12]){print" !";}&D;}
print$ßx($Ø[4]*2);}print$§x($Ø[10]*2);
sub D{select$©,$©,$©,.25;}exit;
------------------------------
Date: Wed, 07 Mar 2001 14:36:46 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <3AA6B7FE.2A6BD4FF@stomp.stomp.tokyo>
Bart Lateur wrote:
> Godzilla! wrote:
> >Use of a regex or multiple regexes to accomplish
> >your task would be a poor choice in programming.
> That's not the first time this week you say something liek this. I think
> you're using the wrong language. You'd better go to C, or any other
> compiled language, if you insist on doing things in such a low level
> manner. Regexes are one of the selling poitns of Perl, and it's really
> good (fast) at it. If you want to bypass regexes for a (IMO)
> misconceived idea of "efficiency", you're using the wrong language.
Your code methodology is an average 2.5 times slower than
my methodology. Your code is exceptionally inefficient and
consumes memory to an even greater degree.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
use Benchmark;
print "Run One:\n\n";
&Time;
print "\n\nRun One:\n\n";
&Time;
print "\n\nRun One:\n\n";
&Time;
sub Time
{
timethese (100000,
{
'name1' =>
'$content = "Ignore This <!-- #myinclude -->
Test One <!-- #myincludeEnd --> Ignore This";
if ($content=~/<!-- #myinclude -->(.*?)<!-- #myincludeEnd -->/si)
{ $content = $1; }',
'name2' =>
'$content = "Ignore This <!-- #myinclude -->
Test One <!-- #myincludeEnd --> Ignore This";
$start = index ($content, "<!-- #myinclude -->") + 19;
$content = substr ($content, $start, rindex ($content,
"<!-- #myincludeEnd -->") - $start);',
}
);
}
exit;
PRINTED RESULTS:
________________
Run One:
Benchmark: timing 100000 iterations of name1, name2...
name1: 2 wallclock secs ( 1.49 usr + 0.00 sys = 1.49 CPU) @ 67114.09/s
name2: 1 wallclock secs ( 0.60 usr + 0.00 sys = 0.60 CPU) @ 166666.67/s
Run One:
Benchmark: timing 100000 iterations of name1, name2...
name1: 1 wallclock secs ( 1.43 usr + 0.00 sys = 1.43 CPU) @ 69930.07/s
name2: 1 wallclock secs ( 0.60 usr + 0.00 sys = 0.60 CPU) @ 166666.67/s
Run One:
Benchmark: timing 100000 iterations of name1, name2...
name1: 2 wallclock secs ( 1.43 usr + 0.00 sys = 1.43 CPU) @ 69930.07/s
name2: 1 wallclock secs ( 0.60 usr + 0.00 sys = 0.60 CPU) @ 166666.67/s
------------------------------
Date: Wed, 07 Mar 2001 22:49:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regexp matching between <tags> content </tags>
Message-Id: <ioedatc1tm0pg6tme8nj4igkicuoj6oibl@4ax.com>
Godzilla! wrote:
>Your code methodology is an average 2.5 times slower than
>my methodology. Your code is exceptionally inefficient
You're talking about a difference of one second for 100000 matches. That
is a difference of 10 microseconds per regex match. I would hardly call
that "exceptionally inefficient".
--
Bart.
------------------------------
Date: 07 Mar 2001 16:42:58 -0600
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: remove single quotes from filename under RHL
Message-Id: <1rr909jj4d.fsf@video.bsd.uchicago.edu>
I am on a Redhat Linux 6.2 system and am writing a perl script to
automatically remove some single quotes from filenames. So far with
no luck.
The script:
#!/usr/local/bin/perl -w
use strict;
use Shell('mv');
foreach my $file (@ARGV) {
next unless -e $file;
my $newname = $file;
$newname =~ s/\'//g;
$file =~ s/\'/\\'/g;
print "Moving $file to $newname\n";
mv($file, $newname);
}
A sample run:
video:/video/hunter/backups/tcuriel> testperl querytoAnn\'sPrayers
Moving querytoAnn\'sPrayers to querytoAnnsPrayers
sh: unexpected EOF while looking for `''
sh: -c: line 2: syntax error
video:/video/hunter/backups/tcuriel>
Suggestions please ....
Thanks,
John Hunter
perl 5.6.0
------------------------------
Date: 07 Mar 2001 16:47:57 -0600
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: Re: remove single quotes from filename under RHL
Message-Id: <1ritllb3he.fsf@video.bsd.uchicago.edu>
>>>>> "John" == John Hunter <jdhunter@nitace.bsd.uchicago.edu> writes:
John> I am on a Redhat Linux 6.2 system and am writing a perl
John> script to automatically remove some single quotes from
John> filenames. So far with no luck.
Use rename instead of the shell 'mv'!
------------------------------
Date: Wed, 07 Mar 2001 19:36:31 GMT
From: nis <nissj@zdnetonebox.com>
Subject: Replacing list item
Message-Id: <3AA68CA9.C0C3B5B6@zdnetonebox.com>
Hi all,
I have a lists for example
@ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
I also have 2 numbers for example 1-20.
Now I want to run throuh each number (1-20) and add ".K" (or some other
letter) to the number in turn.
If there is a match in the ORG-list it should replace that one with the
new number.value.
I would appreciate any help on this.
Thanks.
Nis
------------------------------
Date: Wed, 07 Mar 2001 19:52:14 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Replacing list item
Message-Id: <tad4bej3jpnr1c@corp.supernews.com>
In article <3AA68CA9.C0C3B5B6@zdnetonebox.com>,
nis <nissj@zdnetonebox.com> wrote:
: I have a lists for example
: @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
:
: I also have 2 numbers for example 1-20.
:
: Now I want to run throuh each number (1-20) and add ".K" (or some other
: letter) to the number in turn.
: If there is a match in the ORG-list it should replace that one with the
: new number.value.
[14:48] % cat try
#! /usr/local/bin/perl -w
use strict;
sub replacements {
my $lo = shift;
my $hi = shift;
my @ltr = 'A' .. 'Z';
my %h;
for ($lo .. $hi) {
$h{$_} = $_ . "." . $ltr[rand @ltr];
}
%h;
}
my @ORG = qw/ 1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K /;
my %repl = replacements 1, 20;
$" = "][";
print "BEFORE: [@ORG]\n";
for (@ORG) {
my($n) = /^(\d+)\.[A-Z]\z/;
if ($n && $repl{$n}) {
$_ = $repl{$n};
}
}
print "AFTER: [@ORG]\n";
[14:48] % ./try
BEFORE: [1.R][2.R][5.K][6.L][7.L][15.K][16.K][17.K][18.K]
AFTER: [1.L][2.T][5.Q][6.G][7.Z][15.F][16.S][17.O][18.I]
Hope this helps,
Greg
--
Any sufficiently complicated C or Fortran program contains an ad hoc
informally-specified bug-ridden slow implementation of half of Common Lisp.
-- Philip Greenspun
------------------------------
Date: Wed, 07 Mar 2001 21:11:59 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Replacing list item
Message-Id: <3AA6960F.14A06BDF@schaffhausen.de>
nis wrote:
>
> Hi all,
>
> I have a lists for example
> @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
>
> I also have 2 numbers for example 1-20.
>
> Now I want to run throuh each number (1-20) and add ".K" (or some other
> letter) to the number in turn.
> If there is a match in the ORG-list it should replace that one with the
> new number.value.
I didn't totally understand your question but to quote one of the most
famous
people around here the solution is very likely to be a hash :-)
->malte
------------------------------
Date: Wed, 07 Mar 2001 21:12:26 GMT
From: nis <nissj@zdnetonebox.com>
Subject: Re: Replacing list item
Message-Id: <3AA6A321.37F970FA@zdnetonebox.com>
Thanks for your answers.
I'll try and explain it a bit better.
Here it goes,
I have i file that stores the information like the @ORG (e.g 1.R 2.R 5.K 6.L
7.L 15.K 16.K 17.K 18.K).
Then i want to run it with start and end numbers and a value (e.g 5 16 K)
It will then add this to the line in the file and if the line has a value in
that number it should replace it with my new one.
I think the hash sounds like the way to go but I havent used perl that long
and I would like some examples if that is not to much to ask for.
Thanks again
Malte Ubl wrote:
> nis wrote:
> >
> > Hi all,
> >
> > I have a lists for example
> > @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
> >
> > I also have 2 numbers for example 1-20.
> >
> > Now I want to run throuh each number (1-20) and add ".K" (or some other
> > letter) to the number in turn.
> > If there is a match in the ORG-list it should replace that one with the
> > new number.value.
>
> I didn't totally understand your question but to quote one of the most
> famous
> people around here the solution is very likely to be a hash :-)
>
> ->malte
------------------------------
Date: Wed, 7 Mar 2001 15:31:10 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Replacing list item
Message-Id: <slrn9ad6ke.alu.tadmc@tadmc26.august.net>
nis <nissj@zdnetonebox.com> wrote:
>
>I have a lists for example
> @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
^ ^ ^ ^ ^ ^ ^ ^ ^
Do not use barewords.
Do enable warnings.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 07 Mar 2001 13:46:22 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Replacing list item
Message-Id: <3AA6AC2E.126D2E3C@stomp.stomp.tokyo>
nis wrote:
> I have a lists for example
> @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
This is not a list. This is an array containing a
single element, ignoring your lack of a semicolon.
> I also have 2 numbers for example 1-20.
This is not a number. This is a string composed
of four characters, not counting your trailing
period. If it is not a string, then this might
represent the numbers, one through twenty,
inclusive. This would not be two numbers.
This is twenty numbers.
> Now I want to run throuh each number (1-20) and add ".K"
> (or some other letter) to the number in turn.
Initially you indicated two numbers. It appears you
are planning to loop through one to twenty, inclusive.
You have contradicted yourself. First you indicate
there will specific numeric input; your two numbers.
Currently you indicate looping through a number set
comprised of one through twenty, inclusive. How are
people to make sense of such contradiction?
> If there is a match in the ORG-list it should
> replace that one with the new number.value.
What is 'new number.value'? Do you mean a format
of 'number.letter' as with '20.K'?
A match in ORG-list. Interesting. Should you loop
through one to twenty, inclusive, with the letter
K affixed per your format, as an example, what
changes would take place in your string, or array
if it were a list of elements?
There would be substitutions but no changes, right?
My suggestion is you sit, think and perhaps write
notes pertaining to what you want to do. This article
of yours doesn't make a cow lick of sense.
Godzilla!
------------------------------
Date: Wed, 07 Mar 2001 22:07:25 GMT
From: nis <nissj@zdnetonebox.com>
Subject: Re: Replacing list item
Message-Id: <3AA6B008.21AC0917@zdnetonebox.com>
hmm...
If the list looked like that dont you think my question would be about
that then?
And if I say "I want to run throuh each number (1-20)" that would be
eqaul to a loop in my eyes.
Hope you answer made you feel better......
"Godzilla!" wrote:
> nis wrote:
>
> > I have a lists for example
> > @ORG = (1.R 2.R 5.K 6.L 7.L 15.K 16.K 17.K 18.K)
>
> This is not a list. This is an array containing a
> single element, ignoring your lack of a semicolon.
>
> > I also have 2 numbers for example 1-20.
>
> This is not a number. This is a string composed
> of four characters, not counting your trailing
> period. If it is not a string, then this might
> represent the numbers, one through twenty,
> inclusive. This would not be two numbers.
> This is twenty numbers.
>
>
> > Now I want to run throuh each number (1-20) and add ".K"
> > (or some other letter) to the number in turn.
>
> Initially you indicated two numbers. It appears you
> are planning to loop through one to twenty, inclusive.
> You have contradicted yourself. First you indicate
> there will specific numeric input; your two numbers.
> Currently you indicate looping through a number set
> comprised of one through twenty, inclusive. How are
> people to make sense of such contradiction?
>
> > If there is a match in the ORG-list it should
> > replace that one with the new number.value.
>
> What is 'new number.value'? Do you mean a format
> of 'number.letter' as with '20.K'?
>
> A match in ORG-list. Interesting. Should you loop
> through one to twenty, inclusive, with the letter
> K affixed per your format, as an example, what
> changes would take place in your string, or array
> if it were a list of elements?
>
> There would be substitutions but no changes, right?
>
> My suggestion is you sit, think and perhaps write
> notes pertaining to what you want to do. This article
> of yours doesn't make a cow lick of sense.
>
> Godzilla!
------------------------------
Date: Wed, 07 Mar 2001 14:19:25 -0500
From: Dimitri Ostapenko <dimitrio@perlnow.com>
Subject: Re: Some keys don't work in debugger
Message-Id: <3AA689BD.DB44BDC0@perlnow.com>
"Alexander Farber (EED)" wrote:
>
> Dimitri Ostapenko wrote:
> >
> > Arrow keys don't work in debugger in latest Mandrake or debian and I can't
> > figure why. I tried different TERM settings to no avail. Would it be 8 bit
> > support?
> >
> > Can anybody help?
>
> Maybe you have to install Term::Readline or some similar module -
> it has helped me. I also can type Russian letters in it, but I
> think it is more related to the xterm version which you are using
I figured it out!
O HighBit=1
Bloody thing was driving me crazy :)
--
Dimitri Ostapenko
------------------------------
Date: Wed, 07 Mar 2001 19:07:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Time Conversion
Message-Id: <2u0dat4v0d2f1fop5dfrjt1poemnupferh@4ax.com>
Sylvie wrote:
>Is it possible to convert human-readable time information (day, month,
>year, etc.) back to the machine version?
>
>I know you can use localtime to go from the machine's time to something
>people can read, but I want to do the opposite.
If you know how to parse the date/time back into the list form that
localtime returns, then the standard module (is on every system)
Time::Local can make a long integer timestamp of it. timelocal() is the
inverse of localtime(), timegm() of gmtime().
If you don't want to do any string parsing yourself, there's the module
Date::Calc. See CPAN, <http://search.cpan.org/search?dist=Date-Calc>.
Beware: this module is huge!
--
Bart.
------------------------------
Date: Wed, 7 Mar 2001 15:13:23 -0600
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: Time Conversion
Message-Id: <3F752C6AE4E87765.3F2C8BE866598C12.08FEADEBEEEA4D73@lp.airnews.net>
Sylvie <sylvie.noel@crc.ca> wrote in
: Is it possible to convert human-readable time information (day, month,
: year, etc.) back to the machine version?
:
: I know you can use localtime to go from the machine's time to something
: people can read, but I want to do the opposite.
According to the documentation for localtime:
Also see the Time::Local module (to convert the second,
minutes, hours, ... back to seconds since the stroke of
midnight the 1st of January 1970, the value returned by
time()), and the strftime(3) and mktime(3) functions
available via the POSIX module.
HTH,
Charles K. Clarkson
------------------------------
Date: Wed, 07 Mar 2001 23:01:26 GMT
From: trammell@bayazid.hypersloth.net (John Joseph Trammell)
Subject: Re: Time Conversion
Message-Id: <slrn9add6f.nv5.trammell@bayazid.hypersloth.net>
On Wed, 07 Mar 2001 10:23:42 -0500, Sylvie <sylvie.noel@crc.ca> wrote:
> Is it possible to convert human-readable time information (day, month,
> year, etc.) back to the machine version?
Seekest thou the Time::Local module.
------------------------------
Date: Wed, 7 Mar 2001 12:33:41 -0800
From: "Brandon Thornburg" <centreman_19@yahoo.com>
Subject: Re: What's wrong with (remedial)...
Message-Id: <986663$1rp$1@fremont.ohsu.edu>
What ended up working was this, and at this point I can't remember who
suggested it this way:
if (($in{degree} eq "")||($in{degree1} eq "B.S.")||($in{degree1} eq
"B.A.")||($in{degree1} eq "A.A.")||($in{degree1} eq "A.S.")){
print STDOUT "";
}else{
print STDOUT ", $in{degree1}";
}
Wordier than some of the examples given, but it has the advantage that a
newbie like me can understand what it means. I can't thank you all enough
for the help...
------------------------------
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 V10 Issue 439
**************************************