[27871] in Perl-Users-Digest
Perl-Users Digest, Issue: 9235 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 19 11:05:55 2006
Date: Fri, 19 May 2006 08:05:07 -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 Fri, 19 May 2006 Volume: 10 Number: 9235
Today's topics:
Re: "my" and "our" <bol@adv.magwien.gv.at>
Re: Adding to a number in replace <rvtol+news@isolution.nl>
documented $PROGRAM_NAME use in error? <aederhaag@alansys.newerasoftdevel.com>
Re: documented $PROGRAM_NAME use in error? <mritty@gmail.com>
Re: Escaping @ in regexps: perl5.6 vs perl5.8 <rvtol+news@isolution.nl>
Re: How do I get IEEE infinity? <schapel@pixelgate.net>
Re: How do I get IEEE infinity? <××DBraughler××@××bwcc·com>
Re: Parse inf comments in perl? <rvtol+news@isolution.nl>
Re: PB with euro sign and checkbox in multipart/form-da <rvtol+news@isolution.nl>
Re: PB with euro sign and checkbox in multipart/form-da <tadmc@augustmail.com>
Re: printing css <mritty@gmail.com>
Re: Search and replace with confirmation <1usa@llenroc.ude.invalid>
Re: Search and replace with confirmation pavan734@gmail.com
Re: Search and replace with confirmation <1usa@llenroc.ude.invalid>
Re: Search and replace with confirmation <tadmc@augustmail.com>
Text parsing and substitution maheshpop1@gmail.com
Re: Text parsing and substitution <corff@zedat.fu-berlin.de>
Re: Text parsing and substitution <tadmc@augustmail.com>
Re: Text parsing and substitution <rvtol+news@isolution.nl>
Re: Text parsing and substitution <DJStunks@gmail.com>
Using printf to modify scalars <salmjuh@hotmail.com>
Re: Using printf to modify scalars <nobull67@gmail.com>
UTF-8 without external modules on Perl 5.0 <ynleder@nspark.org>
Re: variable that I want to treat as information read f <bol@adv.magwien.gv.at>
why doesn't this eval print ? <MisterPerl@gmail.com>
Re: why doesn't this eval print ? niall.macpherson@ntlworld.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 May 2006 13:47:42 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: "my" and "our"
Message-Id: <1148039262.662241@proxy.dienste.wien.at>
Dave:
> The PBP recommendation to use longer descriptive names for variables whose
> scope more than a few lines (I'm paraphrasing here) would help you avoid
> such problems.
May be, may not be. I used "fz" as abbreviation for "format zone"; that's
what
$fz is used for. And if I had spelled out the name fully, I also would spell
it out
a second time, so I'm not sure whether this recommandation actually had
solved
this problem.
The problem here is that data is changed unexpectedly - the original value
of the
lexical is overwritten by the global $fz value. Even one could access the
lexical
$fz (perhaps by a pseudo package "My::" - how about this?), its originally
assigned value is lost. And this should be mentioned by Perl absolutely -
IMHO
even without "use warnings".
Greetings, Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: Fri, 19 May 2006 12:48:51 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Adding to a number in replace
Message-Id: <e4kfn3.o0.1@news.isolution.nl>
Paul Lalli schreef:
> s/^Page (\d+)$/"Page " . ($1 + 3)/e;
More complex looking, but still DRY-er (Don't Repeat Yourself) variants:
s/ ^ # at BOL
(Page[ ]) # capture "Page<space>" as $1
(\d+) # capture 1 or more digits as $2
/$1 . ($2 + 3)/ex; # replace captured digits
s/ (?<=^Page[ ]) # zero-width prefix of "^Page<space>"
(\d+) # capture 1 or more digits as $1
/$1 + 3/ex; # replace captured digits
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 19 May 2006 06:47:49 -0700
From: Alan E Derhaag <aederhaag@alansys.newerasoftdevel.com>
Subject: documented $PROGRAM_NAME use in error?
Message-Id: <m3fyj6gm7u.fsf@alansys.newerasoftdevel.com>
The perldoc perlvar continues to indicate $0 or $PROGRAM_NAME can be
used to indicate the program name for the script being run, but I can
never get $PROGRAM_NAME to be defined. Is that a long standing error
in the docs that everyone misses or agrees not to fix?
--
Alan E. Derhaag New Era Software Development
http://aederhaag.home.comcast.net/ Auburn, WA, USA
email: aederhaag@comcast.net, aderhaag@msn.com
------------------------------
Date: 19 May 2006 06:47:38 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: documented $PROGRAM_NAME use in error?
Message-Id: <1148046458.362137.244110@u72g2000cwu.googlegroups.com>
Alan E Derhaag wrote:
> The perldoc perlvar continues to indicate $0 or $PROGRAM_NAME can be
> used to indicate the program name for the script being run, but I can
> never get $PROGRAM_NAME to be defined. Is that a long standing error
> in the docs that everyone misses or agrees not to fix?
Which do you think is more likely?
A) The documentation has been wrong for many many years and many many
revisions of Perl, and you are either 1) The first person to notice, or
2) The first person to care
or
B) You're doing something wrong?
Have you ever heard of Occam's Razor? ;-)
Read the very FIRST two paragraphs of the documentation you referred
to....
Paul Lalli
------------------------------
Date: Fri, 19 May 2006 13:07:06 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Escaping @ in regexps: perl5.6 vs perl5.8
Message-Id: <e4kgcj.fo.1@news.isolution.nl>
Ala Qumsieh schreef:
> It seems that in perl5.8, @ characters need to be escaped in regexps.
> Example:
>
> % perl5.6.1 -le '$_ = q/ @@@@ b.com/; print if /^\s+@+\s+\w/'
> @@@@ b.com
> % perl5.8.6 -le '$_ = q/ @@@@ b.com/; print if /^\s+@+\s+\w/'
> % perl5.8.8 -le '$_ = q/ @@@@ b.com/; print if /^\s+@+\s+\w/'
> % perl5.8.6 -le '$_ = q/ @@@@ b.com/; print if /^\s+\@+\s+\w/'
> @@@@ b.com
>
> I don't have anything between 5.6.1 and 5.8.6 to test on. Looking at
> the list of changes, I couldn't see anything directly related to this.
> Is this a bug? If not, what is the reason for this change?
I prefer to use [@], because that format 'survives' best.
The regex-optimizer doesn't realize yet the step
from "ANYOF<[x]>" to "EXACT<x>", but it is coming:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-05/msg00628.html
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 May 2006 13:28:26 GMT
From: Steve Chapel <schapel@pixelgate.net>
Subject: Re: How do I get IEEE infinity?
Message-Id: <_Jjbg.73836$F_3.59044@newssvr29.news.prodigy.net>
Ilya Zakharevich wrote:
>
> exp 1e300000000
>
Weird. Just '$var = 1e1000;' sets $var to +Infinity. I would expect 1.0
/ 0.0 to silently evaluate to +Infinity, and an overflowing literal to
generate a compile-time error or warning.
------------------------------
Date: Fri, 19 May 2006 09:38:50 -0400
From: Denver <××DBraughler××@××bwcc·com>
Subject: Re: How do I get IEEE infinity?
Message-Id: <126rijblcpr4q35@corp.supernews.com>
Steve Chapel wrote:
> I would expect 1.0 / 0.0 to silently evaluate to +Infinity
It mathematics, division by 0 is undefined, not infinity (infinity is not large enough).
------------------------------
Date: Fri, 19 May 2006 14:49:12 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Parse inf comments in perl?
Message-Id: <e4kltu.js.1@news.isolution.nl>
Vinay schreef:
> My first query here is I have a project to parse and remove comments
> in a text file. The comments are described as:
> Any characters following a semicolon on the same line, unless the
> semicolon appears within a "quoted string"
Read the Posting Guidelines.
Create a script.
If the script doesn't do what you want it to do, make a minimal script
that has the problem, and come back here.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 May 2006 15:03:33 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: PB with euro sign and checkbox in multipart/form-data
Message-Id: <e4knh6.jg.1@news.isolution.nl>
Yohan N. Leder schreef:
> # PB : € sign in any form field corrupt beginning of
You are including a character >127 in a posting that has no Content-Type
header field that explains which character is meant there.
Also there is no Content-Transfer-Encoding header field about 8bits. The
default is 7bits (ASCII), so newsclients will set the highest bit of all
out-of-band characters to zero.
To find the error in the HTML that you generate, read
http://en.wikipedia.org/wiki/ISO_8859-1
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 19 May 2006 08:29:07 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: PB with euro sign and checkbox in multipart/form-data
Message-Id: <slrne6ri12.4n0.tadmc@magna.augustmail.com>
Yohan N Leder <ynleder@nspark.org> wrote:
> In article <slrne6pqka.2c5.tadmc@magna.augustmail.com>,
> tadmc@augustmail.com says...
>> I read the whole program, but I did not see any explanation
>> of Peanut Butter...
>>
>
> Did you ran the script ?
No.
You seem to have missed my point.
Please don't use cutsie spellings in Usenet posts.
"PB" might mean "peanut butter".
"problem" clearly means "problem", so use that instead.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 May 2006 07:00:32 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: printing css
Message-Id: <1148047232.760356.310450@u72g2000cwu.googlegroups.com>
Nospam wrote:
> I am afraid all those instances still showed an error:
All of *what* instances? Please quote context when replying, as
everyone else has done.
> Bareword found where operator expected at
> ...""<style type="text"
>
> (Missing operator before text?)
> String found where operator expected at...
> near "css">""
If you'll look at the code this error is complaning about, you'll see
that it can't possibly be any of "those instances" that everyone
recommended you try. You either didn't follow anyone's advice,
re-typed incorrectly, or forgot to save your changes before running it
again.
Paul Lalli
------------------------------
Date: Fri, 19 May 2006 10:57:31 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Search and replace with confirmation
Message-Id: <Xns97C846D169DF3asu1cornelledu@127.0.0.1>
"Wolf" <kbshiv@gmail.com> wrote in news:1148025419.812503.25340
@y43g2000cwc.googlegroups.com:
> You'll need to use print and read <STDIN>
Why?
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 19 May 2006 04:18:31 -0700
From: pavan734@gmail.com
Subject: Re: Search and replace with confirmation
Message-Id: <1148037511.018261.265520@j33g2000cwa.googlegroups.com>
Thank you Bart Van der Donck.
Bart Van der Donck wrote:
> pavan734@gmail.com wrote:
>
> > I have a perl script running on a file1 that searches for
> > pattern1 and replaces with pattern2 and writes to file2. But this will
> > do all the substitutions. Here is a code that searches for hi in
> > source.txt and replaces with bye in target.txt.
> > [...]
> > My requirement is before doing replace the script must ask the user
> > whether to do the substitution or not. That is it must ask the user
> > "press y if u want to substitute else press any character."
>
> This demonstrates the principle:
>
> #!perl
> use strict;
> use warnings;
> print "\nType 'y' to proceed or any other character to cancel: ";
> my $character = <>;
> chop $character;
> if (lc $character eq 'y') {
> print "\nOK to do substitution\n";
> }
> else {
> print "\nNot OK to do substitution\n";
> }
>
> --
> Bart
>
> " I don't like computer code:
> it always does what I say, not what I want ! "
------------------------------
Date: Fri, 19 May 2006 11:26:27 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Search and replace with confirmation
Message-Id: <Xns97C84BB8CF24Fasu1cornelledu@127.0.0.1>
pavan734@gmail.com wrote in news:1148019204.228037.189800
@j73g2000cwa.googlegroups.com:
> My requirement is before doing replace the script must ask the user
> whether to do the substitution or not. That is it must ask the user
> "press y if u want to substitute else press any character."
See
http://www.unur.com/comp/ppp/delallspam.html
for an example.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 19 May 2006 08:05:41 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Search and replace with confirmation
Message-Id: <slrne6rgl5.4n0.tadmc@magna.augustmail.com>
pavan734@gmail.com <pavan734@gmail.com> wrote:
> I have a perl script running on a file1 that searches for
> pattern1 and replaces with pattern2
There *is no* second pattern.
s/// has ONE pattern, and one replacement *string*.
> s/\bhi\b/\bbye\b/g ;
^^ ^^
^^ ^^ these are backspaces, not word boundaries,
because they are in a string, not in a regex
Have you even tried this code?
> My requirement is before doing replace the script must ask the user
> whether to do the substitution or not.
-------------------------------
#!/usr/bin/perl
use warnings;
use strict;
$_ = "hi there, the cost is too hi";
my $find = 'hi';
my $replace = 'bye';
s/\b($find)\b/ confirm($_, $find, $replace, pos) /ge;
print "$_\n";
sub confirm {
my($string, $pattern, $replacement, $position) = @_;
print "$string\n";
print ' ' x $position, '^' x length($pattern), "\n";
print "replace? (y/n) ";
chomp(my $ans = <STDIN>);
return $ans =~ /^(yes\b|y$)/ ? $replacement : $pattern;
}
-------------------------------
Or, if you don't mind your program being slower to execute:
-------------------------------
#!/usr/bin/perl
use warnings;
use strict;
$_ = "hi there, the cost is too hi";
my $find = 'hi';
my $replace = 'bye';
s/\b($find)\b/ confirm($find, $replace) /ge;
print "$_\n";
sub confirm {
my($pattern, $replacement) = @_;
print "$`<<$&>>$'\n";
print "replace? (y/n) ";
chomp(my $ans = <STDIN>);
return $ans =~ /^(yes\b|y$)/ ? $replacement : $pattern;
}
-------------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 May 2006 03:17:22 -0700
From: maheshpop1@gmail.com
Subject: Text parsing and substitution
Message-Id: <1148033842.807458.122460@u72g2000cwu.googlegroups.com>
Hi guys,
I am doing this module where I am gonna change the following sentence
"1:action=commit:user=joe:date=2005-02-02:"
"2:action=checkout:user=mark:date=2005-02-03:"
to something like
" 1. Commits by user Joe on date 2005-02-02 "
" 2. Checkouts by user Joe on date 2005-02-03"
making the above text a little bit more readable to the user. I started
of with a program which finds out the different key value pairs and
and based on the values append/create a string with approriate words
like
pseudocode only
parse the line,
load a hashmap with the key, value pairs
if(hash{action}=='commit') <---this is a mandatory field
string.="Commits"
if(defined hash{user})
string.="by hash{user})
if(defined hash{date})
string.="on date hash{date}"
...................................
...................................
if(hash{action}=='checkout') <---this is a mandatory field
string.="Commits"
if(defined hash{user})
string.="by hash{user})
if(defined hash{date})
string.="on date hash{date}"
.............................................
............................................
I was thinking this sort of logic but a little apprehensive how elastic
it can be as I would be addressing so many actions and seperate if
blocks for all of them. Any suggestions or ideas on how to better
achieve what I want to do above.
cheers,
pop.
------------------------------
Date: 19 May 2006 10:57:24 GMT
From: <corff@zedat.fu-berlin.de>
Subject: Re: Text parsing and substitution
Message-Id: <4d5mkkF1913ifU1@uni-berlin.de>
maheshpop1@gmail.com wrote:
: Hi guys,
: I am doing this module where I am gonna change the following sentence
: "1:action=commit:user=joe:date=2005-02-02:"
: "2:action=checkout:user=mark:date=2005-02-03:"
: to something like
: " 1. Commits by user Joe on date 2005-02-02 "
: " 2. Checkouts by user Joe on date 2005-02-03"
Check whether all your data follow the same pattern and obey the same
constraints. Apparently you'r doing something in fields here, so:
$rawtext="1:action=commit:user=joe:date=2005-02-02:";
($no,$rawaction,$rawuser,$rawdate)=split(/:/,$rawtext);
# Treat each raw element like this:
($nil,$user)=split(/=/,$rawuser);
# Keep a hash for full user names (and for actions as well):
%users(
"joe" => "Joe",
"dan" => "Daniel",
...
);
# Build your phrase in free English, like:
print "On $date, user $users{$user} $actions{$action}...";
Hth,
Oliver.
--
Dr. Oliver Corff e-mail: corff@zedat.fu-berlin.de
------------------------------
Date: Fri, 19 May 2006 08:25:42 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Text parsing and substitution
Message-Id: <slrne6rhqm.4n0.tadmc@magna.augustmail.com>
maheshpop1@gmail.com <maheshpop1@gmail.com> wrote:
> I am doing this module where I am gonna change the following sentence
>
> "1:action=commit:user=joe:date=2005-02-02:"
> "2:action=checkout:user=mark:date=2005-02-03:"
^^^^
> to something like
> " 1. Commits by user Joe on date 2005-02-02 "
> " 2. Checkouts by user Joe on date 2005-02-03"
^^^
Why did mark's name change to Joe?
Why a trailing space in the 1st one but not in the 2nd one?
Why one space in the 1st one but 2 spaces in the 2nd one?
Are those double quotes actually in your data, or are they
meant to be "meta"?
> pseudocode only
Why?
It takes only a tiny bit of effort to bypass the confusion
caused by the pseudoness.
The value of the answer you can expect to receive is directly
proportional to the effort you put into forming your question...
> if(hash{action}=='commit') <---this is a mandatory field
if( $hash{$action} eq 'commit' ) <---this is a mandatory field
There, that wasn't very hard now was it?
> Any suggestions or ideas on how to better
> achieve what I want to do above.
----------------------------------
#!/usr/bin/perl
use warnings;
use strict;
while ( <DATA> ) {
chomp;
chop; # don't need final colon
my($num, %attrs) = split /[:=]/;
$attrs{action} .= 's'; # pluralize
s/(.)/\u$1/ for values %attrs; # upper case 1st letter
printf "%2d. %s by user %s on date %s\n",
$num, @attrs{ qw/action user date/ };
}
__DATA__
1:action=commit:user=joe:date=2005-02-02:
2:action=checkout:user=mark:date=2005-02-03:
----------------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 19 May 2006 16:19:53 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Text parsing and substitution
Message-Id: <e4kr8r.1f4.1@news.isolution.nl>
maheshpop1@gmail.com schreef:
> change the following sentence
>
> "1:action=commit:user=joe:date=2005-02-02:"
> "2:action=checkout:user=mark:date=2005-02-03:"
>
> to something like
> " 1. Commits by user Joe on date 2005-02-02 "
> " 2. Checkouts by user Joe on date 2005-02-03"
This assumes that the fields are allways in the same order:
#!/usr/bin/perl
use strict;
use warnings;
while ( <DATA> )
{
s{ ^ ([^:]+)
: (action) = ([^:]+)
: (user) = ([^:]+)
: (date) = ([^:]+)
:
}
{$1. \u$3s by $4 \u$5 on $6 $7}x
and print
}
__DATA__
1:action=commit:user=joe:date=2005-02-02:
2:action=checkout:user=mark:date=2005-02-03:
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 19 May 2006 07:55:39 -0700
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Text parsing and substitution
Message-Id: <1148050539.164858.91130@i39g2000cwa.googlegroups.com>
Tad McClellan wrote:
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> while ( <DATA> ) {
> chomp;
> chop; # don't need final colon
not necessary, split will not include it as empty trailing fields are
deleted.
> my($num, %attrs) = split /[:=]/;
very nice, I always seem to forget that you can initialize a hash with
a list in that way.
> $attrs{action} .= 's'; # pluralize
> s/(.)/\u$1/ for values %attrs; # upper case 1st letter
how about:
ucfirst for values %attrs;
> printf "%2d. %s by user %s on date %s\n",
> $num, @attrs{ qw/action user date/ };
> }
>
> __DATA__
> 1:action=commit:user=joe:date=2005-02-02:
> 2:action=checkout:user=mark:date=2005-02-03:
> ----------------------------------
-jp
------------------------------
Date: 19 May 2006 05:44:23 -0700
From: "jussi" <salmjuh@hotmail.com>
Subject: Using printf to modify scalars
Message-Id: <1148042663.774894.238000@u72g2000cwu.googlegroups.com>
Hi Gurus
I try to make an timecode generator and my problem is that using printf
I can get right format. But I can't use printf to modify scalars
format:
Here is what get so far:
------------- START ---------------
#!/usr/bin/perl -w
$time_seconds = 0;
$time_minutes = 0;
$time_hours = 10;
while (</tmp/*.jpg>)
{
$time_frames = $time_frames + 1 ;
if ($time_frames < 10 ) {
$time_frames = "0".$time_frames;
}
if ($time_frames == 25) {
$time_frames = 0;
$time_seconds = $time_seconds + 1;
}
if ($time_seconds == 60) {
$time_seconds = 0;
$time_minutes = $time_minutes + 1;
}
if ($time_seconds < 10 ) {
$time_seconds = "0".$time_seconds ;
}
if ($time_minutes == 60 ){
$time_minutes = 0 ;
$time_hours = $time_hours + 1;
}
if ($time_minutes < 10 ){
$time_minutes = "0".$time_minutes;
}
$timecode = (printf
"%02d:%02d:%02d:%02d\n",$time_hours,$time_minutes,$time_seconds,$time_frames);
print "Time Code is: $timecode\n";
--------------------------- END ------------------------------
Printf gives me right format, but $timecode is constant 1 (=succesfull
??):
10:00:00:01
Time Code is: 1
10:00:00:02
Time Code is: 1
10:00:00:03
Time Code is: 1
10:00:00:04
Time Code is: 1
10:00:00:05
Time Code is: 1
10:00:00:06
Time Code is: 1
10:00:00:07
Time Code is: 1
10:00:00:08
Time Code is: 1
10:00:00:09
Time Code is: 1
10:00:00:10
Time Code is: 1
10:00:00:11
Time Code is: 1
10:00:00:12
Time Code is: 1
10:00:00:13
Time Code is: 1
10:00:00:14
Time Code is: 1
10:00:00:15
Time Code is: 1
10:00:00:16
Time Code is: 1
10:00:00:17
Time Code is: 1
10:00:00:18
Time Code is: 1
10:00:00:19
Time Code is: 1
10:00:00:20
Time Code is: 1
10:00:00:21
Time Code is: 1
10:00:00:22
So I would like to get time code in 10:00:00:22 format so I can pas it
to bash script
Any help would be very appreciate
-Jussi
------------------------------
Date: 19 May 2006 06:23:21 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Using printf to modify scalars
Message-Id: <1148045001.225516.264870@j55g2000cwa.googlegroups.com>
jussi wrote:
> [ question about printf() ]
Please read the documentation of the printf() function. Make sure that
you read at least as far as halfway through the first sentence before
you give up and ask for help.
Note: in general if you have question about a specific
function/module/error message whatever it's more efficient for all
concerned to try looking it up in the manual before asking for help.
------------------------------
Date: Fri, 19 May 2006 14:32:30 +0200
From: Yohan N. Leder <ynleder@nspark.org>
Subject: UTF-8 without external modules on Perl 5.0
Message-Id: <MPG.1ed7d94c8a18b430989852@news.tiscali.fr>
Hi,
I've a problem for which I've created
- a recent thread : <http://minilien.fr/a0juc6>,
- another one in the alt.html group : <http://minilien.fr/a0jubn>,
- an online script which show the problem :
<http://yohannl.tripod.com/cgi-bin/form2dump.pl>.
Well, this said, maybe a solution would be to use the UTF-8 charset for
my generated HTML pages... But, this is a problem for me because of
these reasons :
- Some target servers are using Perl 5.00503 under FreeBSD and there's
nothing about UTF-8 encoding/decoding in the stock modules of this
release.
- On those old servers, stock Perl modules only are authorized, even in
personal /cgi-bin directory. I'm aware it's a big constraint, but I've
not any way to change the decision about that : we have to do with this!
- HTML forms generated by the Perl scripts must be able to handle all
which may be usually typed in English and French language, including
euro sign.
- These Perl scripts contain a configurable part where different persons
(some being not developers) will be able to change some strings (stored
as constants : "use constant NAMEOFCONSTANT => "The string people can
write, rewrite and manage by themself as if it was a configuration
feature";"), and we can't ask them to type character entity rather than
special or accentuated characters when there will be ones (e.g.
à, etc). So, if I would choose to use UTF-8, I should, in the
same time, find a way (without external module) to encode these
"configurable strings" prior to display them in any browser.
How to manage UTF-8 in these conditions ?
------------------------------
Date: Fri, 19 May 2006 16:53:01 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: variable that I want to treat as information read from a txt file, using a while loop
Message-Id: <1148050383.196948@proxy.dienste.wien.at>
Tad McClellan:
>> $ perl -ne '/<expression>(.*)<\/expression>/ and print "$1\n"' input.txt
>>>output.txt
>
> That will fail if there are more than one expression elements on a line.
Of course, but the OP wrote:
> input.txt:
> --
> <expression>start</expression>
> <expression>end</expression
so I thought more elements on a line are not an issue.
Greetings, Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: 19 May 2006 05:32:45 -0700
From: "Mr P" <MisterPerl@gmail.com>
Subject: why doesn't this eval print ?
Message-Id: <1148041964.817816.228350@i39g2000cwa.googlegroups.com>
eval 'print "hello world"';
main::(x.pl:4): eval 'print "hello world"';
DB<1> n
main::((eval 8)[x.pl:4]:1): print "hello world"
DB<1>
*DOH!* Where IS it!?
-Homer
------------------------------
Date: 19 May 2006 07:42:24 -0700
From: niall.macpherson@ntlworld.com
Subject: Re: why doesn't this eval print ?
Message-Id: <1148049744.105295.218650@38g2000cwa.googlegroups.com>
Mr P wrote:
> eval 'print "hello world"';
>
> main::(x.pl:4): eval 'print "hello world"';
> DB<1> n
> main::((eval 8)[x.pl:4]:1): print "hello world"
> DB<1>
>
>
> *DOH!* Where IS it!?
>
> -Homer
Did you hit 'n' again to execute the last line of code ? It works as
expected for me using Active state 5.8.7
C:\develop\NiallPerlScripts>perl -d eval1.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
main::(eval1.pl:1): eval 'print "hello world"';
SetConsoleMode failed, LastError=|6| at
C:/Perl/site/lib/Term/ReadKey.pm line 26
5.
at C:/Perl/site/lib/Term/ReadLine/readline.pm line 1415
readline::readline(' DB<1> ') called at
C:/Perl/site/lib/Term/ReadLine/
Perl.pm line 12
Term::ReadLine::Perl::readline('Term::ReadLine::Perl=ARRAY(0x18d537c)',
' DB<1> ') called at C:/Perl/lib/perl5db.pl line 6367
DB::readline(' DB<1> ') called at C:/Perl/lib/perl5db.pl line
2203
DB::DB called at eval1.pl line 1
DB<1> n
main::((eval 10)[eval1.pl:1]:1): print "hello world"
DB<1> n
hello worldDebugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1>
------------------------------
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 9235
***************************************